Quickstart

The Location module provides an interface for obtaining and working with location updates. It provides implementations for getting an actual user location with and without Google Services, as well as one for simulating locations.

To use the Location module, you need to configure the project and add the dependencies.

Project set up

  1. Configure the project as described in the Project setup guide.
  2. Add the module dependency in the build.gradle of your application module and synchronize the project.

Dependencies

The Location module provides different location engine implementations. To use each one you need to add its dependency in the module’s build.gradle.

  • AndroidLocationEngine – relies on the Android system location services, which does not require Google services.
    1dependencies {
    2 implementation "com.tomtom.sdk:location-android:0.3.34"
    3}
  • GmsLocationEngine – based on the Google service’s location updates.
    1dependencies {
    2 implementation "com.tomtom.sdk:location-gms:0.3.34"
    3}
  • ProxyLocationEngine - publishes locations that are programmatically provided .
    1dependencies {
    2 implementation "com.tomtom.sdk:location-proxy:0.3.34"
    3}
  • LocationEngine - an interface to implement with a custom location engine. It is included in all of the dependencies listed above.
    1dependencies {
    2 implementation "com.tomtom.sdk:location-api:0.3.34"
    3}

Location permissions

If the application is going to use user location data, you have to request the correct permissions. In particular, the user must grant location permission before the location engine can be used. Complete instructions to request location permissions on Android can be found here.