RMS and Palm
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Marika_Ludmann
Posted On:   Friday, January 24, 2003 06:35 AM

I am trying to capture data entered by the users in RMS. I have no trouble doing so in the phone emulators of the J2ME Wireless Toolkit, but the Palm emulator does not save the data. I tried blocking flush()- as someone suggested to me, but no success. Can someone look at my code or give me some ideas? Thanks if (command == saveCommand) { String vt = vType.getString(); int vtID = Integer.parseInt(vTypeID.getString()); String shp = shape.getString(); String mk = make.getString(); try { writeRecord(vt, mk, shp, vtID); } public void writeRecord(String vt,String mk, String shp, int id) { try { ByteArrayOutputSt   More>>

I am trying to capture data entered by the users in RMS.
I have no trouble doing so in the phone emulators of the J2ME Wireless Toolkit, but the Palm emulator does not save the data. I tried blocking flush()- as someone suggested to me, but no success. Can someone look at my code or give me some ideas? Thanks

			
if (command == saveCommand) {
String vt = vType.getString();
int vtID = Integer.parseInt(vTypeID.getString());
String shp = shape.getString();
String mk = make.getString();

try
{
writeRecord(vt, mk, shp, vtID);
}

			
public void writeRecord(String vt,String mk, String shp, int id)
{
try
{
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(baos);
byte[] record;
dos.writeUTF(vt);

dos.writeUTF(mk);
dos.writeUTF(shp);
dos.writeInt(id);
//dos.flush();

record = baos.toByteArray();
valveTypeStore.addRecord(record, 0, record.length);

//baos.reset();
baos.close();
dos.close();
}
...
   <<Less
About | Sitemap | Contact