Vincent Tsao's Library tagged → View Popular, Search in Google
-
Add Sticky Note
private void copyDataBase() throws IOException{
//Path to the just created empty db, which I carefully closed so I
have safe write access
OutputStream databaseOutputStream = new FileOutputStream("/data/
data/com.mydomain.myapp/databases/myapp.db");
InputStream databaseInputStream =
databaseOpenHelperContext.getResources().openRawResource
(R.raw.textfile);
byte[] buffer = new byte[1];
int length;
while ( (length = databaseInputStream.read(buffer)) > 0 ) {
databaseOutputStream.write(buffer);
Log.w("Bytes: ", ((Integer)length).toString());
Log.w("value", buffer.toString());
}
//Close the streams
databaseOutputStream.flush();
databaseOutputStream.close();
databaseInputStream.close();
}-
Vincent Tsao on 2010-04-11copy a database
-
Selected Tags
Related Tags
Top Contributors
Groups interested in database
-
Online Databases
Some online database and dat...
Items: 11 | Visits: 95
Created by: smckearney
-
Programming Tutorials, Reference, and More!
list of tutorials, reference...
Items: 70 | Visits: 74
Created by: Matt G.
Highlighter, Sticky notes, Tagging, Groups and Network: integrated suite dramatically boosting research productivity. Learn more »
Join Diigo
