Is it Possible to have Database for mobile Web applications?

You must Login before you can answer or comment on any questions.

Am developing an application which will work for Android, iPhone and mobile web. I need to access data from Sqlite tables. but it is observed that Titanium doesnot have support for mobile web. Is there any other workarounds to store data and access for mobileweb applications...?

Please help me out...

— asked 10 months ago by Nagarjuna Bollam
2 Comments
  • I don't believe that you can use a database with MobileWeb. It only applies to native applications. You can use something like ACS to hold you data.

    — commented 10 months ago by Ray Belisle

  • I am also facing the same issue..

    — commented 10 months ago by snigdha nooli

1 Answer

Titanium Mobile Web does not and never will support Ti.Database. The Web SQL DB spec is deprecated and isn't implemented for some browsers like Firefox. Furthermore, Ti.Database is synchronous whereas Web SQL DB is asynchronous only (unless using from a Web Worker, which is async).

Your options for storing data client side are Ti.App.Properties and Ti.FileSystem... both of which use the browser's local storage mechanism which has a 5MB limit on most devices.

I've created a ticket to fix Mobile Web's Ti.Filesystem so that the temp directory uses session storage instead of local storage, which doesn't appear to have any storage limits. The ticket is here: https://jira.appcelerator.org/browse/TIMOB-10287.

If your application is able to store data in the cloud or server side, then you could use ACS or use Ti.Network.HTTPClient to talk to your server where you can store data in MySQL or whatever database you prefer.

— answered 10 months ago by Chris Barber
answer permalink
2 Comments
  • Cant you just use HTML5 Database locally for storage?

    — commented 10 months ago by Aaron Saunders

  • Which "HTML5 Database" are you referring to? We are already using local storage. We can't use Web SQL DB or IndexedDB because of browser support and both APIs are async. The only other client-side storage mechanism that I know that can hold more than 4KB is embedding a Flash-based solution, which wouldn't work on iOS or new Androids.

    — commented 10 months ago by Chris Barber

Your Answer

Think you can help? Login to answer this question!