你可以在你的android上升级sqlite3版本吗?
我正在编写一个使用外键约束的应用程序,该支持仅在版本 2.2 上引入,而我的手机是 2.1 当您应用程序安装?
I'm writing an app which uses the Foreign Key Constraints which support was only just brought in for on version 2.2, and my phone is 2.1 Is there any way to upgrade the version of sqlite3 on the htc desire or any other android phone when your application installs?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
简短的回答,不。
更长的答案。
是的,但是您必须拥有 root 权限,因为 sqlite 二进制文件位于 /system/xbin 中。您需要 root 访问权限才能覆盖该文件。您将无法升级任何其他设备,除非它们也具有 root 权限,并且支持可使用“测试密钥”进行签名的 update.zips 恢复映像。那么您必须手动分发更新 zip 文件,用户必须重新启动到恢复模式,刷新 update.zip 以应用您的“补丁”。
short answer, no.
Longer answer.
Yes, but you would have to have root because the sqlite binary is in /system/xbin. you would need root access to be able to overwrite that file. you would not be able to upgrade any other device unless they too had root, and a recovery image that supported update.zips that can be signed using the "test keys". then you would have to manually distribute the update zip file, that the user would have to reboot in to recovery mode, flash the update.zip to apply your "patch".
正如 Ryan 指出的那样,如果您具有 root 访问权限,则可以更改二进制文件,但还有另一种可能性:您可以将编译后的 SQLite 本机文件添加到您的应用程序中并通过 JNI 访问它们。以下是使用带有 Spatialite 扩展的 SQLite 的示例项目: https://github.com/mrenouf/android-spatialite
As Ryan pointed out, you can change the binary if you have root access, but there is also another possibility: you can add the compiled SQLite native files to your app and access them via JNI. Here is an example project using SQLite with the Spatialite extension: https://github.com/mrenouf/android-spatialite