Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Default application on Android



  • 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.



  • @vlada

    Can you set command line parameters on Android?

    Where is the file you like open located?



  • 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.



  • @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


Log in to reply