android原生app转成web,Android 从 Web 唤起 APP

编程入门 行业动态 更新时间:2024-10-10 07:22:44

android原生app<a href=https://www.elefans.com/category/jswz/34/1767796.html style=转成web,Android 从 Web 唤起 APP"/>

android原生app转成web,Android 从 Web 唤起 APP

前言

image

知乎在手机浏览器打开,会有个 App 内打开的按钮,点击直接打开且跳转到该详情页,是不是有点神奇,是如何做到的呢?

效果预览

[图片上传失败...(image-d606d-1523111217485)]

Uri Scheme

配置 intent-filter

AndroidManifest.xml

android:host="myhost"

android:path="/main"

android:port="1024"

android:scheme="myscheme" />

测试网页

main 下新建 assets 文件,写了简单的 Html 网页用于 WebView 展示,来进行测试。

index.html:

这是一个 WebView

open app with market

open app with Uri Scheme

Web View 加载:

webView.loadUrl("file:///android_asset/index.html");

目标页面

接受参数,做相应的处理。

Intent intent = getIntent();

if (null != intent

更多推荐

android原生app转成web,Android 从 Web 唤起 APP

本文发布于:2024-03-12 21:54:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1732495.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:转成   app   android   web   APP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!