从另一个应用程序控制一个应用程序 [英] Control an application from another application

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

问题描述

我阅读了此问题

I read this question and another question and I understand how to launch an application from another application (Let's call the other application LauncherApplication). However, my goal is not only to launch an application, but to use its functions, so I suppose the LauncherApplication should start an activity using an intent (explicit or implicit).

我应该知道数据和已安装的应用程序会做出的反应,我应该在启动它之前将这些信息添加到一个intent实例中.我希望 LauncherApplication 允许用户(而非开发人员)配置此意图,但是我如何预先知道要为已安装的应用程序放入意图的参数?

I should know the data and the actions the installed applications react on and I should add these information to an intent instance before starting it. I wish LauncherApplication allows the user (not the developer) to configure this intent, but how do I know in advance the parameters to put in an intent for the installed applications?

我应该实现"LauncherApplication *",以便允许用户通过图形界面构造意图.或者我可以使我的应用程序支持插件的添加:这样,我可以为每个已安装的应用程序创建一个插件,每个插件都可以负责管理与之关联的应用程序的意图配置.

I should implement the "LauncherApplication* in order to allow the user to construct an intent via a graphical interface. Or I could make my application supports the addition of plugins: in this way, I could create a plugin for each installed application, where each plugin could be responsible to manage the configuration of the intent concerning the application associated with it.

更新(添加的详细信息).尤其是, LauncherApplication 应该是启用了语音识别器的服务,因此用户可以启动应用程序说出特定的关键字:as以及启动应用程序,用户应该能够关闭它并使用其功能.

UPDATE (added details). In particular, the LauncherApplication should be a service with a speech recognizer enabled, so the user may start an application uttering specific keywords: as well as launch an application, the user should be able to close it and use its functions.

例如,我可以安装一个应用程序((我们称它为 LibraryApp )来搜索图书馆中的可用图书;该应用程序可以具有以下功能:

For example, I could have installed an application ((Let's call it LibraryApp) to search for available books in a library; this application could have the following functions:

  1. 搜索书籍(如果该书籍可用,已经借出或被其他人预订,则可能会返回此功能).
  2. 预订书籍(此功能应返回预订完成).

以这种方式,例如,当我发音"start LibraryApp"时, LauncherApplication 服务应启动 LibraryApp 应用程序.启动应用程序后,该服务应该能够向其发送命令以使用可用功能之一(搜索书籍,预订书籍).

In this way, when I pronounce, for example, the words "start LibraryApp", then the LauncherApplication service should launch the LibraryApp application. Once the application is launched, the service should be able to send commands to it to use one of the available functions (search for a book, reserving a book).

如何将命令发送到已经处于活动状态的应用程序以对其进行控制?

How can I send commands to application that is already active, in order to control it?

推荐答案

我如何事先知道要用于已安装应用程序的参数?

how do I know in advance the parameters to put in an intent for the installed applications?

您与他们的开发人员交谈.在Intent上通常有零个参数"来启动应用程序的启动程序活动,因为主屏幕不会在Intent上放置此类参数".

You talk to their developers. There are typically zero "parameters" on an Intent to launch the launcher activity (or activities) of an application, since home screens do not put such "parameters" on the Intent.

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

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