-
Suggestion
-
Resolution: Done
-
P2: Important
-
5.1.0
-
None
-
Android, Qt5.1
-
-
1f695a31e2e3df1782e2ee5565ff9e7bfd8dd9ae
There is currently no way to pass arguments to the main() C++ function. It used to be possible in Necessitas based on Qt 4.8.
Assuming that it's not a good practise to change the code of QtActivity, it would be good if a subclass of QtActivity could set arguments and QtActivity forward them to the C++ side when starting the app.
QtActivity has a static final constant APPLICATION_PARAMETERS that is not usable either.
Example use case: the app gets a filename via an Activity Intent and need to send it to the main() C++ function.
Suggestion: Remove APPLICATION_PARAMETERS. Create an instance variable in QtActivity (applicationParameters with setter and getter) and use this variable in startApp() and onServiceConnected() to pass the arguments via the bundle parameters with key APPLICATION_PARAMETERS_KEY.