WEB开发网
开发学院手机开发Android 开发 Android 开发文档 程序基础—Remote procedure ca... 阅读

Android 开发文档 程序基础—Remote procedure calls远程过程调用

 2010-07-01 14:57:00 来源:WEB开发网   
核心提示:Clients of the service (on the local side) would implement onServiceConnected() and onServiceDisconnected() methods so they can be notified when a successful co

Clients of the service (on the local side) would implement onServiceConnected() and onServiceDisconnected() methods so they can be notified when a successful connection to the remote service is established, and when it goes away. They would then call bindService() to set up the connection.

The service’s onBind() method would be implemented to either accept or reject the connection, depending on the intent it receives (the intent passed to bindService()). If the connection is accepted, it returns an instance of the Stub subclass.

If the service accepts the connection, Android calls the client’s onServiceConnected() method and passes it an IBinder object, a proxy for the Stub subclass managed by the service. Through the proxy, the client can make calls on the remote service.

This brief description omits some details of the RPC mechanism. For more information, see Designing a Remote Interface Using AIDL and the IBinder class description.

原文:http://buhutuu.cn/google-api/android/remote-procedure-calls/

上一页  1 2 3 

Tags:Android 开发 文档

编辑录入:coldstar [复制链接] [打 印]
赞助商链接