I am developing an android app and I have to store some data using SQLite db . I have 8 accounts having following elements
- Name (String)
- Control Type (int)
- Site (String)
- Username (string)
- Password (String)
Now I would like to store, access and modify them using SQLite. I have defined them in a class as follows
public class accountsDB {
//private variables
int _id;
int _control_type
boolean _empty;
String _site_name;
String _site_phone_number;
String _user_name;
String _pass;
// Empty constructor
public accountsDB(){
}
I am using _empty
boolean value to check if the account has been added or is empty and I can add new account here if required
I am confused for two things:
- I need to have 8 copies of this class so I can save,read and edit
account [1-8]
- How can I fill default values for
_id
and_empty
when this db will first be created.
I am new to android and havent used the SQLite DB method to save data. Thanks in Advance