AProgramOne installation requires several pieces of data,
The current program first checks whether the table exists. If the table does not exist, it is created. If the table exists, it is not created. So I went online for half a day and found a solution. Put the database files under Res/raw.
Looks like android
Raw files are not compiled into binary files. Then, the program checks whether the database table does not exist. Then, the raw database file is copied to the mobile phone through the input/output stream.CodeAs follows:
Try {
Log. E (database_path, database_path );
String databasefilename = database_path + "/" + database_filename;
File dir = new file (database_path); cargo expert
If (! Dir. exists ())
Dir. mkdir ();
If (! (New file (databasefilename). exists ()){
Inputstream is = getresources (). openrawresource (
R. Raw. healthmanage );
Fileoutputstream Fos = new fileoutputstream (databasefilename );
Byte [] buffer = new byte [8192];
Int COUNT = 0;
While (COUNT = is. Read (buffer)> 0) {Women's brand ranking
FOS. Write (buffer, 0, count );
}
FOS. close ();
is. close ();
}< br>
} catch (exception e) {
log. E ("error", "error");
}