在我用模拟器测试同一个游戏时,用sanyo和s40得到的rms的返回值不一样.
sanyo的rms.getData()返回值为0,而用S40模拟器测试时返回值为1.从而影响了整个过程中参数的不一样.
private void getRank()
{
String tmp[]=rank.getData();
totalCredits = Integer.parseInt(tmp[0]) ;
highScore = Integer.parseInt(tmp[1]) ;
if (totalCredits > 0)//s40的totalCredits>0 是"真"值,而sanyo得到的是"假"值
{
isLoad = true;
isContinue = true;
menuSelection = 0;
}
// if (Integer.parseInt(tmp[2]+"")==0){ns.ok = true;}else {ns.ok = false;}
}
void saveRank(){
rank.addData(""+totalCredits,1);
rank.addData(""+highScore,2);
//if (ns.ok) {rank.addData("0",3);} else {rank.addData("1",3);}
rank.exit();
}
////////////////
public String[] getData(){
String tmp[]=new String[3];
int x=0;
try{
RecordEnumeration enum2 = user.enumerateRecords(null,null,true);
while(enum2.hasNextElement()){
enum2.nextRecord();
ByteArrayInputStream bais=new ByteArrayInputStream(user.getRecord(x+1));
DataInputStream inputStream=new DataInputStream(bais);
tmp[x]=inputStream.readUTF();
x++;
}
}catch(Exception ex){}
return tmp;
}