Here is my code:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
SQLiteDatabase.openOrCreateDatabase("/gregpeck.db", null);
}
Obviously this is inside my Main Activity.
I have also added the permission to my Main Activity:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ie.callanan.dennis.testhw" >
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
The error message I receive is:
Failed to open database 'gregpeck.db'.
android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database
getExternalFilesDir()orgetExternalStoragePublicDirectory()(have a look at developer.android.com/guide/topics/data/… for more details)