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?
Matt English - Did my last post answer your question or are you still having this issue?
We have a sample which demonstrates that. Go to New App> Search for Open
For more advance implementation on how to include mmpk and switch between offline and online look into the Quick Report template source code (RefineLocationPage.qml)
This sample downloads the mmpk. What if we want to include the mmpk with the app so that it can work completely offline? How do we set up a qml project and a folder structure so that the mmpk gets compiled with the app?
The "Open Mobile Map" sample comes with the mmpk file (Yellowstone.mmpk) within the app. Check the data folder within the app folder. Hence the mmpk gets compiled with the app.
That sample copies the mmpk from a known location outside of the app to a created data folder no? How do I set up a qmlproject to include the mmpk in the project from the get-go? When I open that sample with AppStudio player it seems to copy the mmpk from a location within the Player app, not the sample app itself.
A more basic question would be: in QtCreator, how do I add a "data" folder to my qml project and place a mmpk in there? It's not clear how to do this.
You can do that in the file explorer of your OS such as windows. Once you do that. It should get automatically included in your QML project within Qt Creator. And you can confirm that by going to the File system from default Projects (item) of your project using the dropdown menu.
That known location is within the app not outside the app (see image below). To set up your project just drop the mmpk in the data folder of your app. And then follow the same code to copy the mmpk to the folder as used in the sample. The reason behind the copy is because when you include mmpk within your app you cannot use local relative path in your code since on devices like iOS and Android the apps have access to only virtual file system. So we will have to copy the mmpk internally once the app opens.
This is explained here
Working with Offline content · Esri/arcgis-appstudio-samples Wiki · GitHub
I hope this helps.
I know this is gonna seem dumb but how do you add a data folder in your project in QtCreator? Can't figure this out. If I add it in File Explorer it doesn't show up in the project tree. Sorry for the basic question, I'm a newbie to this.
see comment above.
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.
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"
We're good. Thanks
Retrieving data ...