如何检查j2me中rms中的第一个值是否为空?
RecordStore rs = RecordStore.openRecordStore("StoryDataBase1",true);
String data_to_write_in_file = Slug.getString()+"^"+title.getString()+"^"+Body.getString()+"^"+com.editorial.Main.MainImagePath+"^"+com.editorial.Main.MainVideoPath+"^"+com.editorial.Main.MainVoicePath+"$";
byte b[] = rs.getRecord(1);
String str = new String(b,0,b.length);
if(str.equals("")) {
byte bytes[] = data_to_write_in_file.getBytes();
rs.addRecord(bytes,0,bytes.length);
}
else
{
str=str+data_to_write_in_file;
byte[] data = str.getBytes();
rs.setRecord(1, data, 0, data.length);
}
rs.closeRecordStore();
在这里我想检查 rms 是否包含第一个值,否则它将在其中输入新值???但我仍然有点困惑,信息是否会在移动设备中永久保留......
RecordStore rs = RecordStore.openRecordStore("StoryDataBase1",true);
String data_to_write_in_file = Slug.getString()+"^"+title.getString()+"^"+Body.getString()+"^"+com.editorial.Main.MainImagePath+"^"+com.editorial.Main.MainVideoPath+"^"+com.editorial.Main.MainVoicePath+"$";
byte b[] = rs.getRecord(1);
String str = new String(b,0,b.length);
if(str.equals("")) {
byte bytes[] = data_to_write_in_file.getBytes();
rs.addRecord(bytes,0,bytes.length);
}
else
{
str=str+data_to_write_in_file;
byte[] data = str.getBytes();
rs.setRecord(1, data, 0, data.length);
}
rs.closeRecordStore();
in this i want to check whether rms contains first value or not, otherwise it will enter new value in it??? But i am still little bit confused that whether information going to stay permanent in mobile or not...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
永久存储在 RMS 中的信息我们已经讨论过这一点。
请参阅此示例代码并尝试如下操作,
更新
请参阅这些链接以供参考,
An information permanently stored in RMS and We are already discussed regards this.
See this sample code and try like this,
Updates
See these links for your reference,