Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8461810DD3 for ; Thu, 12 Feb 2015 21:08:25 +0000 (UTC) Received: (qmail 89484 invoked by uid 500); 12 Feb 2015 21:08:25 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 89449 invoked by uid 500); 12 Feb 2015 21:08:25 -0000 Mailing-List: contact dev-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 dev@cordova.apache.org Received: (qmail 89437 invoked by uid 99); 12 Feb 2015 21:08:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Feb 2015 21:08:25 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jbavari@gmail.com designates 209.85.214.178 as permitted sender) Received: from [209.85.214.178] (HELO mail-ob0-f178.google.com) (209.85.214.178) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Feb 2015 21:08:00 +0000 Received: by mail-ob0-f178.google.com with SMTP id uz6so12722069obc.9 for ; Thu, 12 Feb 2015 13:05:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=4pCxDG5Ygp/CoV9xMZ3UeTAvP6pXIE/eN8/weta0GH8=; b=VH7zsj1Yk7lT5H7gMhYU+pTQhizu3R/j74GIzSWUmQYiMfzc4qllaRf6sRVPP0gPJT YhRxVcGZTC93mueMNhTtPgsund9vpQCUgR9jj6iBvH0oeBx34o3HyEIm8x9ky6SP5yrR C3aNuwM07RxN9/AYQgT/fZw8rGJaGHgHuTh7uV+Doc+iv7OFZB7xYQ9VkrXuPwvOLQPN f2npVDx8ntee1Kh+PhziPoM91I+1mzF4jSTFiRf7SgbSeBcXhdwE2x4s6nicMrd9g7NQ 4CovSsIQNBNUdGty87NLIAd+TrqzlERcAh66pKAZ5qyF0ImUUf2pH2nvY1C8tnJeDtbg 9eiA== MIME-Version: 1.0 X-Received: by 10.182.153.66 with SMTP id ve2mr4173395obb.7.1423775143042; Thu, 12 Feb 2015 13:05:43 -0800 (PST) Received: by 10.76.60.230 with HTTP; Thu, 12 Feb 2015 13:05:42 -0800 (PST) In-Reply-To: References: Date: Thu, 12 Feb 2015 14:05:42 -0700 Message-ID: Subject: Re: Maintaining App Data When Switching WebViews From: Josh Bavari To: dev@cordova.apache.org Content-Type: multipart/alternative; boundary=089e0158b59aa42b0a050eea7b4a X-Virus-Checked: Checked by ClamAV on apache.org --089e0158b59aa42b0a050eea7b4a Content-Type: text/plain; charset=UTF-8 Andrew, Here at Ionic, we've had a few users request something like this. My approach has been to create a Cordova plugin, that takes the following steps: Creates an instance of the original webview Executes some JS inside the webview that will grab all entries for localstorage If Android pre KIT_KAT or more, executed JS calls a JSInterface to pass the data back to native land If KIT_KAT or greater, calls evaluateJavascript Those values are read, and passed back to the original webview >From there, it'd go through the keys, and add them into the new webview See this repo for my work in progress: https://github.com/driftyco/cordova-plugin-local-storage-retrieval On Thu, Feb 12, 2015 at 1:46 PM, Andrew Grieve wrote: > Worth a discussion about this, I think. > > If you have an app already launched that uses localstorage/websql, and want > to switch to xwalk, how can you migrate your data? > > What if you want to use system webview for API >= 21 and xwalk only for old > phones? Then you need to move data in the reverse direction. > > > Idea 1: > - See if sqlite / localstorage databases are the same format, and provide > code that migrates db locations > > Idea 2: > - Use wizcorp's multi-window plugin to create a new an off-screen system > webview, then use post-message to read data out of the old one. > > WDYT? Is this a problem we need to solve? > -- "Clear thoughts produce clear results." Josh Bavari Application Developer Phone: 405-509-9448 Cell: 405-812-0496 Email: jbavari@gmail.com --089e0158b59aa42b0a050eea7b4a--