Blackberry - how to start my own service at phone boot-up?

后端 未结 3 957
自闭症患者
自闭症患者 2021-01-01 08:01

I want to start my own service implementation when the phone starts?

How to achieve it?

3条回答
  •  感情败类
    2021-01-01 08:34

    You could use an IPC (kind of) mechanism to exchange data between the "Service" and Application. There are two ways of accomplishing this:

    1. net.rim.device.api.system.RuntimeStore has methods to put and get an Object that is identified by an unique id (long). This id can be generated from within the JDE IDE.
    2. net.rim.device.api.system.ApplicationManager has methods that allows one to post global events, that can exchange data (once again identified by unique id). The other application will have to implement GlobalEventListener and register with the system - addGlobalEventListener.

    In the first approach, the other entity is not notified when data is added to store.

提交回复
热议问题