Path for SD Card.



  • Hi All,

    I am developing an app, which i have to access the .mmpk [map package file]. MMPK file will be copied in the SD card root.

    Query 1:
    What will be the path to set it in the QML Code?

    Query 2:
    If the .mmpk file is added in the /Resources [Resources/Resources.qrc/resources [where the AppIcon is present]], So the .mmpk will be bundles and go along with the .apk file.
    Is it the right way? if it so, How to set the path?

    Tried:

    property real scaleFactor: System.displayScaleFactor
    //Input Path
    //property string strMmpkdataPath: System.userHomePath + "/ArcGIS/Runtime/Data/mmpk/" //System path

    //property string strMmpkdataPath: ":/Resources/CARCommune.mmpk" //Mobile SD Card Path

    //property string strMmpkdataPath: "../Resources/CARCommune.mmpk" //Mobile SD Card Path

    property string strMmpkdataPath: "qrc:/Resources/CARCommune.mmpk" ////Mobile SD Card URL

    //System.userHomePath = C:\Users\mmanohar

    //OutPut Path
    property string runtimePath: System.userHomeFolder.filePath("/ArcGIS/Runtime") //mobilePath

    property string dataPath: runtimePath + "/Data"

    property string InputMMPK: "CARCommune.mmpk"

    Thanks in advance


  • Moderators

    @Mathan-M Query 1: it depends on OS and what other devices are attached. On Windows a SDCard usually gets a drive letter assigned to it, but you never know which one. So, you cannot know in advance. Either user has to select the drive or you detect changes.



  • Hi @jsulm
    I am using android device.

    Sorry not to mention in previous post.

    Mathan


  • Moderators

    @Mathan-M Are you sure your app will have the access rights to write to the root of the SDCard? On mobile systems an app usually can only write to dedicated locations. I have an Android device but without SDCard, so I cannot check where SDCards are mounted on Android.



  • Hi @jsulm ,

    I have the permission to write on the SD Card. I suspect the path syntax.I copied the .mmpk file in the SD card\root
    as a input of .mmpk file in the app, I tried bellow path syntax.

    //Input Path
    //property string strMmpkdataPath: ":/Resources/CARCommune.mmpk" //Mobile SD Card Path

    //property string strMmpkdataPath: "../Resources/CARCommune.mmpk" //Mobile SD Card Path

    property string strMmpkdataPath: "qrc:/Resources/CARCommune.mmpk" ////Mobile SD Card URL



  • Can you do

    property string strMmpkdataPath: "/sdcard/pathToMmpk/CARCommune.mmpk"
    

Log in to reply
 

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