Touchkit, offline, hundrets of images

Hi,

the last two days I tried to figure out if it is technically possible to persist hundrets of images (hundrets of Megs) data locally in the webbrowser (WebStore, IndexDB, WebSQL).

  • WebStore is to small (max 5 MB)
  • IndexDB is not supported on iOS devices
  • WebSQL is deprecated

I also found the HTML 5 File API, but it is deprecated, too.

Is there any other solution (maybe already implemented in TouchKit?) to create a offline app which can take hundrets of images which are synced with the backend as soon the mobile device has web access?

Any hint is appreciated,
Christoph

The best option would probably be ApplicationCache. As far as I know, iOS limits it to 50 MB, so it’s not perfect, but there’s not much else you can do. Another option would be wrapping your app in Cordova and using the native APIs to store your data.

Hi Juho,

thanks for your reply.

Is there any documentation how to wrap an Touchkit application with Cordova and how to use the Cordova API with Vaadin?

What about the deprecated HTML5 Filesystem API? Won’t Cordova use this?

Regards,
Christoph

The wrapping part shouldn’t be in any way Vaadin specific, so you can refer to the Corova docs for that. As for using the API from Vaadin, there are a couple of things you need to do:

  1. Include the cordova.js file of your Cordova version in your Vaadin app.
  2. Implement GWT versions of the API calls you need using JSNI

If you haven’t written client-side code for Vaadin before,
part III of BoV
will get you started. Finally, for anything missing from the book, refer to GWT documentation and the Vaadin javadocs.

Hi. I’m currently working on online/offline project and i think that storing many pictures by web app isn’t good idea. If you want store large items or many items which will take large space you probably need to consider creating native apps.

But cordova or phoneGap will be solution for your problem.

Hi Juho, hi Mário,

thanks for your replies.

We are thinking about creating native apps (due to the maybe large number of images), unfortunately we need the app for multiple platforms.

If you have fun with new software and either way have no IOS/android expert in house you could have a look at http://haxe.org/

Hi Wolfgang,

thanks for your input. Haxe looks like an interesting technology but having a completely new technology in the project (a complex Vaadin application already exists) seems not to be constructive.

Currently we are researching creating native apps and using the Vaadin + Cordova approach.

I’ll keep you informed here how we decided.

Regards,
Christoph