HERE Android SDK Developer's Guide

ApplicationContext

The class ApplicationContext is a member of com.here.android.mpa.common .

Class Summary

public final class ApplicationContext

extends java.lang.Object

ApplicationContext manages setting of custom application credentials and map variant.

[For complete information, see the section Class Details]

Constructor Summary

Table 1. Constructors in ApplicationContext
Constructors

ApplicationContext (Context ctx)

Creates a ApplicationContext with specified application context.

Method Summary

Table 2. Methods in ApplicationContext
Methods

public ApplicationContext setAppIdCode (String appId, String appCode)

Sets the application ID and application token that are obtained by registering at http://developer.here.com/.

public ApplicationContext setLicenseKey (String licenseKey)

Sets the license key that are obtained by registering at http://developer.here.com/.

public ApplicationContext setMapVariant (MapVariant mapVariant)

Sets needed map variant.

public ApplicationContext setSdkVersionInCrashStack (boolean value)

Sets whether or not to show the HERE SDK Version in crash stack traces.

Class Details

ApplicationContext manages setting of custom application credentials and map variant. Setting of any type of configuration should be made before the MapEngine is initialized.

Constructor Details

ApplicationContext (Context ctx)

Creates a ApplicationContext with specified application context.

Parameters:

  • ctx

    Application context.

Method Details

public ApplicationContext setAppIdCode (String appId, String appCode)

Sets the application ID and application token that are obtained by registering at http://developer.here.com/.

Parameters:

  • appId

    unique application identifier. It is empty by default.

  • appCode

    unique application code. It is empty by default.

Returns:

The updated ApplicationContext object itself.

public ApplicationContext setLicenseKey (String licenseKey)

Sets the license key that are obtained by registering at http://developer.here.com/.

Parameters:

  • licenseKey

    the license key defining application permissions. It is empty by default.

Returns:

The updated ApplicationContext object itself.

public ApplicationContext setMapVariant (MapVariant mapVariant)

Sets needed map variant.

Parameters:

  • mapVariant

    map variant to use. If never set, then will be used.

Returns:

The updated ApplicationContext object itself.

public ApplicationContext setSdkVersionInCrashStack (boolean value)

Sets whether or not to show the HERE SDK Version in crash stack traces. The default value is true.

By default, for Java, a Thread.UncaughtExceptionHandler is added which appends the HERE SDK Version to the normal stack trace. For Native, a lightweight thread is started which sleeps in a function containing names as the HERE SDK Version. Setting this to false disables both previously described behaviours.

Parameters:

  • value

Returns:

The updated ApplicationContext object itself.