开发者

Blackberry what is the real use of Runtimestore?

If another(App2) application trying to access a shared object(App 1 Object) and cannot type cast it to use it, as it doesnt have those kind of objects. What is the real use of Runtimestore, in using between several applications ?.. o开发者_StackOverflow社区nly Strings or regular J2ME Objects can only be shared ?


I am working on an app that has multiple entry points. So the same application has multiple instances on the phone. The RuntimeStore is a handy way to communicate between the instances, and because both instances are running the same code base, all objects can be shared.


It is probably meant for apps that use common packages which define the types being shared.


Like @Remy said, you can still pass around any of the objects in the BlackBerry API - at least, those that implement Persistable, or the few standard classes that are automatically persistable, like Strings, the primitive wrapper classes (Integer, etc) and a bunch of the collection object from java.util (Hashtable, Vector), as well as arrays of any of those types.

That's enough for some pretty hefty message passing.


Its perfect for caching images because you can store Bitmaps in the runtime store, just ensure that you protect it with a CodeSigningKey to stop other applications accessing it:

codeSigningKey = CodeSigningKey.get(ApplicationDescriptor.currentApplicationDescriptor().getModuleHandle(),"ACME");
runtimeStore = RuntimeStore.getRuntimeStore();
runtimeData = (Hashtable) runtimeStore.get(runtimeKey,codeSigningKey);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜