通过链接方式打开Android应用 [英] Opening Android app by way of link

查看:216
本文介绍了通过链接方式打开Android应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个可以通过由此拉开在Android设备上我的应用程序时,电子邮件发送的链接。如果应用程序是不是在设备上,它会去谷歌存储和搜索应用程序

I'm trying to create a link that can be sent via email which when opened my app on an android device. And if the app isn't on the device, it will go to the Google store and search for the app

推荐答案

您可以这样做:

在你的清单创建一个过滤器处理某些URL,例如:

Create a filter in your Manifest to handle certain URLS, for example:

<intent-filter>
  <action android:name="android.intent.action.VIEW"/>
  <category android:name="android.intent.category.DEFAULT"/>
  <category android:name="android.intent.category.BROWSABLE"/>
  <data android:scheme="http" android:host="your-domain.com" android:path="/your-app"/>
</intent-filter>

所以,如果用户已经安装了您的应用程序,并打开 http://your-domain.com/your-app ,您的应用程序将被打开,并能够处理它。

So if user has your app installed and opens http://your-domain.com/your-app, your app will be opened and be able to handle it.

然后,让 http://your-domain.com/your-app <​​/A>重定向到谷歌播放(https://play.google.com/store/apps/details?id=com.your.app)如果直接打开无需您的应用程序。

Then, make http://your-domain.com/your-app redirect to Google Play (https://play.google.com/store/apps/details?id=com.your.app) if opened directly without your app.

这篇关于通过链接方式打开Android应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆