String dbfile = "/mnt/sdcard/eMenu/cookbook.db";
File file = new File(dbfile);
LogD("filename: "+file.toString());//测试一下文件是否有效
try {
String command = "chmod 777 " + dbfile;//全部权限
LogD("command = " + command);
Runtime runtime = Runtime.getRuntime();
Process proc = runtime.exec(command);
}
catch (IOException e)
{
LogD("chmod fail!!!!:" +e.getMessage());
}
android程序访问sd卡上的数据库,需要给程序加上,android.permission.WRITE_EXTERNAL_STORAGE权限