首先為App之AndroidManifest.xml加入一個App專屬的<intent-filter>,例如
<activity
android:name="MyappMain"
android:label="@string/app_name"
android:noHistory="true"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<data android:scheme="nkut.edu.sswuApp" android:host="nkut" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
</intent-filter>
</activity>
<html >
<head >
<title>launch apk from
browser</title >
<meta
http-equiv = "Content-Type" content = "text/html;
charset=utf-8" >
</head >
<body >
<p >
<a
href = "intent://nkut#Intent;scheme=nkut.edu.sswuApp;end">點我開啟APP</a></p >
</body >
</html>