好的,根据BB手册
“使用记录存储的应用程序可以使数据私有或允许共享。记录存储经常用于应用程序之间的数据共享。”
然而,在示例中,我没有看到任何关于如何使唱片商店成为“或允许共享”的例子。
谁能帮我澄清一下吗?我对这东西非常非常陌生!
发布于 2011-12-13 22:10:55
好吧,我找到了我自己的答案:
http://www.blackberry.com/developers/docs/7.0.0api/javax/microedition/rms/RecordStore.html#openRecordStore%28java.lang.String,%20boolean,%20int,%20boolean%29
public static RecordStore openRecordStore(String recordStoreName,
boolean createIfNecessary,
int authmode,
boolean writable)
throws RecordStoreException,
RecordStoreFullException,
RecordStoreNotFoundException"authmode“在创建期间确定其共享还是私有。
发布于 2011-12-14 00:56:59
就我个人而言,我不建议使用RecordStore。它是基于记录的,这意味着很难使用。试试PersistentObject,它是基于对象的,非常方便。而且很容易在应用程序之间共享数据,您只需要实现读/写签名。有关详细信息,请参阅:http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/system/PersistentObject.html#getContents%28net.rim.device.api.system.CodeSigningKey,%20net.rim.device.api.system.CodeSigningKey%29 CodeSigningKey用于控制对存储内容的访问。
https://stackoverflow.com/questions/8496518
复制相似问题