Because hackbod never gave us code-examples, I just want to share mine, after I got this to work.
First of all, you need to define a custom action in your manifest file:
<activity
android:name=".activity.MainActivity"
android:label="@string/app_name_full">
<intent-filter>
<action android:name="com.yourpackage.action.OPEN_VIEW"></action>
<category android:name="android.intent.category.DEFAULT"></category>
<category android:name="android.intent.category.BROWSABLE"></category>
</intent-filter>
</activity>
Then, for the content on your website, you need to generate the URI from an intent.
Put following code in your Activity (This code could be removed, once the link is generated):
Intent i = new Intent();
i.setAction("com.yourpackage.action.OPEN_VIEW");
i.setPackage("com.yourpackage");
i.putExtra("myextra","anystring");
Log.d(getClass().getSimpleName(), i.toUri(Intent.URI_INTENT_SCHEME));
To receive the Extras, put following in your activity, that is able to recieve the custom action (as defined in manifest):
final Intent intent = getIntent();
final String action = intent.getAction();
if ("com.yourpackage.action.OPEN_VIEW".equals(action)) {
Log.i(getClass().getSimpleName(), "EXTRA: "+intent.getExtras().getString("myextra"));
}
On your website (this is the previously generated link):
<a href="intent:#Intent;action=com.yourpackage.action.OPEN_VIEW;package=com.yourpackage;S.myextra=anystring;end">Open App with extra</a>
Hope that helps someone for better understanding. Please correct me, if I got something wrong.