Customization Options for Android

Note: CrashManager and UpdateManager are integrated separately and serve different functions. For instance, HockeyApp won't count the number of times your app has been installed if you only integrate crash reporting and not the update manager.

Basics

We assume that you have already integrated the HockeySDK as described here. Then your code should include the following two lines (or only one of them if you only want crash reporting or beta distribution):

CrashManager.register(this);
UpdateManager.register(this);

Both methods take an additional third parameter, an instance of the classes CrashManagerListener and HockeyManagerListener respectively. The methods of these classes are all optional, so you can implement only some of them. The following examples each show a single method for clarity.

Note that the examples use a non-static inner class for the listener. This class might be kept alive longer than its container (especially the CrashManagerListener is kept alive for complete lifespan of the app), which will lead to a leak of the container due to the implicit reference. You can solve this by keeping a reference from the containing class to the listener or by using a static inner class, for example:

Note: This reads the system log (similar to 'adb logcat') and filters it for lines with the tag "HockeyApp". You need to replace this string with your own tag. In addition, the permission "READ_LOGS" needs to be set in the AndroidManifest.xml. We don't recommend to do this in your live apps.

Method: getUserID

Return a user ID or similar; note that this has privacy implications, so you might want to return nil for release builds! The string will be limited to 255 characters.

Method: onUpdateAvailable

Called when the update manager found an update.

Example:

UpdateManager.register(this, APP_ID, new UpdateManagerListener() {
public void onUpdateAvailable() {
// Something you want to do when an update is available, e.g.
// enable a button to install the update. Note that the manager
// shows an alert dialog after the method returns.
}
});

Language Localization:

HockeySDK for Android comes with English, French, German and Spanish localizations of all user interface strings. If you want to add further localizations or override certain strings to suit your app's user interface, you can simply override them and resource merging takes care of the rest.