androidextrasbrowsable

Is it possible to add extras to browsable intents from HTML


Let's take per say the following manifest:

<intent-filter>
    <data scheme="myscheme"
          host="myhost">
    </data>
    <action name="android.intent.action.VIEW">
    </action>
    <category name="android.intent.category.DEFAULT">
    </category>
    <category name="android.intent.category.BROWSABLE">
    </category>
</intent-filter>

I could launch the activity which under the above intent filter is declared by redirecting the browser to:

myscheme://myhost?param1=param1&param2=param2

However, I'm struggling with understanding if it is possible to do the same redirection, only with additional extras that would be received programmatically with:

myextra = getIntent().getStringExtra('myextra')

Any help would be very much appreciated.


Solution

  • One could use "intent scheme URL" in order to send more information like extra objects and actions when redirecting to a custom intent scheme URL via javascript or HTML.

    intent://foobar/#Intent;action=myaction1;type=text/plain;S.xyz=123;end
    

    Although this method doesn't actually answer the question as the scheme part is destined to always be "intent", this is a possible way to send intents from browsers with extra object or actions.

    See more extensive information in the following report:

    http://www.mbsd.jp/Whitepaper/IntentScheme.pdf

    Or use the chrome documentation:

    https://developer.chrome.com/multidevice/android/intents