0
03-12 16:56:25.652: E/Database(334): Failure 1 (near "tablefriends": syntax error) on 0x29b268 when preparing 'create tablefriends(_id integer primary key autoincrement,name text not null,address text);'.

I have debugged the code and found exception on 4th line of this given function:

public Boolean addFriend(FriendData friendData){

ContentValues newFriendValues=new ContentValues();
newFriendValues.put(FriendsMetaData.COLUMN_FRIEND_NAME, friendData.getFriend_Name());
newFriendValues.put(FriendsMetaData.COLUMN_ADDRESS,friendData.getFriend_Adress());

long id=friendsDB.insert(FriendsMetaData.TABLE_NAME, null, newFriendValues);
if(id==-1){
    return false;
}
else
    return true;    
}

1 Answer 1

1

Maybe you mean "create table friends", not "create tablefriends", that's why it throws the exception. Hope this helps.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.