Q:

Insert a String containing an apostrophe (sqlite)

Is there a way to save strings that contain an apostrophe into an sqlite database?
(I have an app that saves the names of all installed apps on your device and ran into an error while saving "Dood's Music Streamer")

A:

You could use a compiled statement and bind the String parameter.
SQLiteDatabase db = dbHelper.getWritableDatabase();
SQLiteStatement stmt = db.compileStatement("INSERT INTO FOO (NAME) VALUES (?)");
stmt.bindString(1, "Dood's Music Streamer");
stmt.execute();

