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?
Solved! Go to Solution.
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.
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
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.