Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: localStorage on Android not persisit

  1. #1

    Question localStorage on Android not persisit

    I use localStorage proxy store for my application.
    I develop it in Safari 5.05, everything works normaly. I packaging aplication with Sencha SDK Tools. when I test package on iOS emuator, data, which I save to local storage are persist after restart application, but in Android Emulator are lost after stop and start my application. I try save local data with
    native function window.localStorage.setItem(key, value) and result is same.

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448
    Answers
    3997

    Default

    Have you then tried on an Android device? Is it just an issue with the emulator not saving device state.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  3. #3

    Default test on device

    Yes, I test application on HTC Wilfdfire with android 2.3. HTML localStorage working on this device, but after stop/start application lost stored data

  4. #4
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448
    Answers
    3997

    Default

    Then the emulator clears it on stop.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  5. #5

    Default test on device

    I thing that no. Results on emulator and device is same.

  6. #6
    Sencha User
    Join Date
    Dec 2011
    Posts
    48
    Answers
    3

    Default

    I'm having the same problem (Android 2.3)
    When running the application in the android browser, everything works fine.

    When packaging with "sencha app build native" the .apk gets build fine.
    When installing on the device, localstorage is not working

  7. #7
    Sencha User
    Join Date
    Jan 2012
    Posts
    48

    Default

    Same issue here.

    localStorage is not "not working", it is not persistent.
    It seems that the localStorage is reset everytime we start the application.

    In that case, how can we store data on the device?

    Or maybe is it because I am using sensa-touch-debug.js in the apk (I didn't build the jsb3 and classes)?

  8. #8
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448
    Answers
    3997

    Default

    Sencha Touch is not going to clear local storage, that would be terribly stupid of us to do so of course we aren't going to.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  9. #9
    Sencha User
    Join Date
    Jan 2012
    Posts
    48

    Question

    That doesn't tell us why the localStorage is cleared every time we re-launched the application and how to avoid it.

    I store username/password into the local storage, and auto-login at start-up if found, but after packaging it and deploying to the device, the localStorage is always empty when starting the application.
    It works fine on local browser of course (and probably on the android's browser but I want a standalone application).

    Any help?

  10. #10
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448
    Answers
    3997

    Default

    If we're not doing it then the only other person that may be doing it is Android. If Android is doing it then there may not be much you can do. There isn't a setting you can set unless Android provides one which I have not heard of any.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •