Geocoding is a concept used to convert an address(or location) to a latitude/longitude pair.
It's provided in android.locatin.Geocoder with the following methods.
- getFromLocation
- getFromLocationName
- getFromLocationName*
The way to get location manager service is as below.
LocationManager locMgr = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
The LocationManager service is a system-level service.
System-level services are services that you obtain from the context using the service name; you don't instantiate them directly, and it also provides geographical location details by using three types of location providers:
- GPS providers LocationManager.GPS_PROVIDER
- Network providers LocationManager.NETWORK_PROVIDER
- passive provider LocationManager.PASSIVE_PROVIDER
Permissions:
- android.permission.ACCESS_FINE_LOCATION
- android.permission.ACCESS_COARSE_LOCATION
Use the flowing source to invoke location settings screen.
startActivityForResult(new Intent(android.provider.Settings.ACTION_LOCATIN_SOURCE_SETTINGS), 0)
GPX: GPS Exchange Format
KML: Keyhole Markup Language
Use
MyLocationOverLay to show where you are now.
<Receiver android:name=".ProximityReceiver">
<intent-filter>
<action android:name="com.androidbook.android.intent.PROXIMITY_ALERT" />
<data android:scheme="geo" />
</intent-filter>
</Receiver>