Android: 1.2. Forward and Reverse Geocoding
Android: 1.2. Forward and Reverse Geocoding
This can be done via a GPS (Global Positioning System) device, via cell tower triangulation or via wifi networks for which the geolocation is known. Android provides the package "android.location" which provides the API to determine the current geo position. The class "LocationManager" provides access to the location service . The Android device might have several providers available and you can select one of them. For a flexible selection of the best location provider use a "Criteria" object in which you can define how the provider should be selected. You can register a "LocationListener" with the "LocationManager" and will receive periodic updates about the geoposition. The class "LocationProvider" is the superclass of the different location providers which deliver the information about the current location. You can also register an Intent also allows to define a proximity alert, this alert will be triggered if the device enters a area given by a longitude, latitude and radius (proximity alert).
The class "MapActivity" extends the class "Activity" and provides the life-cycle management and the services for displaying a Map in a "MapView". MapActivity is for maps what ListActivity is for lists. A "MapView" is typically defined in the layout for the MapActivity and requires the API key in the attribute android:apiKey. A MapView can be used with other UI components in the same layout. The class "MapController" can be used to interact with the "MapView", e.g. by moving it. A "Geopoint" is a position described via latitude and longitude and the class "Overlay" can be used to drawn on the map, for example position markers. The usage of Google Maps also requires the permission to access the Internet as the Google Maps data is read from it.
3. Android Device
3.1. Device with Google API
In case you want to use Google Maps in your emulator you have to create a device which supports the Google API's. This requires that you also install the "Google API" (see Android development tutorial ). During device creation select the target Google API's in the version of your SDK.