File file = new File(mWorkPath);
if (!file.exists()){
boolean b = file.mkdirs();
}
}
public static String getDBpath() {
File file = new File(mWorkPath + DB_PATH_NAME);
if (!file.exists())
file.mkdirs();
return mWorkPath + DB_PATH_NAME;
}
public static void copyAccessDB(Context context) {
try {
String[] dbNames = context.getAssets().list(“db”);
for (String dbName : dbNames) {
long startTime = System.currentTimeMillis();
String filePath = FileUtil.getDBpath() + dbName;
File dbFile = new File(filePath);
if (!dbFile.exists()) {
FileOutputStream fos = null;
try {
dbFile.createNewFile();
}catch (Exception e){
}
InputStream is = context.getAssets().open(“db/” + dbName);
fos =