哈瑞养生
您的当前位置:首页HTML5打开本地app应用的方法_html5教程技巧

HTML5打开本地app应用的方法_html5教程技巧

来源:哈瑞养生


本文为大家分享了HTML5打开本地app应用的方法,具体内容如下

首先为了保证能够打开你的app,你必须要在androidManifest.xml中配置的filter中data的属性表述。 androidManifest.xml代码如下:

XML/HTML Code复制内容到剪贴板

  1. package="com.taoge"
  2. android:versionCode="2"
  3. android:versionName="3.24.03" >
  4. android:minSdkVersion="8"
  5. android:targetSdkVersion="17" />
  6. android:allowBackup="true"
  7. android:configChanges="orientation|screenSize"
  8. android:icon="@drawable/logo"
  9. android:label="@string/app_name"
  10. android:logo="@drawable/logo"
  11. android:sharedUserId="android.uid.system"
  12. android:theme="@android:style/Theme.Light.NoTitleBar" >
  13. android:name="xttblog.WelcomeActivity"
  14. android:excludeFromRecents="true"
  15. android:screenOrientation="portrait"
  16. android:theme="@android:style/Theme.Light.NoTitleBar" >
  17. android:scheme="xttblog" />
  18. android:name="xttblog.AntRepairActivity"
  19. android:label="@string/title_activity_ant_repair" >

其次,你要在你的网页中访问xttblog://taoge/open。可以使用的元素有很多,如:script,iframe,img等。使用它们的src属性,访问xttblog://taoge/open。html5代码如下:

XML/HTML Code复制内容到剪贴板

显示全文