private static List<NetworkKey> getNetKeys(@NonNull final SupportSQLiteDatabase database) {
        final List<NetworkKey> keys = new ArrayList<>();
        final Cursor cursor = database.query("SELECT * FROM network_key");
        if (cursor != null && cursor.moveToFirst()) {
            do {
                final int index = cursor.getInt(cursor.getColumnIndex("index"));
                final byte[] key = cursor.getBlob(cursor.getColumnIndex("key"));
                final NetworkKey networkKey = new NetworkKey(index, key);
                keys.add(networkKey);
            } while (cursor.moveToNext());
        }
        return keys;
    }
Override the onOpen method to populate the database.
For this sample, we clear the database every time it is created or opened.
<p>
If you want to populate the database only when the database is created for the 1st time,
override RoomDatabase.Callback()#onCreate
mesh/src/main/java/no/nordicsemi/android/mesh/MeshNetworkDb.java