I will like to open an app if the url
for example if the person opens : http://www.example.com/id=100,
i would like to parse example.com
and show options to open it with my app.
The same functionality is used by youtube, if you click on youtube link it will either ask if you would like to open it using youtube or directly play youtube video
Once you build a link with same signature as mentioned in manifest The android system will add your app in chooser to open link in your app and you will get the data in "getIntent(). getData()" in respective Activity. If app is not installed the link will itself open in browser. Then handle it on browser .
You have to designate custom protocol name unused by any other app like for example "myapp". Then bind your application to this protocol. Then url like myapp://myname.com/users/edit/5 will open your application (and pass the URL to the application for further processing).
You can add a data specification
to your intent filter with the http schema and the domain you want to open with your app.
<intent-filter ... >
<data android:scheme="http" android:host="example.com" />
...
</intent-filter>
Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage("com.package.address");
startActivity(LaunchIntent);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With