×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jun 2010
    Posts
    9

    Password Storage Problem.

    i have developed an app that uses Record Store. when i click on the app icon list appears containing 2 options("Save password","Retrieve password").when i click on the password option textfield appears where i have to enter password. After entering password, password is saved in the recordstore.
    when i click on the 2 option in the list "Retrieve Password" , password is retreived.

    Next time when i run this app, and when i click on the 2 option in the list "Retrieve Password" , it shows
    record not exists.


    code for save password:
    TextField tf=new TextField("Your PASSWORD : ", null, 20, TextField.PASSWORD);
    RecordStore rc = RecordStore.openRecordStore("Password", true);

    byte[] b=tf.getString().getBytes();

    rc.addRecord(b,0,b.length);
    rc.closeRecordStore();


    code for retreiving password :
    TextField tf=new TextField("Your PASSWORD : ", null, 20, TextField.PASSWORD);
    RecordStore rc = RecordStore.openRecordStore("Password", true);
    byte[] b=new byte[100];
    String data=null;
    ByteArrayInputStream bis=new ByteArrayInputStream(b);
    DataInputStream dis=new DataInputStream(bis);
    for(int i=1;i<=rc.getNumRecords();i++)
    {
    rc.getRecord(i, b, 0);
    try {
    data = dis.readUTF();
    } catch (IOException ex) {
    ex.printStackTrace();
    }
    if (tf.getString().equals(data))
    {
    System.out.println("Password Exists");
    break;
    }
    if(!(tf.getString().equals(data)))
    {
    showAlert("Error......", "Password Does not exists");
    break;
    }

    bis.reset();
    }
    try {
    bis.close();
    } catch (IOException ex) {
    ex.printStackTrace();
    }
    try {
    dis.close();
    } catch (IOException ex) {
    ex.printStackTrace();
    }
    rc.closeRecordStore();

    }
    catch(RecordStoreException ex)
    {
    showAlert("Error..", ex.toString());

    }
    Last edited by jatina3logics; 2010-06-30 at 15:07.

  2. #2
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: Password Storage Problem.

    Quote Originally Posted by jatina3logics View Post
    i have developed an app that uses Record Store. when i click on the app icon list appears containing 2 options("Save password","Retrieve password").when i click on the password option textfield appears where i have to enter password. After entering password, password is saved in the recordstore.
    when i click on the 2 option in the list "Retrieve Password" , password is retreived.

    Next time when i run this app, and when i click on the 2 option in the list "Retrieve Password" , it shows
    record not exists.
    This might be happening because your are testing it on the emulator, in which the preferences are set - to clear the RMS on every launch of the Midlet. Which emulator are you using ?

    If you are testing this on the real device, then cut&paste your code here, we will help you debug the issue.
    Thanks,
    Ekta

Similar Threads

  1. Secure password storage
    By fearoffours in forum Symbian
    Replies: 2
    Last Post: 2009-08-04, 16:26
  2. webservices and data storage problem
    By waheedanuzhat in forum [Archived] Flash Lite on Nokia Devices
    Replies: 12
    Last Post: 2009-01-16, 12:27
  3. Storage Problem
    By zhenhan82 in forum [Archived] Flash Lite on Nokia Devices
    Replies: 1
    Last Post: 2008-02-21, 09:31
  4. Problem of Global Static storage
    By vniles in forum Symbian
    Replies: 5
    Last Post: 2007-06-14, 15:21
  5. SMS Storage Problem
    By Viper_Six in forum General Development Questions
    Replies: 1
    Last Post: 2006-07-09, 05:08

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×