Windows Phone prepopulated db
-
wrote on 25 Aug 2015, 10:36 last edited by
I am developing a cross platform (Android, IOS, WP) application that needs to have a prepopulated sqlite database.
I edited the .pro file to embed the database into the App.
It worked for iOS and Android but I could not find a solution for windows.
Can someone help me? -
wrote on 25 Aug 2015, 13:48 last edited by
@marco.paglia by .pro file you mean the project file? would you mind sharing what you have so far?
-
wrote on 25 Aug 2015, 14:04 last edited by
Yes, I mean the project file
Here the code
mac { cache() } #------------------------------------------------------------------------------- CONFIG += c++11 arcgis_runtime_qml10_2_6 QT += core concurrent sql network gui opengl xml script positioning sensors svg QT += qml quick android:QT += sql win:QT += sql mac:QT += sql ios:QTPLUGIN += qsqlite TEMPLATE = app TARGET = my-app-qt #------------------------------------------------------------------------------- HEADERS += \ AppInfo.h \ update.h SOURCES += \ main.cpp \ update.cpp RESOURCES += \ qml/qml.qrc \ Resources/Resources.qrc OTHER_FILES += \ wizard.xml \ wizard.png #------------------------------------------------------------------------------- win32 { include (Win/Win.pri) } macx { include (Mac/Mac.pri) MediaFiles.files = Android/assets MediaFiles.path = Contents/MacOS QMAKE_BUNDLE_DATA += MediaFiles } ios { include (iOS/iOS.pri) MediaFiles.files = Android/assets/mydb.sqlite MediaFiles.path = ./ QMAKE_BUNDLE_DATA += MediaFiles } android { include (Android/Android.pri) }
-
wrote on 25 Aug 2015, 17:39 last edited by
For Windows Phone, I use winphone entry, not win32 in .pro:
winphone { CONFIG += windeployqt WINRT_MANIFEST.version = 1.0.0.0 ..... }
-
wrote on 25 Aug 2015, 18:44 last edited by marco.paglia
Thanks TioRoy.
The problem is with the copy of a file (sqlite in this case) in the App package as for apk, ipa (Android and IOS).Simply I would like to know what are the variables to be used within the project file.
Should I manage these files with Visual Studio? -
wrote on 26 Aug 2015, 05:35 last edited by marco.paglia
I opened the project in Visual Studio.
Now I have my files in the "Distribution Files".I think I should be able to access it with the QStandardPaths class.
If I'm right I do not know which variable corresponds to that folder
2/6