CodeBus
www.codebus.net
Search
Sign in
Sign up
Hot Search :
Source
embeded
web
remote control
p2p
game
More...
Location :
Home
Search - imyservice
Main Category
SourceCode
Documents
Books
WEB Code
Develop Tools
Other resource
Search - imyservice - List
[
OS program
]
iMyService
DL : 0
自己写的服务程序,将程序注册为服务,可以在此基础上扩展其他功能-himself wrote the service procedures, procedures for registration services, on the basis of the expansion of other functions
Date
: 2008-10-13
Size
: 8.53kb
User
:
张丰年
[
OS program
]
iMyService
DL : 0
自己写的服务程序,将程序注册为服务,可以在此基础上扩展其他功能-himself wrote the service procedures, procedures for registration services, on the basis of the expansion of other functions
Date
: 2025-07-06
Size
: 8kb
User
:
张丰年
[
JSP
]
aidl
DL : 0
这里主要讲解一下服务器端回调客户端的步骤: 1、写一个ITaskCallback.aidl文件,该文件中定义了一些需要服务器端调用的函数接口 2、写一个IMyService.aidl文件,里面加两个接口用于注册和取消ITaskCallback.aidl文件中定义的接口 void registerCallback(ITaskCallback cb) void unregisterCallback(ITaskCallback cb) 3、定义MyService类,该类继承Service,在该类中定义RemoteCallbackList变量,用于注册ITaskCallback对象, 这样服务器端才知道哪些函数可以调用;在该类中还要定义一个MyServiceImpl继承IMyServcie.Stub, 并实现registerCallback()和unregisterCallback()方法。 4、在客户端实现ITaskCallback接口(当然先要把ITaskCallback.aidl文件及其目录copy到客户端工程中)-Here mainly explain the steps the server callback client: 1. Write a ITaskCallback.aidl file that defines some function interface requires a server-side call 2. Write a IMyService.aidl file, which added two interfaces interfaces for registration and cancellation ITaskCallback.aidl defined in the file void registerCallback (ITaskCallback cb) void unregisterCallback (ITaskCallback cb) 3, the definition of MyService class that inherits Service, RemoteCallbackList variable in the class definition for registration ITaskCallback objects Thus the server to know what functions can be invoked also define a MyServiceImpl in the class inheritance IMyServcie.Stub, And implement registerCallback () and unregisterCallback () method. 4, in the client implementation ITaskCallback interface (of course first put ITaskCallback.aidl file and directory copy to the client project)
Date
: 2025-07-06
Size
: 94kb
User
:
李里
CodeBus
is one of the largest source code repositories on the Internet!
Contact us :
1999-2046
CodeBus
All Rights Reserved.