如何从 flex mobile 中的另一个应用程序调用一个应用程序 [英] How to invoke an app from another app in flex mobile

查看:33
本文介绍了如何从 flex mobile 中的另一个应用程序调用一个应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在 Air 中从另一个应用程序打开一个应用程序?示例:我打开应用程序 A,其中包含一个在单击时打开应用程序 B 的按钮.假设 A 和 B 都是安装在设备中的独立应用,并且该设备可以是 PlayBook、Ipad 或 Android 平板电脑.

Is there a way to open one app from another app in Air? Example: I open app A which contains a button that opens app B when clicked. Suppose both A and B are separated apps that are installed in the device and that this device could be a PlayBook, an Ipad or an Android tablet.

谢谢.

推荐答案

您必须走 Air Native Extension(ANE) 路线.要么分别为 iOS 和 Android 创建一个 ANE 解决方案,要么创建一个将功能抽象为一个解决方案的 ANE.如何在 Android 上从应用程序 B 启动应用程序 A 与在 iOS 上不同.请参阅 SO 中的 this 答案.

You'd have to go the Air Native Extension(ANE) route. Either create one ANE solution for iOS and Android each, or one ANE that abtracts the functionality into one solution. How to launch app A from app B on Android is not the same as on iOS. See this answer in SO.

要在 Android 上实现它,您需要将原生 Android Java 解决方案封装在 ANE 中.原生 Java 代码使用应用 B 的包名从应用 A 启动应用 B:

To implement it on Android, you'd wraps the native Android Java solution in a ANE. The native Java code uses the package name of app B to launch app B from app A:

Intent intent = getPackageManager().getLaunchIntentForPackage("com.yourdoman.yourapp");
startActivity(intent);

这是一个视频教程,内容涉及如何通过您使用的 ANE 启动活动可以继续创建您的 ANE.您必须定制解决方案以按域而不是按活动启动.

Here is a video tutorial on how to launch an Activity through an ANE which you can build on to create your ANE. You'd have to tailor the solution to launch by domain instead of Activity.

这篇关于如何从 flex mobile 中的另一个应用程序调用一个应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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