public class OfflineManager extends 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.
|
protected void |
finalize() |
static OfflineManager |
getInstance(Context context)
Get the single instance of offline manager.
|
void |
listOfflineRegions(OfflineManager.ListOfflineRegionsCallback callback)
Retrieve all regions in the offline database.
|
void |
setOfflineMapboxTileCountLimit(long limit)
Changing or bypassing this limit without permission from Mapbox is prohibited
by the Mapbox Terms of Service.
|
public static OfflineManager getInstance(Context context)
context
- the context used to host the offline managerpublic void listOfflineRegions(@NonNull OfflineManager.ListOfflineRegionsCallback callback)
The query will be executed asynchronously and the results passed to the given callback on the main thread.
callback
- the callback to be invokedpublic void createOfflineRegion(@NonNull OfflineRegionDefinition definition, @NonNull 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.
definition
- the offline region definitionmetadata
- the metadata in bytescallback
- the callback to be invokedpublic void setOfflineMapboxTileCountLimit(long limit)
limit
- the new tile count limit.© 2015–2017 Mapbox. All rights reserved.