Okhelp.cz

Recepty, články, nápady, programování. Dříve dum-zahrada, finance, internet a know-how.okhelp.cz Pro lepší výsledky hledání používejte i diakritiku.

Copy sqlite database from apk package to device folder Android example

Put your sglite database to Android Eclipse project folder named Assets.
On device will copy database file to application folder as this example:



 public void createDatabase(Context myContext) throws IOException {
    String sPackName = myContext.getPackageName();
    InputStream assetsDB = myContext.getAssets().open("myDatabase");
    OutputStream dbOut = new FileOutputStream("/data/data/"+sPackName+"/database");
 
    byte[] buffer = new byte[1024];
    int length;
    while ((length = assetsDB.read(buffer))>0){
      dbOut.write(buffer, 0, length);
    }
 
    dbOut.flush();
    dbOut.close();
    assetsDB.close();
}



396LW NO topic_id




AD

Další témata ....(Topics)


167

INSTALL_FAILED_INSUFFICIENT_STORAGE | install_failed_insufficient_storage


1.) Try reopen the Emulaor and restart Eclipse.
OR
2.) Try to delete AVD from Eclipse menu Window - AVD manager.
OR
3.) Insert into manifest.xml this source code.

 <manifest xmlns:android="//schemas.android.com/apk/res/android"
    package="com.myweb.mypackage"
    android:installLocation="preferExternal"
270

How to add or remove widgets home screen android 4 | how-to-add-or-remove-widgets-home-screen-android-4


Video tutorial
How to add or remove widgets home screen Android 4.