GitHub Issue | n/a |
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-08-15T23:34:28.000+0000 |
Affected Version/s | Release 2.1.4, Release 3.0.0 |
Fix Version/s | Release 3.1.0, 2013 Sprint 04 Core, 2013 Sprint 04 |
Components | Android |
Labels | module_webview, qe-manualtest, triage |
Reporter | Brian Burgess |
Assignee | Sunila |
Created | 2012-11-30T13:44:57.000+0000 |
Updated | 2014-08-15T23:34:28.000+0000 |
*Problem description*
LocalStorage in the webview component on Android is not persisting data across app sessions when loading the HTML and related files as local resources. This is not consistent with iOS webview.
*Suggestion*
Seems like adding a 'WebSettings' property to the WebView to allow the settings of 'DomStorageEnabled' and 'DatabasePath' would do the trick simply enough.
*Test case*
See attachment.
Could you put together a test case for this? Thanks.
was my test case not enough?
I included a test case project in a zip file as a response to your email generated by your first comment. I figured that was easiest since it involved HTML5 in a webview on a titanium app.
Also, I forgot to add that I did research this in Q&A first .. as well as posting my own Q&A question at: http://developer.appcelerator.com/question/145236/android-webview-localstorage
Hmm odd, I can't see a zip attachment. I've re-opened the issue. Could you try uploading again? Cheers.
Did the localStorageTest.zip come across?
Am I right in assuming that you replied to the email generated by JIRA? If so, then that wouldn't have come through, no. You need to upload it on the issue page itself through More Actions -> Attach Files.
ah I finally found the place to upload attachments. DOHH! My apologies for being so dense. -B
I found it under Edit .. before I had only seen 'Create Sub-task' and 'Clone' in 'More Actions' :-S anyway .. is done .. finally. Thx -B
Tested and confirmed on Android Samsung Galaxy S2 2.3.6 with TiSDK 2.1.4 GA and 3.0 RC. Does not persist the values when you kill the app. Works as expected in iOS 6 simulator.
Set the properties DatabaseEnabled and DatabasePath on WebSettings to enable local storage. Tested in device and in emulator.
Test steps: 1. Launch the app 2. Type in 'pizza' for value, and 'food' for name 3. Click on the 'setItem' button 4. Close the app completely (on 4.X devices, you can do this by using the recent app button, and swipe to the left to remove it. Otherwise, you will need to go to Settings > Applications > Manage Applications > localStorageTest > Force Stop) 5. Relaunch the app and verify that the food item is in the items list. Expected Result: The food item should be on the item list after relaunch Actual Result: The food item is not on the list
PR: https://github.com/appcelerator/titanium_mobile/pull/3854
Localstorage is persistent. Verified on : device : google nexus, android version :4.1 SDK version: 3.1.0.v20130220200300 CLI version : 3.0.24 OS : MAC OSX 10.7.5 XCode : 4.5.1