将数据库复制到 Android 设备中的 /data

发布于 2024-12-20 05:24:49 字数 218 浏览 2 评论 0原文

好吧,我尝试了很多方法让我的应用程序可以在手机上使用 SQLite 访问数据库。我创建了一个 LBS 应用程序,并将所有位置保存在 dbtaxi 中。我从 Android 模拟器中提取 dbtaxi,并想使用 adb 将其复制到手机上的 /data。正如我所料,我需要成为根。

有什么方法可以在不先成为根的情况下放置它吗?或任何其他方式来确保我的应用程序可以在我的手机上访问它。

请帮助我。

Okay, I tried many thing to make my apps can access database using SQLite on my phone. I create an LBS apps, and all Location saved in dbtaxi. I pull dbtaxi from my android emulator and I want to copy it to /data on my phone using adb. as I expected, I need to be a root.

Is there any way to put it without become a root first ? Or any other way to make sure, my apps can access it on my phone.

Help me please.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

赠佳期 2024-12-27 05:24:49

有什么方法可以在不先成为 root 的情况下放置它吗?

不。

或任何其他方式来确保我的应用程序可以在我的手机上访问它。

您的应用程序应该创建并填充自己的数据库。毕竟,假设您家里有多个用户,您将无法手动将数据库复制到所有用户的手机上。

您可以尝试 https://github.com/jgilfelt/android-sqlite-asset-helper< /a> 作为将数据库打包到应用程序中以部署到设备的一种方式。

Is there any way to put it without become a root first ?

No.

Or any other way to make sure, my apps can access it on my phone.

Your app should be creating and populating its own database. After all, assuming there are more than a couple of users in your home, you will not be able to manually copy a database to all your users' phones.

You might try https://github.com/jgilfelt/android-sqlite-asset-helper as a way to package your database inside your app to deploy to devices.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文