Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0A55CDB01 for ; Mon, 17 Sep 2012 23:37:08 +0000 (UTC) Received: (qmail 1303 invoked by uid 500); 17 Sep 2012 23:37:07 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 1284 invoked by uid 500); 17 Sep 2012 23:37:07 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 1275 invoked by uid 99); 17 Sep 2012 23:37:07 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Sep 2012 23:37:07 +0000 Date: Tue, 18 Sep 2012 10:37:07 +1100 (NCT) From: "Joe Bowser (JIRA)" To: callback-dev@incubator.apache.org Message-ID: <82691205.90342.1347925027749.JavaMail.jiratomcat@arcas> In-Reply-To: <1905813064.11515.1344019382470.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Resolved] (CB-1191) Load/create a database in SD card MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-1191?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Joe Bowser resolved CB-1191. ---------------------------- Resolution: Won't Fix This is possible on Android, but I think that this would be best done as a Cordova plugin. It's not really something that should be added to the core. > Load/create a database in SD card > --------------------------------- > > Key: CB-1191 > URL: https://issues.apache.org/jira/browse/CB-1191 > Project: Apache Cordova > Issue Type: Improvement > Components: Android, WP7 > Reporter: Samik R > Labels: android, ios, sqlite > Original Estimate: 48h > Remaining Estimate: 48h > > I would like to be able to access or create an SQLite database on SD card in android/WP7 or in the persistent storage in iOS. Currently I am working in Android, so I will limit the comments to Android for now. > Looking at the android code for openDatabase call in Storage.java, I see that if the path of the DB is null, it is set to app-path. But there is no way to set the path of the DB or pass it in the call. It seems like an easy fix: we need a call to set the path to a string, or accept a FileEntry object as the database in the same openDatabase call. > Here is the relevant part of the code: > (Accessed from https://github.com/apache/incubator-cordova-android > as file: apache-incubator-cordova-android-2.0.0-16-g81ab0a4.zip) > << > public void openDatabase(String db, String version, String display_name, > long size) { > // If database is open, then close it > if (this.myDb != null) { > this.myDb.close(); > } > // If no database path, generate from application package > if (this.path == null) { > this.path = this.cordova.getActivity().getApplicationContext().getDir("database", Context.MODE_PRIVATE).getPath(); > } > this.dbName = this.path + File.pathSeparator + db + ".db"; > this.myDb = SQLiteDatabase.openOrCreateDatabase(this.dbName, null); > } > >> > Please let me know if I am missing something. I am new to this stuff. > Thanks and regards. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira