To track the location of the user in the background with Android, we need to request five permissions, as shown in the following table:
ACCESS_COARSE_LOCATION | To get an approximate location for the user. |
ACCESS_FINE_LOCATION | To get a precise location for the user. |
ACCESS_NETWORK_STATE | We need this because the location services in Android use information from a network to determine the location of the user. |
ACCESS_WIFI_STATE | We need this because the location services in Android use information from a Wi-Fi network to determine the location of the user. |
RECEIVE_BOOT_COMPLETED | So that the background job can start again after the device is rebooted. |
Permissions can be set either from the Android Manifest tab in the properties of the MeTracker.Android project or via the AndroidManifest.xml file in the Properties folder. When changes are made from the Android Manifest tab, the changes will be written...