Windows Phone prepopulated db



  • 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?



  • @marco.paglia by .pro file you mean the project file? would you mind sharing what you have so far?



  • 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)
    }
    
    


  • For Windows Phone, I use winphone entry, not win32 in .pro:

    winphone  {
          CONFIG += windeployqt
          WINRT_MANIFEST.version = 1.0.0.0
          .....
    }
    


  • 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?



  • 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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.