How to include small mobile map package in AppStudio app?

2259
17
Jump to solution
07-17-2017 09:19 AM
MapEnglish
Occasional Contributor

I'm new to AppStudio and QML. How would one accomplish this inside QtCreator? We'd like to deploy an app that opens by default with an mmpk that's compiled with the app. Is there a sample that shows this?

Thanks,

Matt English

0 Kudos
17 Replies
MapEnglish
Occasional Contributor

FYI if you alter the code of your sample to look for a different mmpk then upload the app to ArcGIS online you still get the Yellowstone.mmpk whe you use the Player app. This is the part that has me confused. 

0 Kudos
nakulmanocha
Esri Regular Contributor

Did you change this line in the code after replacing the mmpk file in the data folder? For e.g. if you mmpk file name is 

USStatesMMPK.mmpk. You should change the inputdata file name. In sample it points to YellowStone.mmpk.

 property string inputdata: "USStatesMMPK.mmpk"
0 Kudos
nakulmanocha
Esri Regular Contributor

Matt English‌ - Did my last post answer your question or are you still having this issue?

0 Kudos
MapEnglish
Occasional Contributor

We're good. Thanks

0 Kudos
AdamDrackley
Occasional Contributor III

Were you able to get this working, Matt?  The data appears to 'copy' and display properly on a compiled Desktop app, but not in my compiled Android app.  I can confirm that my Test.mmpk file is within the /data directory in the file system, and I'm basically using the same code from the Open Mobile Map example verbatim.

    property string dataPath:  AppFramework.userHomeFolder.filePath("ArcGIS/AppStudio/Data")
    property string inputdata: "Test.mmpk"
    property string outputdata: dataPath + "/" + inputdata
    function copyLocalData(input, output) {
        var resourceFolder = AppFramework.fileFolder(app.folder.folder("data").path);
        AppFramework.userHomeFolder.makePath(dataPath);
        resourceFolder.copyFile(input, output);
        return output
    }
   
   ...
   path: AppFramework.resolvedPathUrl(copyLocalData(inputdata, outputdata))
0 Kudos
AdamDrackley
Occasional Contributor III

Nevermind, I got it working!  Offline Storage needs to be enabled for the app in Settings -> Capabilities prior to Uploading/Making.

0 Kudos
AdamDrackley
Occasional Contributor III

I'm just starting to wade into AppStudio, so I have a pretty basic question about this workflow.  I should probably test first to see, but since the 'Player' app on a handheld device needs to reach out to Portal/AGOL to grab the uploaded App, is this workflow actually offline?  Or can you grab the App from Portal/AGOL onto your device once when you have connectivity, and subsequently launch it in offline mode without needing a connection to Portal/AGOL?

0 Kudos
nakulmanocha
Esri Regular Contributor

Yes, once the app has been downloaded it stays on your device. And it doesn't need to be connected with the Portal/AGOL. If there is an app update to be downloaded you need to go back and log in to your account to download the update. Again once downloaded it will work the same way as it would if you were signed out of the Portal. 

-Nakul

0 Kudos