开发者

Communicating with other blackberry application or a library which can be upgradable

开发者 https://www.devze.com 2023-03-11 16:02 出处:网络
I have one more doubt with RuntimeStore. I am able to exchange strings using Runtim开发者_运维知识库eStore.

I have one more doubt with RuntimeStore. I am able to exchange strings using Runtim开发者_运维知识库eStore. But i want object also to be exchanged.

Example: 3 independent applications are there A, B, C. A creates an object of C an share it with B using RuntimeStore, and then B will use the same object and invoke the methods or data of C.

Can we do something like this using RuntimeStore. I couldn't find it. If you have any idea please share them with me. Thanks.


The Runtime Store can be used for inter-application communication. As long as your two applications maintain the same data schema you shouldn't have a problem allowing for upgrades.

There is an example at the link that should help you get it going.


Runtime store can be used to exchange data. It would be better if we can know when is the data exchanged as well. You could use GlobalEventListener or Notification Manager for this purpose. Using these, you can express interest to receive certain types of events and register a listener [the same way as action listener on a button]. And when such an event occurs you could read the data from Runtime Store. But callback of Global Event Listener itself can accomodate the data exchange as well.

Hope it helps.!

Here is an example for you to check out. Actually, this is an honest example of IPC that really answers your question. You might also want to consider the security of the data you are supposedly exchanging.


I am not sure what is your intention and objective. Let me present you with different scenarios and provide plausible solutions.

  1. There exists a 3rd party application A and you are authoring application B. Now your application is interested in invoking some services of A or some protected /sensitive/personal features. If this is the case, you could use specific and pre defined and well known permissions that are defined here and then ask system to provide you with those permissions. System in turn asks the user that application B is requesting permission for a list of operations. A UI is presented to user to request permissions. If user grants them, your application will in-turn be granted; else your application will be denied permission.
  2. You are the sole author two applications A and B and have complete control over both the applications. Your objective here is to exchange some data securely, even in presence of other rogue applications that can sniff data. In this case, you could use Application Manager's postGlobal event and Global Event Listener to signal when exactly to exchange the data. Now, you can use RuntimeStore to exchange data; in order to put security in this exchange, you could sign the data with your keys and place it in runtime store. Only the other entities that can provide credentials will be granted access to your data on run time store. This is called controlled access to private data

    RuntimeStore.put( MY_DATA_ID, new ControlledAccess( myHashtable, codeSigningKey ) ); // in application A

    Hashtable myHashtable = (Hashtable) RuntimeStore.get( MY_DATA_ID, codeSigningKey ); // in Application B

  3. The notification between applications A and B can also facilitated by Notifications Manager.

So, let us know what exactly is you are trying to accomplish. We can accordingly direct you to code examples.

0

精彩评论

暂无评论...
验证码 换一张
取 消