This sample demonstrates how to synchronize offline edits with a feature service.
- Pan and zoom into the desired area, making sure the area you want to take offline is within the current extent of the
MapView
. - Tap on the Generate Geodatabase button. This will call
generateGeodatabase()
, which will return aGenerateGeodatabaseJob
. - Once the job completes successfully, a
GeodatabaseFeatureTable
and aFeatureLayer
are created from the resultingGeodatabase
. TheFeatureLayer
is then added to theArcGISMap
. - Once the
FeatureLayer
generated from the localGeodatabase
is displayed, aFeature
can be selected by tapping on it. The selectedFeature
can be moved to a new location by tapping anywhere on the map. - Once a successful edit has been made to the
FeatureLayer
, the Sync Geodatabase button is enabled. This button synchronizes local edits made to the localGeoDatabase
with the remote feature service usingsyncGeodatabase()
which generatesSyncGeodatbaseParameters
and passes them to aSyncGeodatabaseJob
. - Once the job successfully completes, the local edits are synchronized with the feature service.
- FeatureLayer
- FeatureTable
- GeodatabaseSyncTask
- GenerateGeodatabaseJob
- GenerateGeodatabaseParameters
- SyncGeodatabaseJob
- SyncGeodatabaseParameters
- SyncLayerOption
- Download the data from ArcGIS Online.
- Extract the contents of the downloaded zip file to disk.
- Create an ArcGIS/samples/MapPackage folder on your device. You can use the Android Debug Bridge (adb) tool found in /platform-tools.
- Open up a command prompt and execute the
adb shell
command to start a remote shell on your target device. - Navigate to your sdcard directory, e.g.
cd /sdcard/
. - Create the ArcGIS/samples/TileCache directory,
mkdir ArcGIS/samples/TileCache
. - You should now have the following directory on your target device,
/sdcard/ArcGIS/samples/TileCache
. We will copy the contents of the downloaded data into this directory. Note: Directory may be slightly different on your device. - Exit the shell with the,
exit
command. - While still in your command prompt, navigate to the folder where you extracted the contents of the data from step 1 and execute the following command:
adb push SanFrancisco.tpk /sdcard/ArcGIS/samples/TileCache
Link | Local Location |
---|---|
San Francisco Tile Cache | <sdcard> /ArcGIS/samples/TileCache/SanFrancisco.tpk |