你必須使用自定義方案的意圖過濾器添加到manifist文件,在你的應用程序中相應的活動標記。格式爲:<scheme>://<host>:<port>/<path>
例子:
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:scheme="<PUT SCHEME HERE>" android:host="<PUT URL HERE>" android:path="<PUT PATH HERE>"/>
</intent-filter>
替換這個標籤中包含HTTP或HTTPS
URL方案替換您的網址這個標籤。 (即mycoolapps.com)
與URL即(/ sweetApp)後路徑替換此標記。
完整的例子:
讓說,如果你想打開的應用程序與以下網址:
http://mycoolapps.com/sweetApp
你的意圖過濾器看起來像下面這樣:
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:scheme="http" android:host="mycoolapps.com" android:path="/sweetApp"/>
</intent-filter>
對不起因爲我的經驗不足 - 我可以強加一點澄清嗎? (1)英特爾XDK不會創建如此名稱的清單文件;我會在哪裏插入意圖? (2)URL也會讓我失望 - 如果我的Android手機上安裝了本機應用程序,那麼我將使用什麼url方案,url和路徑?在Google Marketplace中,應用程序包名稱爲com.app.gateaccess – Arthur
對不起,我不使用intel-xdk。我給出的解決方案通常適用於android本機應用程序這些行需要添加在原生android應用程序的顯式文件中。 – Adnan