Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved Cant open file from file dialog in qt android

    Mobile and Embedded
    2
    3
    380
    Loading More Posts
    • 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
      HemantSuryawanshi last edited by

      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 Reply Quote 0
      • Quang Phu
        Quang Phu last edited by Quang Phu

        @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 Reply Quote 0
        • H
          HemantSuryawanshi last edited by HemantSuryawanshi

          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 Reply Quote 0
          • First post
            Last post