Android Google Map Search Location using GeocoderIn the previous tutorial of Android Google Map and Android Google Map Displaying Current Location we described about display basic Google Map and current location respectively. Now in this tutorial we will implement location search functionality in Google Map. Searching location in Google Map API is done through Geocoder class. Geocoder class is used to handle geocoding and reverse geocoding. Geocoding is a process in which street address is converted into a coordinate (latitude,longitude). Reverse geocoding is a process in which a coordinate (latitude,longitude) is converted into an address. Methods of Geocoder class
Let's see the code which convert location name into coordinate. Example of Android Google Map API Searching LocationLet's see an example of Google Map which search input location. activity_maps.xmlAdd a fragment (SupportMapFragment), EditText and Button in activity_maps.xml file. build.gradelAdd the following dependencies in build.gradel file. MapsActivity.javaAdd the following code in MapsActivity.java file. Required Permission in AndroidManifest.xmlAdd the following user-permission in AndroidManifest.xml file. AndroidManifest.xmlOutput ![]() ![]() ![]()
Next TopicAndroid Google Admob
|
JavaTpoint offers too many high quality services. Mail us on h[email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].
Duration: 1 week to 2 week