Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Cant open file from file dialog in qt android
QtWS25 Last Chance

Cant open file from file dialog in qt android

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 2 Posters 760 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    HemantSuryawanshi
    wrote on last edited by
    #1

    I am trying to open a kml file from file dialog in qt qml for android app. I am using Qt 5.14.1, SDK version 28 and ndk version 21. I get a URL from file dialog like this :

    content://com.android.externalstorage.documents/document/primary%3AKML%2Fmykml1.kml
    

    How can I convert this URL into the file path and open a file using file dialog from qt android.

    I also have issue related to folder creation. I create a folder at following location.

    QDir homePath(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation));
    

    The folder get created at given location but I am not able to see the folder. How can I see that folder?

    1 Reply Last reply
    0
    • Quang PhuQ Offline
      Quang PhuQ Offline
      Quang Phu
      wrote on last edited by Quang Phu
      #2

      @HemantSuryawanshi
      In android, you should use QStandardPaths::AppDataLocation, this is my setting, it works well on Qt5.14.1

      m_currentDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
      
      1 Reply Last reply
      0
      • H Offline
        H Offline
        HemantSuryawanshi
        wrote on last edited by HemantSuryawanshi
        #3

        I already used QStandardPaths::AppDataLocation but it gives me same result. Not able to see folder at that location. Does it require any spacial permissions? I already give READ_EXTERNAL_STORAGE & WRITE EXTERNAL_STORAGE permissions.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved