03-21-2012 06:34 AM
We need to maintain two or more instances of our application on one device, since we have a Blackberry platform, which is used to create multiple applications. We use the persistent store to store some of our objects.
Now, the problem is, in order to maintain multiple instances of the application, we cannot create custom persistable objects, as it throws an exception of multiple class definitions. If we use persistable objects provided by blackberry (byte, etc), the objects remain in the store even after the application is deleted.
03-21-2012 06:42 AM
03-21-2012 06:44 AM
That was one of the options i was considering. Just wanted to confirm if that is the only way.
03-26-2012 09:45 AM
The problem with creating a library for the persistent objects is, that if two of my applications are signed using different keys, one of them will not be able to access the library... In our scenario, the users may choose to sign their own application with different signing keys, in which the library solution will not work.
03-27-2012 11:29 AM
I am hoping this will clear up some confusion here.
1) If you wish your objects to be removed when the application that uses it is removed from the device, then you need to use Application specific objects. By different objects, I mean objects that have a different class and package name. The stored objects need to have a package/class name that matches a class in the Application being removed.
2) If you wish to have multiple applications on a device, each of which has a different set of persistent data, then you should use a different ID for each application.
Creating a Library that actually creates and manages these objects can be problematic if this Library is shared between applications. This implementation is typically achieved by including the shared Library in both applications. Effectively this means all the Library classes are duplicated on the device. This works fine for most classes, but does not work for Persistable classes. Only one of these will be loaded. This means the Persistable classes in the shared Library must be identical.
With this 'clarification', can you restate what you are trying to do and the problems you are facing?