本篇内容介绍了“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>
“HTML5怎么打开本地app应用”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注创新互联网站,小编将为大家输出更多高质量的实用文章!
网页题目:HTML5怎么打开本地app应用
标题路径:https://www.cdcxhl.com/article10/jieodo.html
成都网站建设公司_创新互联,为您提供网站排名、建站公司、虚拟主机、企业网站制作、网站设计公司、品牌网站设计
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联