Results 1 to 4 of 4

Thread: Path for SD Card.

  1. #1
    Join Date
    Jul 2016
    Posts
    53
    Thanks
    13
    Qt products
    Qt4 Qt5
    Platforms
    Windows Android

    Default 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"

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Path for SD Card.

    A qrc URL is not some path on the SD card, it is a program internal file-like data store.

    I.e. Qt Resources builds files into the executable, they are then part of the program.
    They can be treated like read-only files from within the program but don't exist outside the program.

    Cheers,
    _

  3. #3
    Join Date
    Jul 2016
    Posts
    53
    Thanks
    13
    Qt products
    Qt4 Qt5
    Platforms
    Windows Android

    Default Re: Path for SD Card.

    Hi Anda_skoa,

    Thanks for the reply. I don't want my maps stored in Qrc.

    Scenario:
    Maps will be copied to SD Card manually, The qt application will display the map from the SD Card.
    In this case how to set the SD card Path.

    Code snippets what I tried according to ESRI ArcGIS Runtime SDK for Qt 100.0.0:
    Qt Code:
    1. import QtQuick 2.6
    2. import Esri.ArcGISRuntime 100.0
    3. import Esri.ArcGISExtras 1.1
    4.  
    5. Rectangle {
    6. width: 800
    7. height: 600
    8.  
    9. property real scaleFactor: System.displayScaleFactor
    10. // property string dataPath: System.userHomePath + "/ArcGIS/Runtime/Data/mmpk/"
    11. [B][I]property string dataPath: "file:///storage/sdcard1/"[/I][/B]
    12.  
    13. // Create MapView
    14. MapView {
    15. id: mapView
    16. anchors.fill: parent
    17. }
    18.  
    19. // Create a Mobile Map Package and set the path
    20. MobileMapPackage {
    21. id: mmpk
    22. path: dataPath + "Yellowstone.mmpk"
    23.  
    24. // load the mobile map package
    25. Component.onCompleted: {
    26. mmpk.load();
    27. }
    28.  
    29. // wait for the mobile map package to load
    30. onLoadStatusChanged: {
    31. if (loadStatus === Enums.LoadStatusLoaded) {
    32. // set the map view's map to the first map in the mobile map package
    33. mapView.map = mmpk.maps[0];
    34. }
    35. }
    36. }
    37.  
    38. Rectangle {
    39. anchors.fill: parent
    40. color: "transparent"
    41. border {
    42. width: 0.5 * scaleFactor
    43. color: "black"
    44. }
    45. }
    46. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by anda_skoa; 10th August 2016 at 11:54. Reason: missing [code] tags

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Path for SD Card.

    Quote Originally Posted by Mathan View Post
    Thanks for the reply. I don't want my maps stored in Qrc.
    ok, your initial posting had conflicting information that.

    Quote Originally Posted by Mathan View Post
    Maps will be copied to SD Card manually, The qt application will display the map from the SD Card.
    In this case how to set the SD card Path.
    If the maps are copied manually, wouldn't the path be manually chosen?
    I.e. wouldn't you need a directory selector/picker to get it from the user?

    If the path is a standard system path, have you checked if any of the locations of QStandardPath points to it?

    Cheers,
    _

Similar Threads

  1. How to set path to memory card of the mobile?
    By harish in forum Qt Programming
    Replies: 1
    Last Post: 20th February 2012, 17:15
  2. sd card
    By dmartino in forum Newbie
    Replies: 6
    Last Post: 19th January 2011, 21:34
  3. Qt and graphics card
    By leoalvesmachado in forum Newbie
    Replies: 2
    Last Post: 21st May 2010, 20:57
  4. Replies: 8
    Last Post: 17th October 2009, 08:10

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.