Find address as per input using Google Places api in android

26 Mar

Solution for this is moved and maintain on


Posted by on March 26, 2014 in Android Source Code


10 responses to “Find address as per input using Google Places api in android

  1. Adit Lucman

    April 15, 2014 at 7:54 AM

    Hi! i tried your code in my app and it works.. I am really a beginner in programming.. For example Now i want to get the longitude and latitude of the clicked list. How can i achieve that?

    • Nikhil Lotke

      April 16, 2014 at 6:36 AM

      Hi Adit,
      Thanks for your feedback. Keep following my blog, will help you for sure…
      Well to find the latitude and longitude from address you need to add following code.

      Geocoder coder = new Geocoder(this);
      List<Address> address;
      try {
          address = coder.getFromLocationName(strAddress,5);
          if (address == null) {
              return null;
          Address location = address.get(0);
          p1 = new GeoPoint((int) (location.getLatitude() * 1E6),
                            (int) (location.getLongitude() * 1E6));
           return p1;
  2. Adit Lucman

    May 2, 2014 at 6:13 PM

    hi again.. thank you, although i managed to solved it my self. For sure ill follow your blog, awesome work!

    thanks again!

  3. Muhammad Zahid

    July 23, 2014 at 5:06 AM

    Hi Nikhil ….i tried your code but auto complete action not working .no place were shown when i enter in the edittext….help me pleas

    • Nikhil Lotke

      July 24, 2014 at 4:14 PM

      Hi Muhammad,
      Did you import everything which i mentioned above in your project. Well i have not mentioned how to generate API Key. So would recommend you to please go through API Key generation and integrate it into the code above. Also add google service lib which will help you to connect to maps and many other google services….

  4. Jayneel

    September 19, 2014 at 9:56 AM

    Hi Nikhil , your code is about to perfect but I am Not getting auto complete suggestions are not working , Place API gives jsonResopnse : REQUEST_DENIED..Any solution?

    • Nikhil Lotke

      September 19, 2014 at 10:03 AM

      Hi Jayneel
      Please check your API key once again for google maps. Request denied error you will get if API key is not generated properly.

  5. Jayneel

    October 6, 2014 at 8:53 AM

    Finally done with the Places API..Thanks

  6. Joanna

    November 7, 2016 at 12:30 AM

    May I ask question: I use android studio to to edit this code, but still can’t working, I sure have including API Key, Is have any possible I lost something? Thanks


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: