if (!mRootPath.endsWith(“/”))
mRootPath += “/”;
return mRootPath;
/**
- 设置工作目录
- @param context app context,不然会造成内存泄漏
- @param path
public static void setWorkPath(Context context, String path) {
mContext = context;
if (null != getRootPath()) {
mWorkPath = mRootPath + path;
if (!mWorkPath.endsWith(“/”)) {
mWorkPath += “/”;
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 copyAc
Original: https://blog.csdn.net/m0_64319298/article/details/121556409
Author: m0_64319298
Title: android 读取本地数据库db文件(Android sqlite,工作感悟
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/816105/
转载文章受原作者版权保护。转载请注明原作者出处!