简单的说,就是获取服务器的相同的数据库并替代已有的同名的数据库,数据库的名字和格式都一样,这部分现在已经实现了。
但是接下来的使用出现了问题,大家帮我想想办法:
1.所有的列的类型都变成了BLOB(如果是在不行还是可以改)
2.使用时报错 Caused by: android.database.sqlite.SQLiteException: Can't upgrade read-only database from version 0 to 2:   ,但是我在数据库传输完成之后有给它提升权限的语句:
String command = "chmod 777 " + "/data/data/(我的包名)/databases/" + local;
        try {   
            process = Runtime.getRuntime().exec(command);   
            Log.i("command","The Command is : "+command);   
            process.waitFor();   
        } catch (Exception e) {   
                Log.w("Exception ", "Unexpected error - "+e.getMessage());   
        } finally {   
                try {   
                        process.destroy();   
                } catch (Exception e) {   
                        Log.w("Exception ", "Unexpected error - "+e.getMessage());   
                }   
        }   
而且报错部分是“Can't upgrade”。有没有做过类似需求的?