Results 1 to 6 of 6

Thread: How to do local storage and transfer on network available in ST2?

  1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    7
    Vote Rating
    1
      0  

    Question Unanswered: How to do local storage and transfer on network available in ST2?

    Hi,

    I have just discovered Sencha Touch 2 and would like to build some demos for my colleagues.

    I am familiar with HTML5 and JavaScript and have web forms which save data locally (in localstorage) and transfer to a server on request or when a network is present.

    I would like to try to achieve this on Android and iPhone using ST2. I've seen some local storage proxy code but have not come across network tools so far.

    I appreciate there is a lot of online documentation and demos but I need to focus on this specific requirement and can only sneak limited time so would appreciate any pointers.

    Thanks.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,323
    Answers
    3884
    Vote Rating
    1294
      0  

    Default

    You need to have two stores, an online one and an offline one.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    7
    Vote Rating
    1
      0  

    Default

    Quote Originally Posted by mitchellsimoens View Post
    You need to have two stores, an online one and an offline one.
    Sure, I have an online store (webserver).

    Are there tools in ST to talk to a webserver and send the data, or do I use another library or write some JavaScript?
    Last edited by brookhouse; 22 Feb 2012 at 8:27 AM. Reason: typo

  4. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,323
    Answers
    3884
    Vote Rating
    1294
      0  

    Default

    Of course, there are other proxies you can use on a store like ajax or jsonp that do remote data.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  5. #5
    Sencha User
    Join Date
    Feb 2012
    Posts
    7
    Vote Rating
    1
      0  

    Default Does the data upload have to be in the same webapp as the data gathering?

    I'd like the users to enter data into forms and have it store locally.

    At the end of the data gathering exercise, I'd like the researcher to be able to upload the data to a server (and when successful remove from the device).

    So that the end-user does not see the upload option I'd like to have a second app - on the same domain - access the local store and upload.

    However, when I have tried this with HTML5 and JavaScript on an iPhone this breaks as soon as <meta name="apple-mobile-web-app-capable" content="yes" /> is used and the icon is saved to the home screen.

    Would that be true of ST2 webapps also?

    Thanks.

  6. #6
    Sencha Premium Member
    Join Date
    Jan 2012
    Location
    London, UK
    Posts
    587
    Answers
    25
    Vote Rating
    88
      0  

    Default

    Everything you've said is possible in ST2. I think the best idea would just be to get stuck in with touch 2, generate a new app and see what problems you come up against. There's loads of tutorials and guides included in the download. Touch 2 will add the necessary meta tags without breaking the app.

Tags for this Thread

Posting Permissions

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