I Wanna open My android app by links like WhatsApp and Telegram.
(example) https://chat.whatsapp.com
if I Click this link and WhatsApp is installed this link will open WhatsApp So how can I do that in my app?
I Wanna open My android app by links like WhatsApp and Telegram.
(example) https://chat.whatsapp.com
if I Click this link and WhatsApp is installed this link will open WhatsApp So how can I do that in my app?
2
Answers
First thing you should define your base URL inside strings file like this :
after that you should define an IntentFilter inside Manifest file like this :
So your link should be like this :
when you click on this link it should open your app in the activity that you put this intent filter inside it.
If you want to deep link your app. For example: You open a link and it should be open through your app. In this case I use a website opened with a
webView
in your app. You can customize that of course.Start to create an
<intent-filter>
in yourAndroidManifest.xml
:And in your
MainActivity.java
you write the following code to get the data to be set in thewebView
:And your
webView
defined in youractivity_main.xml
:That’s it. Good luck! Cheers 🙂