简体   繁体   English

如何将RecordStoreException J2ME更改为Java Android

[英]How to change RecordStoreException J2ME to java Android

I have a code in J2ME with RecordStoreException 我在J2ME中有一个带有RecordStoreException的代码

public Preferences(String recordStoreName) throws RecorStoreException
{
    mRecordStoreName = recordStoreName;
    mHashTable = new Hashtable();
    load();
}

How can I change it to java Android? 如何将其更改为Java Android? Is RecordStore can be used in java Android, because there's no such a package when i try to import. 是RecordStore可以在Java Android中使用,因为当我尝试导入时没有这样的包。 Is there another way to save device id without it in Android? 在Android中,没有其他方法可以保存设备ID吗?

The RMS API is only available in JavaME. RMS API仅在JavaME中可用。 It does not exist in regular JavaSE or JavaEE platforms. 它在常规JavaSE或JavaEE平台中不存在。 Android is based on JavaSE, so that API is not available. Android基于JavaSE,因此API不可用。 Android has its own persistence mechanisms, like SQLite or SharedPreferences. Android具有自己的持久性机制,例如SQLite或SharedPreferences。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM