[英]Open Third Party apps from my application
I am doing some research before developing my application. 在开发应用程序之前,我正在做一些研究。 Just to give you a brief about what I intend to do is the following:
为了向您简要介绍我打算做的事情,如下:
I've already found some info how to open third party apps: ios and android. 我已经找到了一些有关如何打开第三方应用程序的信息:ios和android。 I am searching for other services (windows phone and blackberry) and could not find anything or I'm typing the wrong keywords in Google search.!!
我正在搜索其他服务(Windows Phone和Blackberry),但找不到任何东西,或者我在Google搜索中输入了错误的关键字。
For Iphone I found the following: 对于Iphone,我发现以下内容:
For Android: 对于Android:
http://developer.android.com/distribute/googleplay/promote/linking.html#OpeningPublisher http://developer.android.com/distribute/googleplay/promote/linking.html#OpeningPublisher
Both the above are linking to App store and Play Store accordingly. 以上两者均相应地链接到App Store和Play Store。 How can I link to an already installed app if the app is installed.
如果已安装应用程序,如何链接到已安装的应用程序。
Thanks 谢谢
The Android ecosystem is based on Intent and ContentProvider . Android生态系统基于Intent和ContentProvider 。 The only thing you need to know to launch activity / application is either a intent action and/or a content provider Uri .
启动活动/应用程序所需知道的唯一一件事是意图动作和/或内容提供商Uri 。
Let's take an example: you have the IMDB id of a movie and you want to open up the detail page through the IMBD Android app. 让我们举个例子:您拥有电影的IMDB ID,并且您想通过IMBD Android应用程序打开详细信息页面。 In that case you can do something like:
在这种情况下,您可以执行以下操作:
Intent detail = new Intent(Intent.ACTION_VIEW, Uri.parse("imdb://<imdb_id>"));
if (context.getPackageManager().resolveActivity(test, 0) != null) {
startActivity(this, detail);
} else {
Toast.makeText(this, "IMDB not installed", Toast.LENGTH_LONG).show();
}
because the IMDB app provides a content provider with the prefix imdb://
. 因为IMDB应用为内容提供商提供了前缀
imdb://
。
If the app provides an activity with a defined action filter, you just need to know this exact action like such: 如果应用程序为活动提供了已定义的动作过滤器,则只需知道以下确切动作即可:
startActivity(this, new Intent("target.app.action"));
Few years ago, there was a website that listed all open intents that you could use. 几年前,有一个网站列出了您可以使用的所有开放意图。 It still exists but seems abandoned => http://www.openintents.org/
它仍然存在,但似乎被放弃了=> http://www.openintents.org/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.