Skip to content

Commit

Permalink
Alan/generategeodatabasereplicafromfeatureservice migration (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-edi authored Jan 14, 2025
2 parents a807756 + 53d4eda commit d4610d2
Show file tree
Hide file tree
Showing 10 changed files with 490 additions and 405 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ Zoom to any extent. Then click the generate button to generate a geodatabase of

1. Create a `GeodatabaseSyncTask` with the URL of the feature service and load it.
2. Create `GenerateGeodatabaseParameters` specifying the extent and whether to include attachments.
3. Create a `GenerateGeodatabaseJob` with `geodatabaseSyncTask.generateGeodatabaseAsync(parameters, downloadPath)`. Start the job with `job.start()`.
3. Create a `GenerateGeodatabaseJob` with `geodatabaseSyncTask.createGenerateGeodatabaseJob(parameters, downloadPath)`. Start the job with `job.start()`.
4. When the job is done, `job.result()` will return the geodatabase. Inside the geodatabase are feature tables which can be used to add feature layers to the map.
5. Call `syncTask.unregisterGeodatabaseAsync(geodatabase)` after generation when you're not planning on syncing changes to the service.
5. Call `geodatabaseSyncTask.unregisterGeodatabase(geodatabase)` after generation when you're not planning on syncing changes to the service.

## Relevant API

Expand All @@ -27,6 +27,10 @@ Zoom to any extent. Then click the generate button to generate a geodatabase of
* Geodatabase
* GeodatabaseSyncTask

## Additional information

This sample uses the GeoView-Compose Toolkit module to be able to implement a composable SceneView.

## Tags

disconnected, local geodatabase, offline, replica, sync
disconnected, geoview-compose, local geodatabase, offline, replica, sync, toolkit
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,31 @@
],
"keywords": [
"disconnected",
"geoview-compose",
"local geodatabase",
"offline",
"replica",
"sync",
"toolkit",
"GenerateGeodatabaseJob",
"GenerateGeodatabaseParameters",
"Geodatabase",
"GeodatabaseSyncTask"
],
"language": "kotlin",
"redirect_from": "/android/latest/sample-code/generate-geodatabase.htm",
"redirect_from": [
"/android/latest/sample-code/generate-geodatabase.htm"
],
"relevant_apis": [
"GenerateGeodatabaseJob",
"GenerateGeodatabaseParameters",
"Geodatabase",
"GeodatabaseSyncTask"
],
"snippets": [
"src/main/java/com/esri/arcgismaps/sample/generategeodatabasereplicafromfeatureservice/MainActivity.kt"
"src/main/java/com/esri/arcgismaps/sample/generategeodatabasereplicafromfeatureservice/components/GenerateGeodatabaseReplicaFromFeatureServiceViewModel.kt",
"src/main/java/com/esri/arcgismaps/sample/generategeodatabasereplicafromfeatureservice/MainActivity.kt",
"src/main/java/com/esri/arcgismaps/sample/generategeodatabasereplicafromfeatureservice/screens/GenerateGeodatabaseReplicaFromFeatureServiceScreen.kt"
],
"title": "Generate geodatabase replica from feature service"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
alias(libs.plugins.arcgismaps.android.library)
alias(libs.plugins.arcgismaps.android.library.compose)
alias(libs.plugins.arcgismaps.kotlin.sample)
alias(libs.plugins.gradle.secrets)
}
Expand All @@ -11,9 +12,7 @@ secrets {

android {
namespace = "com.esri.arcgismaps.sample.generategeodatabasereplicafromfeatureservice"
// For view based samples
buildFeatures {
dataBinding = true
buildConfig = true
}
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit d4610d2

Please sign in to comment.