I am having trouble with inserting a string using sqlite in an android app,
I tried,
query = "INSERT OR REPLACE into table(_id, text) VALUES ("+data.get(i).id+", '"+data.get(i).text+"')";
MyClass.db.execSQL(query);
If my string looks like,
'I'm an android developer'
App crashes here, here is logcat result,
Caused by: android.database.sqlite.SQLiteException: near "m": syntax error: , while compiling: INSERT OR REPLACE into table (_id, text) VALUES (4, '"I'm an android developer"' )
I think it assumes that, my query ends here
'"I'
please help me to insert any case of string, either it contains single or double quotes like,
"I'm an "android" developer"