Cannot create sqlite database on device
<p>I'm new to android and created my first app which uses an embeded sqlite databse. I've filled the database and the app works fine on android studio emulator but when I try to access it on my mobile device, the app is empty. </p>

<p>I have pulled <code>myapp.db</code> and then pushed it to the device:</p>

<pre><code>~/Android/Sdk/platform-tools/adb -s emulator-5554  push /home/me/Desktop/myapp2/myapp.db  /data/data/com.myappshop.myapp/databases/myapp.db
</code></pre>

<p>So I can see these files using adb shell:</p>

<pre><code>root@generic_x86_64:/data/data/com.myappshop.myapp/databases # ls -al
-rw-rw---- u0_a72   u0_a72      16384 2016-05-20 20:04 dictionary.db
-rw------- u0_a72   u0_a72       8720 2016-05-20 20:04 dictionary.db-journal
-rw-rw-rw- root     root       253952 2016-05-26 01:27 myapp.db
-rw------- u0_a72   u0_a72       8720 2016-05-23 00:53 myapp.db-journal
-rw-rw---- u0_a72   u0_a72      20480 2016-05-18 01:30 myapp1.db
-rw------- u0_a72   u0_a72      12824 2016-05-18 01:30 myapp1.db-journal
</code></pre>

<p>Here is the database class</p>

<pre><code>public class DictionaryDatabase extends SQLiteOpenHelper {
    private static final String DATABASE_NAME = "myapp.db";
    private static final String TABLE_DICTIONARY = "dictionary";
    private static final String FIELD_WORD = "word";
    private static final String FIELD_DEFINITION = "definition";
    private static final int DATABASE_VERSION = 1;


    DictionaryDatabase(Context context) {

        super(context, DATABASE_NAME, null, DATABASE_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("CREATE TABLE " + TABLE_DICTIONARY +
                "(_id integer PRIMARY KEY," +
                FIELD_WORD + " TEXT, " +
                FIELD_DEFINITION + " TEXT);");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        //Handle database upgrade as needed
    }

    public void saveRecord(String word, String definition) {
        long id = findWordID(word);
        if (id&gt;0) {
            updateRecord(id, word,definition);
        } else {
            addRecord(word,definition);
        }

    }

    public long addRecord(String word, String definition) {
        SQLiteDatabase db = getWritableDatabase();
        ContentValues values = new ContentValues();
        values.put(FIELD_WORD, word);
        values.put(FIELD_DEFINITION, definition);
        return db.insert(TABLE_DICTIONARY, null, values);
    }
    public int updateRecord(long id, String word, String definition) {
        SQLiteDatabase db = getWritableDatabase();
        ContentValues values = new ContentValues();
        values.put("_id", id);
        values.put(FIELD_WORD, word);
        values.put(FIELD_DEFINITION, definition);
        return db.update(TABLE_DICTIONARY, values, "_id = ?",
                new String[]{String.valueOf(id)});
    }
    public int deleteRecord(long id) {
        SQLiteDatabase db = getWritableDatabase();
        return db.delete(TABLE_DICTIONARY, "_id = ?", new
                String[]{String.valueOf(id)});
    }

    public long findWordID(String word) {
        long returnVal = -1;
        SQLiteDatabase db = getReadableDatabase();
        Cursor cursor = db.rawQuery(
                "SELECT _id FROM " + TABLE_DICTIONARY +
                        " WHERE " + FIELD_WORD + " = ?", new String[]{word});
        Log.i("findWordID","getCount()="+cursor.getCount());
        if (cursor.getCount() == 1) {
            cursor.moveToFirst();
            returnVal = cursor.getInt(0);
        }
        return returnVal;
    }


    public String getWord(long id) {
        String returnVal = "";
        SQLiteDatabase db = getReadableDatabase();
        Cursor cursor = db.rawQuery(
                "SELECT word FROM " + TABLE_DICTIONARY +
                        " WHERE _id = ?", new String[]{String.valueOf(id)});
        if (cursor.getCount() == 1) {
            cursor.moveToFirst();
            returnVal = cursor.getString(0);
        }
        return returnVal;
    }


    public String getDefinition(long id) {
        String returnVal = "";
        SQLiteDatabase db = getReadableDatabase();
        Cursor cursor = db.rawQuery(
                "SELECT definition FROM " + TABLE_DICTIONARY +
                        " WHERE _id = ?", new String[]{String.valueOf(id)});
        if (cursor.getCount() == 1) {
            cursor.moveToFirst();
            returnVal = cursor.getString(0);
        }
        return returnVal;
    }


    public Cursor getWordList() {
        SQLiteDatabase db = getReadableDatabase();
        String query = "SELECT _id, " + FIELD_WORD +
                " FROM " + TABLE_DICTIONARY + " ORDER BY " + FIELD_WORD +
                " ASC";
        return db.rawQuery(query, null);
    }
}   
</code></pre>

<p>I have also tried to re-write the class above to comply with the much referenced <a href="http://blog.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/" rel="nofollow">tutorial</a>, but was unsuccessful. 
So really appreciate your help to resolve this problem.</p>