File tree Expand file tree Collapse file tree 3 files changed +8
-9
lines changed
add-feature-layers/src/main/java/com/esri/arcgisruntime/sample/addfeaturelayers
display-map-from-mobile-map-package/src/main/java/com/esri/arcgisruntime/sample/displaymapfrommobilemappackage
samples-lib/src/main/java/com/esri/arcgisruntime/sample/sampleslib Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ class DownloadActivity : DownloaderActivity() {
1010 super .onCreate(savedInstanceState)
1111 downloadAndStartSample(
1212 Intent (this , MainActivity ::class .java),
13- // get the download path of the sample
14- downloadFolder( getString(R .string.app_name) ),
13+ // get the app name of the sample
14+ getString(R .string.app_name),
1515 listOf (
1616 // ArcGIS Portal item containing the .mmpk mobile map package
1717 " https://www.arcgis.com/home/item.html?id=2b0f9e17105847809dfeb04e3cad69e0" ,
Original file line number Diff line number Diff line change @@ -24,13 +24,10 @@ import java.io.File
2424class DownloadActivity : DownloaderActivity () {
2525 override fun onCreate (savedInstanceState : Bundle ? ) {
2626 super .onCreate(savedInstanceState)
27- val downloadFolder = File (
28- getExternalFilesDir(null )?.path.toString() + File .separator + getString(R .string.app_name)
29- )
3027 downloadAndStartSample(
3128 Intent (this , MainActivity ::class .java),
32- // get the download path of the sample
33- downloadFolder.path ,
29+ // get the app name of the sample
30+ getString( R .string.app_name) ,
3431 listOf (
3532 // ArcGIS Portal item containing the .mmpk mobile map package
3633 " https://www.arcgis.com/home/item.html?id=e1f3a7254cb845b09450f54937c16061"
Original file line number Diff line number Diff line change @@ -60,13 +60,15 @@ abstract class DownloaderActivity : AppCompatActivity() {
6060
6161 /* *
6262 * Gets the [provisionURL] of the portal item to download at
63- * the [samplePath ], once download completes it starts the [mainActivity]
63+ * the [sampleName ], once download completes it starts the [mainActivity]
6464 */
6565 fun downloadAndStartSample (
6666 mainActivity : Intent ,
67- samplePath : String ,
67+ sampleName : String ,
6868 provisionURLs : List <String >
6969 ) {
70+ // get the path to download files
71+ val samplePath: String = downloadFolder(sampleName)
7072 // start the download manager to automatically add the .mmpk file to the app
7173 // alternatively, you can use ADB/Device File Explorer
7274 lifecycleScope.launch {
You can’t perform that action at this time.
0 commit comments