Troubleshooting

Last updated 12 days ago

Requirements

  • Android 4.4 (API level 19) and above

  • Devices that support GPS. Devices with only A-GPS are not supported

Dependencies

The SDK includes following dependencies. Latest version of these libraries will be automatically included as transitive dependencies.

Name

Version

Description

Google Play Services libraries

?

This includes play-services-gcm, play-services-location, play-services-maps and play-services-places libraries

Android Volley library

?

For HTTP networking

Gson library

?

For data serialization and deserialization

Managing dependency conflicts

HyperTrack SDK automatically includes the above mentioned libraries with their versions as specified. In case a different version of one of these libraries is a dependency to your app or to another library you have integrated, follow these steps to resolve this conflict.

Step 1: Remove the required dependency from the HyperTrack SDK by using exclude command

compile("com.hypertrack.core:android:0.8.12:release@aar") {
transitive = true;
exclude group: 'com.google.android.gms', module: 'play-services'
}

Step 2: Manually add those dependencies with the versions that you intend to use

dependencies {
compile 'com.google.android.gms:play-services-gcm:15.0.0'
compile 'com.google.android.gms:play-services-location:15.0.0'
compile 'com.google.android.gms:play-services-maps:15.0.0'
compile 'com.google.android.gms:play-services-places:15.0.0'
...
}

Step 3: Clear your Gradle cache and sync your project

Persistent notification

HyperTrack SDK, by default, runs as a foreground service. This is to ensure that the location tracking works reliably even when your app is minimized. A foreground service is a service that the user is actively aware of and isn't a candidate for the system to kill when low on memory.

Android mandates that a foreground service provides a persistent notification in the status bar. This means that the notification cannot be dismissed by the user.

Persistent notification

Handling custom ROMs

Smartphones are getting more and more powerful, but the battery capacity is lagging behind. Device manufactures are always trying to squeeze some battery saving features into the firmware with each new Android release. Manufactures like Xiaomi, Huawei and OnePlus have their own battery savers that kills the services running in the background. Read more.

To avoid OS killing the service, users of your app need to override the automatic battery management and set it manual. To inform your users and direct them to the right setting page, you may add the following code in your app. This would intent out your user to the right settings page on the device.

try {
Intent intent = new Intent();
String manufacturer = android.os.Build.MANUFACTURER;
if ("xiaomi".equalsIgnoreCase(manufacturer)) {
intent.setComponent(new ComponentName("com.miui.securitycenter", "com.miui.permcenter.autostart.AutoStartManagementActivity"));
}
else if ("oppo".equalsIgnoreCase(manufacturer)) {
intent.setComponent(new ComponentName("com.coloros.safecenter", "com.coloros.safecenter.permission.startup.StartupAppListActivity"));
}
else if ("vivo".equalsIgnoreCase(manufacturer)) {
intent.setComponent(new ComponentName("com.vivo.permissionmanager", "com.vivo.permissionmanager.activity.BgStartUpManagerActivity"));
}
List<ResolveInfo> list = context.getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
if (list.size() > 0) {
context.startActivity(intent);
}
}
catch (Exception e) {
Crashlytics.logException(e);
}

You may also try out open source libraries like https://github.com/judemanutd/AutoStarter

Common issues

Debugging

<coming soon>