如何绑定已安装我的Andr​​oid设备上的远程服务? [英] how to bind a remote service that is installed on my android device?

查看:168
本文介绍了如何绑定已安装我的Andr​​oid设备上的远程服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有codeD此服务,任何东西计算,我想其他的应用程序能够绑定这个服务,即我想使其他程序员与该服务进行通信。

问题是,这有没有这些其他的程序员合作,以获得对源$ C ​​$ C。刚(已安装)APK与远程给予服务(和服务的界面,当然详细描述)......

问题是,日食保持braggin'有关的服务包不是源$ C ​​$ C可...

我如何做到这一点?


解决方案

  

问题是,这有没有这些其他的程序员合作,以获得对源$ C ​​$ C。只是
  与远程服务(已安装)的apk给出(以及服务的过程的详细描述
  接口)


在其他程序员将在介绍自己的接口AIDL文件。他们还需要知道使用绑定到你的服务的意图。 A详细说明,而漂亮,不会是足够的。

问题是,日食保持braggin'有关的服务包不是源$ C ​​$ C可...

您可能会考虑,在未来的问题,约为像日食保持braggin你的意思是什么俚语一点更加明确。


  

我如何做到这一点?


给其他程序员AIDL文件和意图定义。其他的程序员需要把AIDL文件在自己的项目的src / 在相应的目录树,然后调用 bindService()使用意图你形容。

下面是一个客户并的服务的展示了这一技术。

i have coded this service, that computes stuff and i want other applications to be able to bind this service, i.e. i want to enable other programmers to communicate with this service.

problem is, this has to work without these other programmers to get access to the source code. just the (installed) apk with the remote service is given (and of course a detailed description of the service' interface)...

problem is, eclipse keeps braggin' about that the packages of the service are not available in source code...

how do i do this?

解决方案

problem is, this has to work without these other programmers to get access to the source code. just the (installed) apk with the remote service is given (and of course a detailed description of the service' interface)

The "other programmers" will need the AIDL file describing your interface. They will also need to know the Intent to use to bind to your service. A "detailed description", while nice, is not going to be sufficient.

problem is, eclipse keeps braggin' about that the packages of the service are not available in source code...

You might consider, in future questions, being a bit more clear about what you mean by slang like "eclipse keeps braggin'".

how do i do this?

Give the other programmers the AIDL file and the Intent definition. The other programmers will need to put the AIDL file in their own projects' src/ trees in the appropriate directory, then call bindService() using the Intent you describe.

Here is a client and service demonstrating this technique.

这篇关于如何绑定已安装我的Andr​​oid设备上的远程服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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