佳木斯湛栽影视文化发展公司

主頁 > 知識庫 > HTML5打開本地app應(yīng)用的方法

HTML5打開本地app應(yīng)用的方法

熱門標簽:網(wǎng)站文章發(fā)布 太平洋壽險電話營銷 網(wǎng)站排名優(yōu)化 企業(yè)做大做強 國美全國運營中心 團購網(wǎng)站 百度競價排名 科大訊飛語音識別系統(tǒng)

本文為大家分享了HTML5打開本地app應(yīng)用的方法,具體內(nèi)容如下

首先為了保證能夠打開你的app,你必須要在androidManifest.xml中配置的filter中data的屬性表述。<data android:pathprefix="/taoge/open" android:scheme="xttblog"></data> androidManifest.xml代碼如下:

XML/HTML Code復(fù)制內(nèi)容到剪貼板
  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <manifest xmlns:android="http://schemas.android.com/apk/res/android"  
  3.     package="com.taoge"  
  4.     android:versionCode="2"  
  5.     android:versionName="3.24.03" >  
  6.     <uses-sdk  
  7.         android:minSdkVersion="8"  
  8.         android:targetSdkVersion="17" />  
  9.     <application  
  10.         android:allowBackup="true"  
  11.         android:configChanges="orientation|screenSize"  
  12.         android:icon="@drawable/logo"  
  13.         android:label="@string/app_name"  
  14.         android:logo="@drawable/logo"  
  15.         android:sharedUserId="android.uid.system"  
  16.         android:theme="@android:style/Theme.Light.NoTitleBar" >  
  17.         <activity  
  18.             android:name="xttblog.WelcomeActivity"  
  19.             android:excludeFromRecents="true"  
  20.             android:screenOrientation="portrait"  
  21.             android:theme="@android:style/Theme.Light.NoTitleBar" >  
  22.             <intent-filter>  
  23.                 <action android:name="android.intent.action.MAIN" />  
  24.                 <category android:name="android.intent.category.LAUNCHER" />  
  25.             </intent-filter>  
  26.             <intent-filter>  
  27.                 <action android:name="android.intent.action.VIEW" />  
  28.                 <category android:name="android.intent.category.BROWSABLE" />  
  29.                 <category android:name="android.intent.category.DEFAULT" />  
  30.                 <data android:pathPrefix="/taoge/open"  
  31.                     android:scheme="xttblog" />  
  32.             </intent-filter>  
  33.         </activity>  
  34.         <activity  
  35.             android:name="xttblog.AntRepairActivity"  
  36.             android:label="@string/title_activity_ant_repair" >  
  37.         </activity>  
  38.     </application>  
  39. </manifest>  

其次,你要在你的網(wǎng)頁中訪問xttblog://taoge/open??梢允褂玫脑赜泻芏啵纾簊cript,iframe,img等。使用它們的src屬性,訪問xttblog://taoge/open。html5代碼如下:

XML/HTML Code復(fù)制內(nèi)容到剪貼板
  1. <!DOCTYPE HTML>  
  2. <html>  
  3. <script>  
  4.  function openapp(){   
  5.   document.getElementById('xttblog').innerHTML='<iframe src="xttblog://taoge/open"></iframe>';   
  6.  }   
  7. </script>  
  8. <body>  
  9.  <div style="display:none;" id="xttblog"></div>  
  10.  <input type="button" value="打開app" onclick="openapp();">  
  11. </body>  
  12. </html>  

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助。

標簽:延邊 泰州 林芝 大同 萍鄉(xiāng) 保定 赤峰

巨人網(wǎng)絡(luò)通訊聲明:本文標題《HTML5打開本地app應(yīng)用的方法》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266
    克什克腾旗| 吉首市| 鄂托克前旗| 梓潼县| 渭南市| 龙岩市| 班玛县| 祁东县| 微山县| 察哈| 大丰市| 丹东市| 富顺县| 乌审旗| 淮南市| 平利县| 广德县| 许昌县| 石棉县| 迭部县| 海宁市| 仙桃市| 楚雄市| 通州区| 简阳市| 广东省| 莆田市| 莒南县| 陇川县| 滁州市| 永嘉县| 伊宁县| 济南市| 恩平市| 盘锦市| 安福县| 大新县| 吴忠市| 澎湖县| 崇文区| 信宜市|