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 74C3E10E3F for ; Thu, 20 Feb 2014 21:58:22 +0000 (UTC) Received: (qmail 18975 invoked by uid 500); 20 Feb 2014 21:57:54 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 18800 invoked by uid 500); 20 Feb 2014 21:57:46 -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 18318 invoked by uid 99); 20 Feb 2014 21:57:30 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Feb 2014 21:57:30 +0000 Date: Thu, 20 Feb 2014 21:57:30 +0000 (UTC) From: "Joe Bowser (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-6033) Android 4.4 update loses LocalStorage data 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-6033?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13907584#comment-13907584 ] Joe Bowser commented on CB-6033: -------------------------------- There is something that we can do. I put this code both in CordovaActivity and CordovaWebView's initialization: {code:title=Bar.java|borderStyle=solid} private void kkDatabaseUpdate(String appDatabase) { //Check for legacy database. String DB_BASE_PATH = appDatabase + "/localstorage"; //Move file for legacy database to another directory! //File sdCard = Environment.getExternalStorageDirectory(); File localStorage = new File(DB_BASE_PATH); File[] contents = localStorage.listFiles(); Log.d(TAG, "Checking directory for existing files"); if(contents != null) { for ( File f : contents) { Log.d(TAG, f.getAbsolutePath()); } } } {code} This in theory should show every database in the localStorage directory. Then I used mobile-spec to create the database, then did the OTA update. It seems that the file exists until we initialize the WebView. Therefore, it should be possible to do the temporary backup on the activity and then look for the backup on the WebView itself and copy the files back into where they're supposed to be. I don't know if this mixing and matching will screw with the webview or not, since I don't know what the differences are between the two SQLite datastores. > Android 4.4 update loses LocalStorage data > ------------------------------------------ > > Key: CB-6033 > URL: https://issues.apache.org/jira/browse/CB-6033 > Project: Apache Cordova > Issue Type: Bug > Components: Android > Reporter: Darryl Pogue > Assignee: Joe Bowser > > This appears to be a result of the switch from old WebView to the new Chrome-powered WebView. > If an app is installed in 4.3 and saves data to LocalStorage (and possibly to WebSQL) and then the device is updated to 4.4, that data appears to be lost. > Some threads regarding the problem: > http://www.sencha.com/forum/showthread.php?278158-localStorage-cleared-when-upgrading-to-KitKat-(Android-4.4) > https://groups.google.com/forum/#!msg/phonegap/rNizMKW5GaA/g1XBBco2otMJ -- This message was sent by Atlassian JIRA (v6.1.5#6160)