How do I save it as a db file in android's mediastore?

Viewed 193

I am trying to save a sqlite db file

so

values.put(MediaStore.MediaColumns.MIME_TYPE, "application/vnd.sqlite3");

values.put(MediaStore.MediaColumns.MIME_TYPE, "application/x-sqlite3");

I did the above, but I get the following error

values.put(MediaStore.MediaColumns.MIME_TYPE, "text/plain");

If you change to, it will be saved but the extension will change to.

How do I specify MIME.TYPE to save as .db?

android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: file._data )code 2067 SQLITE_CONSTRAINT_UNIQUE[2067])

1 Answers

Convert all your database data into JSON format, and store as plain text file text/json.

Related