简体   繁体   English

我应该使用意图还是应用程序链接来连接Android中的两个本机应用程序?

[英]Should I use intents or App Links to connect two native apps in Android?

I have a simple requirement. 我有一个简单的要求。 Native app A needs to start an Activity in native app B. Per Google Dev docs there are two ways to do it: 1. Use Implicit Intents 2. Use App Links 本地应用程序A需要在本地应用程序B中启动活动。根据Google Dev文档,有两种方法可以执行此操作:1.使用隐式意图 2.使用应用程序链接

Which is a better approach from security standpoint? 从安全角度来看,哪种方法更好?

From a security standpoint App Links would be the better approach. 从安全角度来看, App Links是更好的方法。 With app links you setup a url that links to a domain you own. 使用应用程序链接,您可以设置一个链接到您拥有的域的URL。 That url is configured in both your client app and on the server that hosts the domain. 在您的客户端应用程序和托管域的服务器上都配置了该url。 If the user doesn't have the app installed, that supports the app link, then you are directed to the website instead of the app. 如果用户未安装支持该应用程序链接的应用程序,那么您将被定向到该网站而不是该应用程序。

With Implicit Intents , any app can register that intent. 使用隐式意图 ,任何应用程序都可以注册该意图。 If more than one app has that intent registered, then an app chooser is displayed, for the user to decide which app should open that intent. 如果有多个应用程序注册了该意图,那么将显示一个应用选择器,供用户决定哪个应用程序应打开该意图。 Also, if no app is installed that is registered for that intent, then you need to check for that otherwise an exception will be thrown indicating that there is no app to handle your intent execution. 另外,如果未安装为此目的注册的应用程序,则需要检查该应用程序,否则将引发异常,表明没有应用程序可处理您的意图执行。

The downside to App Link is that it's only supported on Android 6.0 (API level 23) and higher and it requires an extra configuration on the website domain. App Link的缺点是仅在Android 6.0(API级别23)及更高版本上受支持,并且需要在网站域上进行额外的配置。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android博客应用,我应该使用Sharedpreferences还是Intents? - Android Blog App, should I use Sharedpreferences or Intents? 本机android联系人应用程序如何满足应用程序的意图,例如whatsapp - How does the native android contacts app cater for intents to apps, such as whatsapp 我应该在GA中使用两个配置文件来跟踪android和ios应用吗 - Should I use two profiles in GA for tracking android and ios apps Android Instant Apps和App LInks的使用 - Android Instant Apps and use of App LInks 我应该使用意图还是听众? - Should I use intents or listeners? 我应该使用PHP将我的Android应用程序连接到mySQL数据库吗 - should I use PHP to connect my android app to mySQL db 我应该在我的Android原生应用程序中使用CordovaWebView或AndroidWebView吗? - Should I Use CordovaWebView or AndroidWebView in my android native App? 如何结合使用Android的“ openvpn connect”应用程序以编程方式连接和断开VPN连接? - How can I programmatically connect and disconnect vpn connections by using android's “openvpn connect” app in combination with intents? 为什么JSON格式对Android应用很重要? 谁指定我应该在我的应用中使用它? - Why JSON format is important for android apps? and Who specifies that I should use it or no in my app? 我应该使用什么UUID(bluetooth LE)在我的android应用程序和lightblue应用程序之间进行连接? - What UUID(bluetooth LE) should I use to connect between my android app and lightblue app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM