public class OfflineManager
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
OfflineManager.CreateOfflineRegionCallback
This callback receives an asynchronous response containing the newly created
OfflineRegion in the database, or an error message otherwise. |
static interface |
OfflineManager.ListOfflineRegionsCallback
This callback receives an asynchronous response containing a list of all
OfflineRegion in the database, or an error message otherwise. |
| Modifier and Type | Method and Description |
|---|---|
void |
createOfflineRegion(OfflineRegionDefinition definition,
byte[] metadata,
OfflineManager.CreateOfflineRegionCallback callback)
Create an offline region in the database.
|
java.lang.String |
getAccessToken()
Deprecated.
As of release 4.1.0, replaced by
MapboxAccountManager.getAccessToken() |
static java.lang.String |
getDatabasePath(android.content.Context context) |
static OfflineManager |
getInstance(android.content.Context context) |
static boolean |
isExternalStorageReadable()
Checks if external storage is available to at least read.
|
void |
listOfflineRegions(OfflineManager.ListOfflineRegionsCallback callback)
Retrieve all regions in the offline database.
|
void |
setAccessToken(java.lang.String accessToken)
Deprecated.
As of release 4.1.0, replaced by
MapboxAccountManager.start(Context, String) ()} |
void |
setOfflineMapboxTileCountLimit(long limit) |
public static java.lang.String getDatabasePath(android.content.Context context)
public static boolean isExternalStorageReadable()
Code from https://developer.android.com/guide/topics/data/data-storage.html#filesExternal
public static OfflineManager getInstance(android.content.Context context)
@Deprecated public void setAccessToken(java.lang.String accessToken)
MapboxAccountManager.start(Context, String) ()}accessToken - @Deprecated public java.lang.String getAccessToken()
MapboxAccountManager.getAccessToken()public void listOfflineRegions(OfflineManager.ListOfflineRegionsCallback callback)
The query will be executed asynchronously and the results passed to the given callback on the main thread.
public void createOfflineRegion(OfflineRegionDefinition definition, byte[] metadata, OfflineManager.CreateOfflineRegionCallback callback)
When the initial database queries have completed, the provided callback will be executed on the main thread.
Note that the resulting region will be in an inactive download state; to begin downloading resources, call `OfflineRegion.setDownloadState(DownloadState.STATE_ACTIVE)`, optionally registering an `OfflineRegionObserver` beforehand.
public void setOfflineMapboxTileCountLimit(long limit)