Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-20443] (5_2_X) Android: Create or Open File in Ti.Database #7891

Merged
merged 1 commit into from
Mar 28, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,11 @@ public TiDatabaseProxy open(Object file)

try {
if (file instanceof TiFileProxy) {
// File support is read-only for now. The NO_LOCALIZED_COLLATORS flag means the database doesn't have Android metadata (i.e. vanilla)
TiFileProxy tiFile = (TiFileProxy) file;
String absolutePath = tiFile.getBaseFile().getNativeFile().getAbsolutePath();
Log.d(TAG, "Opening database from filesystem: " + absolutePath);

SQLiteDatabase db = SQLiteDatabase.openDatabase(absolutePath, null, SQLiteDatabase.OPEN_READONLY | SQLiteDatabase.NO_LOCALIZED_COLLATORS);
SQLiteDatabase db = SQLiteDatabase.openDatabase(absolutePath, null, SQLiteDatabase.CREATE_IF_NECESSARY | SQLiteDatabase.NO_LOCALIZED_COLLATORS);
dbp = new TiDatabaseProxy(db);
} else {
String name = TiConvert.toString(file);
Expand Down