Farid
Farid

Reputation: 168

How can I open android contact app from web page?

I have an <a> tag in my HTML code. How can I open android contact app by clicking the <a>?

<a href="#">button</a>

Upvotes: 0

Views: 1354

Answers (1)

chakibbaiker
chakibbaiker

Reputation: 123

Apps handle links through intents:

<intent-filter>
<data android:scheme="contactapp" android:host="contactapp.com"/>
<action android:name="android.intent.action.VIEW" />
</intent-filter>

So when the user clicks on contactapp://contactapp.com he is transferred to the app that has the intent filter above.

I assume you're not the creator of the contact app. So modifying the AndroidManifest.xml file isn't an option. The next best thing you can do is put an empty phone number in the link. But that only opens the dialer app and not the contacts app.

<a href="tel://">Click me</a>

Upvotes: 1

Related Questions