public final class

AmazonMapsRuntimeUtil

extends Object
java.lang.Object
   ↳ com.amazon.geo.mapsv2.util.AmazonMapsRuntimeUtil

Class Overview

Class providing utility methods for the Amazon Maps API.

Summary

Constants
String AMAZON_MAPS_RUNTIME_PACKAGE Name of the Amazon Maps API package.
String ERROR_DIALOG_TAG Tag used for error dialog fragments.
String TAG Tag used when writing messages to the log.
Public Methods
static Dialog getErrorDialog(int errorCode, Activity activity, int requestCode, DialogInterface.OnCancelListener cancelListener)
Creates a dialog for a given error with a cancel listener.
static Dialog getErrorDialog(int errorCode, Activity activity, int requestCode)
Creates a dialog for a given error.
static PendingIntent getErrorPendingIntent(int errorCode, Context context, int requestCode)
Gets an intent to handle a recoverable error such as a required update.
static String getErrorString(int errorCode)
Gets a readable string for a given error code.
static String getOpenSourceSoftwareLicenseInfo(Context context)
Returns a String containing license info for open source software used by the library.
static Context getRemoteContext(Context hostContext)
Gets the remote context of the Amazon Maps services.
static Resources getRemoteResource(Context context)
Gets the resources of the remote context.
static int isAmazonMapsRuntimeAvailable(Context context)
Returns an integer code indicating whether the Amazon Maps API library is available on the device.
static boolean isAmazonSignedUid(PackageManager packageManager, int uid)
Verifies if the uid belongs to an Amazon signed app.
static boolean isUserRecoverableError(int errorCode)
Returns a boolean value indicating whether the specified error is recoverable through user interaction such as installing an update.
static boolean showErrorDialogFragment(int errorCode, Activity activity, int requestCode)
Shows a dialog fragment for a given error.
static boolean showErrorDialogFragment(int errorCode, Activity activity, int requestCode, DialogInterface.OnCancelListener cancelListener)
Shows a dialog fragment for a given error with a cancel listener.
void showErrorNotification(int errorCode, Context context)
Shows a notification for a given error.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String AMAZON_MAPS_RUNTIME_PACKAGE

Name of the Amazon Maps API package.

Constant Value: "com.amazon.geo.mapsv2.services"

public static final String ERROR_DIALOG_TAG

Tag used for error dialog fragments.

Constant Value: "AmazonMapsErrorDialog"

public static final String TAG

Tag used when writing messages to the log.

Constant Value: "AmazonMapsV2"

Public Methods

public static Dialog getErrorDialog (int errorCode, Activity activity, int requestCode, DialogInterface.OnCancelListener cancelListener)

Creates a dialog for a given error with a cancel listener.

Parameters
errorCode The ConnectionResult error code.
activity The parent activity.
requestCode The request code. Can be 0.
cancelListener The dialog cancel listener.
Returns
  • The error dialog.

public static Dialog getErrorDialog (int errorCode, Activity activity, int requestCode)

Creates a dialog for a given error.

Parameters
errorCode The ConnectionResult error code.
activity The parent activity.
requestCode The request code. Can be 0.
Returns
  • The error dialog.

public static PendingIntent getErrorPendingIntent (int errorCode, Context context, int requestCode)

Gets an intent to handle a recoverable error such as a required update.

Parameters
errorCode The ConnectionResult error code.
context The app context.
requestCode The request code. Can be 0.

public static String getErrorString (int errorCode)

Gets a readable string for a given error code.

Parameters
errorCode The ConnectionResult error code.

public static String getOpenSourceSoftwareLicenseInfo (Context context)

Returns a String containing license info for open source software used by the library.

Parameters
context The app context.
Returns
  • The license info.

public static Context getRemoteContext (Context hostContext)

Gets the remote context of the Amazon Maps services.

Parameters
hostContext The app context.
Returns
  • The remote context.

public static Resources getRemoteResource (Context context)

Gets the resources of the remote context.

Parameters
context The app context.
Returns
  • The resources.

public static int isAmazonMapsRuntimeAvailable (Context context)

Returns an integer code indicating whether the Amazon Maps API library is available on the device. Refer to ConnectionResult for possible error values.

Parameters
context The app context.
Returns

public static boolean isAmazonSignedUid (PackageManager packageManager, int uid)

Verifies if the uid belongs to an Amazon signed app.

Throws
SecurityException if the uid doesn't belong to an Amazon signed app.

public static boolean isUserRecoverableError (int errorCode)

Returns a boolean value indicating whether the specified error is recoverable through user interaction such as installing an update.

Parameters
errorCode The ConnectionResult error code.
Returns
  • true if the specified error is recoverable, {code false} otherwise.

public static boolean showErrorDialogFragment (int errorCode, Activity activity, int requestCode)

Shows a dialog fragment for a given error.

Parameters
errorCode The ConnectionResult error code.
activity The parent activity.
requestCode The request code. Can be 0.
Returns
  • true if the dialog fragment is successfully shown.

public static boolean showErrorDialogFragment (int errorCode, Activity activity, int requestCode, DialogInterface.OnCancelListener cancelListener)

Shows a dialog fragment for a given error with a cancel listener.

Parameters
errorCode The ConnectionResult error code.
activity The parent activity.
requestCode The request code. Can be 0.
cancelListener The dialog cancel listener.
Returns
  • true if the dialog fragment is successfully shown.

public void showErrorNotification (int errorCode, Context context)

Shows a notification for a given error.

Parameters
errorCode The ConnectionResult error code.
context The app context.