建设网站的工作,中国水利教育培训网站,关于校园网站升级建设的报告,中国风网站欣赏添加 Android App Links功能 介绍一个简单的效果Android配置Add Url intent filtersAdd logic to handle the intentAssociate website 搭建网页支持AppLinks 介绍 Android App Links 是指将用户直接转到 Android 应用内特定内容的 HTTP 网址。Android App Links 可为您的应用带… 添加 Android App Links功能 介绍一个简单的效果Android配置Add Url intent filtersAdd logic to handle the intentAssociate website 搭建网页支持AppLinks 介绍 Android App Links 是指将用户直接转到 Android 应用内特定内容的 HTTP 网址。Android App Links 可为您的应用带来更多流量帮助您发现最常用的应用内容并让用户更轻松地在已安装的应用中查找和分享内容。
一个简单的效果
//TODO 添加视频 我们在网页上输入http://tobey-r1.github.io/tobey?23 然后效果如下
Android配置 在Android studio编译器里面顶部的Tools里面的App Links Assistant里面就是给你的app添加link配置的步骤包括最后的url测试。麻烦点在于如果自己只是研究且测试需要一个网页去支持和app的绑定这就是下一个流程要说的。Android上面的配置就比较简单了大概是这样的 按照前面三个步骤来。
Add Url intent filters 这里pathPattern就是host之后的匹配内容了对应上才能link到app上面去。
Add logic to handle the intent 就是接受外部网页传递的参数intentdata之类的点击insert code会自动插入到页面上去
// ATTENTION: This was auto-generated to handle app links.val appLinkIntent: Intent intentval appLinkAction: String? appLinkIntent.actionval appLinkData: Uri? appLinkIntent.data//简单打印下数据$appLinkData.printLog()action$appLinkAction.printLog()Associate website 这步是关键 生成的json文件保存到本地之后我们后面要把它放到网页的对应.well-known目录下访问效果如下 然后我们点击Link and Verify报错也没关系因为目前网页上我们还没加上这个json文件呢。
搭建网页支持AppLinks 需要你有一个GitHub账户即可我们通过github提供的GitHub Pages功能自己建一个简单的静态链接以下是我最终搞好的一个可以测试的github项目。静态网址是https://tobey-r1.github.io/ 效果如下网上随便找的一个模板
对应的Digital Asset Links网址https://tobey-r1.github.io/.well-known/assetlinks.json运行效果如下 然后applink的测试只需要在浏览器里面输入http://tobey-r1.github.io/tobeyxxx如下 打开我创建的github仓库之后大致如下 开启pages步骤如下 最终出现这个visit site说明成功