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
Forum Update on Monday, May 27th 2025

Default application on Android

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
4 Posts 2 Posters 630 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.
  • V Offline
    V Offline
    vlada
    wrote on 17 Sept 2018, 09:29 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 17 Sept 2018, 12:18
    0
    • V vlada
      17 Sept 2018, 09:29

      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 17 Sept 2018, 12:18 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 17 Sept 2018, 13:03 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 17 Sept 2018, 13:28
        0
        • V vlada
          17 Sept 2018, 13:03

          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 17 Sept 2018, 13:28 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

          1/4

          17 Sept 2018, 09:29

          • Login

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