Google Places API in Android
<p>I am not getting the result after running this code.</p>

<pre><code>package com.google.autocomplete;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.Button;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.util.ArrayList;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class AutoCompleteActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        final ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,R.layout.item_list);
        AutoCompleteTextView textView = (AutoCompleteTextView)
                findViewById(R.id.autoCompleteTextView1);
        adapter.setNotifyOnChange(true);
        textView.setAdapter(adapter);
        textView.addTextChangedListener(new TextWatcher() {

public void onTextChanged(CharSequence s, int start, int before, int count) {
if (count%3 == 1) {
adapter.clear();
try {

            URL googlePlaces = new URL(
            // URLEncoder.encode(url,"UTF-8");
                    "https://maps.googleapis.com/maps/api/place/autocomplete/json?input="+ URLEncoder.encode(s.toString(), "UTF-8") +"&amp;types=establishment&amp;language=en&amp;sensor=true&amp;key=0sJSo9PVeQmdLNTNqGBRmhz1B-5KovBnHbEXQoA");
           // "https://maps.googleapis.com/maps/api/place/search/json?key=0sJSo9PVeQmdLNTNqGBRmhz1B-5KovBnHbEXQoA&amp;location=37.994682,-87.6045923&amp;radius=500&amp;sensor=false&amp;types-geocode");
          //  "https://maps.googleapis.com/maps/api/place/autocomplete/json?input="+ URLEncoder.encode(arg0[0], "UTF-8") +"&amp;types=geocode&amp;language=fr&amp;sensor=true&amp;key=" + 0sJSo9PVeQmdLNTNqGBRmhz1B-5KovBnHbEXQoA);
            URLConnection tc = googlePlaces.openConnection();
            Log.d("GottaGo", URLEncoder.encode(s.toString()));
            BufferedReader in = new BufferedReader(new InputStreamReader(
                    tc.getInputStream()));

            String line;
            StringBuffer sb = new StringBuffer();
            while ((line = in.readLine()) != null) {
            sb.append(line);
            }
            JSONObject predictions = new JSONObject(sb.toString());              
            JSONArray ja = new JSONArray(predictions.getString("predictions"));

                for (int i = 0; i &lt; ja.length(); i++) {
                    JSONObject jo = (JSONObject) ja.get(i);
                    adapter.add(jo.getString("description"));

                    //ja[0];
                }


        } catch (MalformedURLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
}           

}

public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
// TODO Auto-generated method stub

}

public void afterTextChanged(Editable s) {

}
});    


    }
}
</code></pre>

<p>after running this code, im getting only the textbox,i f i write some place's name, i am not getting the result!</p>

<p>Please help!</p>

<p>I am following this tutorial</p>

<p><a href="http://www.claytical.com/blog/android-dynamic-autocompletion-using-google-places-api" rel="nofollow">http://www.claytical.com/blog/android-dynamic-autocompletion-using-google-places-api</a></p>
