Tag Archives: assets

18,564 views

Get assets folder files to array of strings Android example

Get assets folder files to array of strings. Its show files in assets folder and sub folders: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main);   final AssetManager assetManager = getAssets(); try { // for assets folder add empty string String[] … Continue reading

Posted in Android Examples Code | Tagged , , , , , , , | Comments Off on Get assets folder files to array of strings Android example
53,258 views

Get Assets folder path and read txt file to string Android example code

Programmatically load text from Asset folder file myData.txt to string Android example source code. Read file to byte[] buffer and convert into string Android example. Assets folder path may be: c:\documents\_android_projects\MyProject\assets // Path for a WebView String sAssets = "file:///android_asset/" … Continue reading

Posted in Android Examples Code | Tagged , , , , , , | Comments Off on Get Assets folder path and read txt file to string Android example code
7,857 views

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 … Continue reading

Posted in SQLite database | Tagged , , , , , , | Comments Off on Copy sqlite database from apk package to device folder Android example