Attempting to write in a readonly database Titanium Android

会有一股神秘感。 提交于 2019-12-11 15:25:33

问题


I have opened the db file from my sdcard. And i need to update in that file itself when changes occurs.

if (Ti.Platform.name === 'android' && Ti.Filesystem.isExternalStoragePresent()) {
var db2 = Ti.Database.open(Ti.Filesystem.externalStorageDirectory + 'path' + Ti.Filesystem.separator + 'to' + Ti.Filesystem.separator + 'mydb2Installed'); }

When i tried to update ., it says

"ReadOnly file cannot be updated"

I want to make this as a writable database file. In native android i have a solution,

this.getWritableDatabase() ;

Reference

in Titanium how can i make this is as writable file ??

NOTE: In TiApp.xml, I added permission for

WRITE_EXTERNALSTORAGE

来源:https://stackoverflow.com/questions/26333738/attempting-to-write-in-a-readonly-database-titanium-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!