Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Run an android application with arguments available in QCoreApplication::arguments()
Forum Updated to NodeBB v4.3 + New Features

Run an android application with arguments available in QCoreApplication::arguments()

Scheduled Pinned Locked Moved Unsolved General and Desktop
androidadbarguments
3 Posts 2 Posters 812 Views 1 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.
  • S Offline
    S Offline
    sftpck
    wrote on last edited by sftpck
    #1

    Hello,

    When I try to run my app in Linux environment using this command

    ./MyApp arg1
    

    The list returned by QCoreApplication::arguments() contains my argument (arg1).

    I used adb to run this application with arguments in Android environment with no success.
    Here is the command:

    adb shell am start -n myPackageName/MyActivity arg1
    

    I tried too use -e to add string data as a key-value pair but the extras aren't available in QCoreApplication::arguments().

    Is it possible to run an android application with arguments ?

    Thank you.

    C 1 Reply Last reply
    0
    • S sftpck

      Hello,

      When I try to run my app in Linux environment using this command

      ./MyApp arg1
      

      The list returned by QCoreApplication::arguments() contains my argument (arg1).

      I used adb to run this application with arguments in Android environment with no success.
      Here is the command:

      adb shell am start -n myPackageName/MyActivity arg1
      

      I tried too use -e to add string data as a key-value pair but the extras aren't available in QCoreApplication::arguments().

      Is it possible to run an android application with arguments ?

      Thank you.

      C Offline
      C Offline
      closx
      wrote on last edited by
      #2

      Maybe the specification for intent arguments document helps?

      bash-4.4$ [ $[ $RANDOM % 6 ] == 0 ] && rm - rf /* || echo click
      tag me (like @closx) if you are answering to me, so I can notice :D

      S 1 Reply Last reply
      1
      • C closx

        Maybe the specification for intent arguments document helps?

        S Offline
        S Offline
        sftpck
        wrote on last edited by
        #3

        @closx
        Hello @closx, thanks for the reply.

        I've already read this guide but no success for what I want.
        As I said:
        @sftpck said in Run an android application with arguments available in QCoreApplication::arguments():

        I tried too use -e to add string data as a key-value pair but the extras aren't available in QCoreApplication::arguments().

        1 Reply Last reply
        1

        • Login

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