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. Default application on Android
Qt 6.11 is out! See what's new in the release blog

Default application on Android

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
4 Posts 2 Posters 816 Views 2 Watching
  • 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.
  • V Offline
    V Offline
    vlada
    wrote on last edited by
    #1

    Hi,

    I modified my AndroidManifest.xml so that I can choose my application to open files on Android. My application starts but I don't know how I can get path to the file I should open. On Windows or Linux I use QCoreApplication::arguments() to get command line arguments. But on Android I only get from this function the path to my application (more exactly the .so library).

    What should be the correct solution to get the file path on Android? Thank you.

    K 1 Reply Last reply
    0
    • V vlada

      Hi,

      I modified my AndroidManifest.xml so that I can choose my application to open files on Android. My application starts but I don't know how I can get path to the file I should open. On Windows or Linux I use QCoreApplication::arguments() to get command line arguments. But on Android I only get from this function the path to my application (more exactly the .so library).

      What should be the correct solution to get the file path on Android? Thank you.

      K Offline
      K Offline
      koahnig
      wrote on last edited by koahnig
      #2

      @vlada

      Can you set command line parameters on Android?

      Where is the file you like open located?

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • V Offline
        V Offline
        vlada
        wrote on last edited by
        #3

        It is not really important where the file is located. Of course it should be a readable location.

        I'm afraid Android doesn't support command line parameters. A searched for Android solutions and it seems it uses an Intent to let your application now that it should open a file. But I don't know how should I transfer this information from the main activity to my C++ part.

        K 1 Reply Last reply
        0
        • V vlada

          It is not really important where the file is located. Of course it should be a readable location.

          I'm afraid Android doesn't support command line parameters. A searched for Android solutions and it seems it uses an Intent to let your application now that it should open a file. But I don't know how should I transfer this information from the main activity to my C++ part.

          K Offline
          K Offline
          koahnig
          wrote on last edited by
          #4

          @vlada said in Default application on Android:

          I'm afraid Android doesn't support command line parameters. A searched for Android solutions and it seems it uses an Intent to let your application now that it should open a file. But I don't know how should I transfer this information from the main activity to my C++ part.

          That reflects my impression.

          Did you try to open a file somewhere?
          Possible location may be found with an external file explorer/manager for example such as total commander

          Also it might be good to check on google's Qt android forum

          Vote the answer(s) that helped you to solve your issue(s)

          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