public final class Mapbox extends Object
Obtain a reference by calling getInstance(Context, String)
. Usually this class is configured in
Application#onCreate() and is responsible for the active access token, application context, and
connectivity state.
Modifier and Type | Method and Description |
---|---|
static String |
getAccessToken()
Access token for this application.
|
static Context |
getApplicationContext()
Application context
|
static Mapbox |
getInstance(Context context,
String accessToken)
Get an instance of Mapbox.
|
static ModuleProvider |
getModuleProvider()
Get the module provider
|
static TelemetryDefinition |
getTelemetry()
Get an instance of Telemetry if initialised
|
static Boolean |
isConnected()
Determines whether we have an internet connection available.
|
static void |
setConnected(Boolean connected)
Manually sets the connectivity state of the app.
|
public static Mapbox getInstance(Context context, String accessToken)
This class manages the Mapbox access token, application context, and connectivity state.
context
- Android context which holds or is an application contextaccessToken
- Mapbox access tokenpublic static String getAccessToken()
public static Context getApplicationContext()
public static void setConnected(Boolean connected)
connected
- flag to determine the connectivity state, true for connected, false for
disconnected, and null for ConnectivityManager to determine.public static Boolean isConnected()
public static TelemetryDefinition getTelemetry()
public static ModuleProvider getModuleProvider()
© 2015–2018 Mapbox. All rights reserved.