found Error in creating simple SQLite databas Android Application
**03-12 12:57:39.635: E/Database(333): Failure 1
(near "tablefriends": syntax error) on 0x29b2b0
when preparing 'create tablefriends(_id integer
primary key autoincrement,name text not null,address text);
when i write this code in my activity class, my application even did not run. but if i removed this code from activity class , my application run but it gives exception when i insert data into the database
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
FriendsDataSource s=new FriendsDataSource(this);
s.closedatabase();
}
@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
FriendsDataSource s=new FriendsDataSource(this);
s.opendatabase();
}
public static final String FRIENDS_TABLE_CREATE_STMT="create table"+TABLE_NAME+
"("+COLUMN_ID+" integer primary key autoincrement,"+
COLUMN_FRIEND_NAME+" text not null,"+COLUMN_ADDRESS+" text);";
FriendsDataSourceinonResumeand close the database of that instance instead of creating two instances, likemFriendsSource = new FriendsDataSource(this);wheremFriendsSourceis a member of the class.