简体   繁体   English

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

[英]Copy Database to /data in Android Device

Okay, I tried many thing to make my apps can access database using SQLite on my phone. 好的,我做了很多尝试,使我的应用程序可以使用手机上的SQLite访问数据库。 I create an LBS apps, and all Location saved in dbtaxi. 我创建了一个LBS应用程序,并将所有位置保存在dbtaxi中。 I pull dbtaxi from my android emulator and I want to copy it to /data on my phone using adb. 我从android模拟器中拉出dbtaxi,我想使用adb将其复制到手机上的/ data中。 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. 请帮帮我。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM