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.