还剑奇情录txt下载,王丽娟护士长,旱冰鞋教程视频
本文为大家分享了html5打开本地app应用的方法,具体内容如下
首先为了保证能够打开你的app,你必须要在androidmanifest.xml中配置的filter中data的属性表述。<data android:pathprefix="/taoge/open" android:scheme="xttblog"></data> androidmanifest.xml代码如下:
xml/html code复制内容到剪贴板
- <?xml version="1.0" encoding="utf-8"?>
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.taoge"
- android:versioncode="2"
- android:versionname="3.24.03" >
- <uses-sdk
- android:minsdkversion="8"
- android:targetsdkversion="17" />
- <application
- android:allowbackup="true"
- android:configchanges="orientation|screensize"
- android:icon="@drawable/logo"
- android:label="@string/app_name"
- android:logo="@drawable/logo"
- android:shareduserid="android.uid.system"
- android:theme="@android:style/theme.light.notitlebar" >
- <activity
- android:name="xttblog.welcomeactivity"
- android:excludefromrecents="true"
- android:screenorientation="portrait"
- android:theme="@android:style/theme.light.notitlebar" >
- <intent-filter>
- <action android:name="android.intent.action.main" />
- <category android:name="android.intent.category.launcher" />
- </intent-filter>
- <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:pathprefix="/taoge/open"
- android:scheme="xttblog" />
- </intent-filter>
- </activity>
- <activity
- android:name="xttblog.antrepairactivity"
- android:label="@string/title_activity_ant_repair" >
- </activity>
- </application>
- </manifest>
其次,你要在你的网页中访问xttblog://taoge/open。可以使用的元素有很多,如:script,iframe,img等。使用它们的src属性,访问xttblog://taoge/open。html5代码如下:
xml/html code复制内容到剪贴板
- <!doctype html>
- <html>
- <script>
- function openapp(){
- document.getelementbyid('xttblog').innerhtml='<iframe src="xttblog://taoge/open"></iframe>';
- }
- </script>
- <body>
- <div style="display:none;" id="xttblog"></div>
- <input type="button" value="打开app" onclick="openapp();">
- </body>
- </html>
以上就是本文的全部内容,希望对大家的学习有所帮助。
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!!
点击进行留言回复
相关文章:
-
-
-
-
-
-
-
HTML入门
HTML概述 HTML: Hyper Text Markup Language 超文本标记语言 超文本: 比普通文本功能更加强大,可以添加各种样式 标记...
[阅读全文]
-
使用HTML设计商城首页
网站首页 需求分析 根据产品文档,完成商城首页,显示效果如图 技术分析 表格标签table table标签 常用的属性: bgcolor : 背景色 w...
[阅读全文]
-
使用HTML设计注册界面
网站注册页面案例 需求分析 编写一个HTML页面, 显示效果如图所示 技术分析 表单标签 action : 直接提交的地址 method : get 方...
[阅读全文]
-
-
网友评论