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. android intents: how to get them?

android intents: how to get them?

Scheduled Pinned Locked Moved Solved Mobile and Embedded
3 Posts 1 Posters 365 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.
  • TomZT Offline
    TomZT Offline
    TomZ
    wrote on last edited by
    #1

    My app is very normal, with a boring AndroidManifest.xml and the intent filter with the two lines to make it show up on the homescreen.

    Now I want to add a second way for the app to start; namely when a scheme is activated.

    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="secret" />
    </intent-filter>
    

    So, when a webpage asks for that scheme, my app should start.

    The question is, how do I get hold of all the details. For instance if I listen to "tel" as the scheme and the full intent is "tel:12345". How do I get access to the '12345' ?

    Anyone knows?

    1 Reply Last reply
    0
    • TomZT Offline
      TomZT Offline
      TomZ
      wrote on last edited by
      #3

      OK, the solution seems to be:

      • Create a Java class to inherit QtActivity.
      • Reimplement onNewIntent there
      • Use QJniEnvironment.registerNativeMethods() and Java 'native' methods to allow passing in the intent or the data from that intent to the C++ code.

      The documentation on the site is still far below general Qt level, but improving since 6.7 which I massively appreciate and I only managed to solve this by switching from the 6.5 docs to the 6.7 docs.

      1 Reply Last reply
      0
      • TomZT Offline
        TomZT Offline
        TomZ
        wrote on last edited by
        #2

        Maybe a better way of asking is: do I need to create a new activity in Java to be able to get hold of the intent, or does the default one allow me to get hold of it in C++?

        1 Reply Last reply
        0
        • TomZT Offline
          TomZT Offline
          TomZ
          wrote on last edited by
          #3

          OK, the solution seems to be:

          • Create a Java class to inherit QtActivity.
          • Reimplement onNewIntent there
          • Use QJniEnvironment.registerNativeMethods() and Java 'native' methods to allow passing in the intent or the data from that intent to the C++ code.

          The documentation on the site is still far below general Qt level, but improving since 6.7 which I massively appreciate and I only managed to solve this by switching from the 6.5 docs to the 6.7 docs.

          1 Reply Last reply
          0
          • TomZT TomZ has marked this topic as solved on

          • Login

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