Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1D822F60E for ; Tue, 6 Aug 2013 07:14:53 +0000 (UTC) Received: (qmail 14251 invoked by uid 500); 6 Aug 2013 07:14:51 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 14184 invoked by uid 500); 6 Aug 2013 07:14:50 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 14161 invoked by uid 99); 6 Aug 2013 07:14:47 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Aug 2013 07:14:47 +0000 Date: Tue, 6 Aug 2013 07:14:47 +0000 (UTC) From: "Shingo Toda (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CB-4506) Storage plugin does not handle data type properly 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-4506?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Shingo Toda updated CB-4506: ---------------------------- Description: I'm using Cordova 2.9.0. In my understanding, when window.openDatabase() is called, if SECURITY_ERR is returned then Storage plugin is used, otherwise browser's WebSQL is used. Actually my mobile phone doesn't support WebSQL so Storage plugin is selected, but it seems that all of fetched data from database is converted into String even if it is other data type such as INTEGER, FLOAT. The following line in Storage#processResults() converts all data into String. All column value is collected by Cursor#getString(). (code:title=Storage#processResult) String key = ""; String value = ""; // Build up JSON result object for each row do { JSONObject row = new JSONObject(); try { for (int i = 0; i < colCount; ++i) { key = cur.getColumnName(i); value = cur.getString(i); row.put(key, value); } fullresult.put(row); } catch (JSONException e) { e.printStackTrace(); } } while (cur.moveToNext()); (code) Since type check methods are provided such as Cursor#getType() (>=HoneyComb) or AbstractWindowedCursor#isLong/String/Float() (=HoneyComb) or AbstractWindowedCursor#isLong/String/Float() ( Storage plugin does not handle data type properly > ------------------------------------------------- > > Key: CB-4506 > URL: https://issues.apache.org/jira/browse/CB-4506 > Project: Apache Cordova > Issue Type: Bug > Components: Android > Affects Versions: 2.9.0 > Environment: Android 2.3.x, 3.x, 4.x on emulator > Android 4.x on physical device > Reporter: Shingo Toda > Assignee: Joe Bowser > Priority: Minor > > I'm using Cordova 2.9.0. > In my understanding, when window.openDatabase() is called, if SECURITY_ERR is returned then Storage plugin is used, otherwise browser's WebSQL is used. > Actually my mobile phone doesn't support WebSQL so Storage plugin is selected, but it seems that all of fetched data from database is converted into String even if it is other data type such as INTEGER, FLOAT. > The following line in Storage#processResults() converts all data into String. All column value is collected by Cursor#getString(). > (code:title=Storage#processResult) > String key = ""; > String value = ""; > // Build up JSON result object for each row > do { > JSONObject row = new JSONObject(); > try { > for (int i = 0; i < colCount; ++i) { > key = cur.getColumnName(i); > value = cur.getString(i); > row.put(key, value); > } > fullresult.put(row); > } catch (JSONException e) { > e.printStackTrace(); > } > } while (cur.moveToNext()); > (code) > Since type check methods are provided such as Cursor#getType() (>=HoneyComb) or AbstractWindowedCursor#isLong/String/Float() (