-1

I have an android app that have an Edit text in which users can enter a city name and the app must get the longitude and latitude for use in calling another API.

How can I implement this type of thing?

I searched for and found that google geocoding API should help me ,but I must also implement google maps API, I don't know if this right.

However, my app must not have a map at all.

If this is right, is there any other api that I can give it the city name and return the longitude and latitude of it?

Ali Habbash
  • 709
  • 2
  • 5
  • 25
  • Possible duplicate of [How can I find the latitude and longitude from address?](https://stackoverflow.com/questions/3574644/how-can-i-find-the-latitude-and-longitude-from-address) –  Nov 11 '17 at 14:10

1 Answers1

1

You don't need to implement Google Maps. You can use Google Place Autocomplete: https://developers.google.com/places/android-api/autocomplete.

With this, you will have a search bar and when you type, it will fetch the places and give you latitude / longitude and much more.

You can easily add Google Places to build.gradle: compile 'com.google.android.gms:play-services-places:11.4.2'

Robert D. Mogos
  • 1,291
  • 7
  • 14