0

I've implemented these instructions Advanced Positioning By Here to achieve the functionality described by them. It is working with Android 10 and below, but I cannot get it to work with Android 11. In the code below I try to make Positioning Manager to start collecting locations:

mPositioningManager?.run {
    if (!isActive) {
        val locationDataSource = LocationDataSourceHERE.getInstance()
        // "this" is mPositioningManager
        this.dataSource = locationDataSource
        retorno = this.start(PositioningManager.LocationMethod.GPS_NETWORK_INDOOR)
    }
    if (!isListenerAdded && retorno) {
        this.addListener(WeakReference(this@AppPositioningManager))
        isListenerAdded = true
    }
}

The start function returns false. But if I do not change the PositioningManager's data source to LocationDataSourceHere and then call start with PositioningManager.LocationMethod.GPS_NETWORK as its parameter, I got it to work with Android 11 and in the previous versions as well. I am using Here Android Sdk Premium version 3.17.2.132. My configuration in the AndroidManifest is

<service
    android:name="com.here.services.internal.LocationService"
    android:enabled="true"
    android:exported="false"
    android:process=":remote">
</service>

Tell me if you need more information!

Thanks.

  • Consider to migrate to the Navigate Edition, it already supports Android 12: https://developer.here.com/documentation/android-sdk-navigate/4.9.4.0/dev_guide/topics/get-locations.html – Nusatad Dec 16 '21 at 19:28

1 Answers1

0

How about try a new version of SDK? current version is 3.19.