j256 / ormlite-android

ORMLite Android functionality used in conjunction with ormlite-core
http://ormlite.com/
ISC License
1.59k stars 367 forks source link

Can not access database with Ormlite #54

Closed yangyaofei closed 8 years ago

yangyaofei commented 8 years ago

there is i did

Experiment 1:

su
chmod 777 /data/data/not.my.app/databases
chmod 666 /data/data/not.my.app/databases/data.db
```


then i use ormlite to access it ,OK,it work,but that app can't access this .db anymore . I rechanged the permission ,still can't work .By the way,that app->"not.my.app"  used ormlite too. 
## Experiment 2:

I copy data.db file to my app's databases folder and chown and chmod ,still not work .SQLException throw :Getting a writable database from helper DBHelper failed.

_so i dont konw it's a bug or the way i used is  wrong._
yangyaofei commented 8 years ago

the exception disappear ,i don't know way .

kpgalligan commented 8 years ago

I would say this is out of scope for ORMLite, as its certainly going to be a problem with file access. If the problem comes back, I would first attempt to simply read the file from the other app with java File and stream objects. If you can access the file from standard java, but still have an ormlite issue, then it may be something else, but ORMLite is using the standard Java/Android stuff under the hood, so very unlikely to be something in the ORMlite realm.

On Fri, Oct 30, 2015 at 3:04 AM, yangyaofei notifications@github.com wrote:

the exception disappear ,i don't know way .

— Reply to this email directly or view it on GitHub https://github.com/j256/ormlite-android/issues/54#issuecomment-152397694 .

Kevin Galligan http://about.me/kpgalligan

yangyaofei commented 8 years ago

thank you to reply , it work now .i just change the file permission in another way , may be the way i change permission is wrong. so, thank you agin 2015年10月30日 下午9:29,"kpgalligan" notifications@github.com写道:

I would say this is out of scope for ORMLite, as its certainly going to be a problem with file access. If the problem comes back, I would first attempt to simply read the file from the other app with java File and stream objects. If you can access the file from standard java, but still have an ormlite issue, then it may be something else, but ORMLite is using the standard Java/Android stuff under the hood, so very unlikely to be something in the ORMlite realm.

On Fri, Oct 30, 2015 at 3:04 AM, yangyaofei notifications@github.com wrote:

the exception disappear ,i don't know way .

— Reply to this email directly or view it on GitHub < https://github.com/j256/ormlite-android/issues/54#issuecomment-152397694> .

Kevin Galligan http://about.me/kpgalligan

— Reply to this email directly or view it on GitHub https://github.com/j256/ormlite-android/issues/54#issuecomment-152526501 .