调用其它app中的Service
来源:互联网 发布:淘宝卖家不同意退货 编辑:程序博客网 时间:2024/06/06 02:36
涉及到IPC,用Messenger实现IPC,参见:http://developer.android.com/guide/components/bound-services.html
在Service的工程的Manifest文件中做如下声明:
<service android:name="com.boyaa.service.MyMessengerService"
android:exported="true">
<intent-filter>
<action android:name="com.boyaa.service.action.BIND_SERVICE"/>
</intent-filter>
</service>
在Client工程中,通过如下方式调用:
Intent intent = new Intent();
intent.setClassName("com.boyaa.service", "com.boyaa.service.MyMessengerService");
MainActivity.this.bindService(intent, MainActivity.this, Context.BIND_AUTO_CREATE);
或者
Intent intent = new Intent();
intent.setAction("com.boyaa.service.action.BIND_SERVICE");
MainActivity.this.bindService(intent, MainActivity.this, Context.BIND_AUTO_CREATE);
- 调用其它app中的Service
- ios调用其它App
- 启动其它APP中的Activity
- 如何调用其它APP的Activity?
- 调用Service中的方法
- Unity3d GameObject 调用其它GameObject中的方法
- 调用其它python脚本中的函数
- Java CXF调用PHP[其它语言]的Web Service
- 调用其它app的activity和让其它app调用你的activity的一些必要设置
- service调用Activity中的方法
- Win8上Service程序及外部App调用此Service
- Win8上Service程序及外部App调用此Service
- 委托方法好像不可以调用其它dll中的方法
- Axis调用.NET中的Web Service
- xml web service 中的异步调用
- 在web service 中的android调用soap
- Android Service 调用服务中的方法
- Android Service 调用远程服务中的方法
- 探讨C++ 变量生命周期、栈分配方式、类内存布局、Debug和Release程序的区别(一)
- 一个Linux下C线程池的实现
- 自学C语言练习1
- mysql 多列连接
- 探讨C++ 变量生命周期、栈分配方式、类内存布局、Debug和Release程序的区别(二)
- 调用其它app中的Service
- 客户端使用自定义代理类访问WCF服务
- Windows Azure Service Bus 推动财务服务门户的高可用性和可伸缩性
- struts与spring的整合
- Element类
- 8.【cocos2d翻译系列】Actions, Transformations and Effects--Ease actions
- @Html.Partial,@Html.Action,@Html.RenderPartial,@Html.RenderAction区别
- C语言-Socket地址的转换方式
- Android自定义shape的使用