How can I store more than 5 MB on an iPhone web app? - iphone

I am working on a magazine/portfolio application that is intended to be readable offline, saved as an icon on the home page.
This is using a lot of images, but while I can keep the images down to a respectable size (200 KB or less, with alterations for iPhone vs iPad) the amount for the page surpasses the 5 MB limit for a web app cache.
I have tried the cache manifest, but if the device is turned off or I clear the cache (which I do a lot while developing) the information is gone forever (and does not get resaved if I visit the bookmarked site while online again).
I am exploring the use of base64 to store the smaller icons in a CSS file, but am not sure about how to build a local storage database for the other information (backgrounds, images, text, etc) that will be persistent without being tied to the Safari cache.
Is this even possible?
(The project is intended to be an open source publishing engine, so more people can create digital 'zines for the iPad.)

you can't...
if you are limiting your application to a web application on the iphone, then your options are limited to what is provided on the device. I believe sqlitedb with mobile safari is limited to 5MB.
You can look into technology like PhoneGap which provides a wrapper around HTML5 web based applications on multiple platforms. This wrapper will give you access to the native device and then you could store additional data on the device in flat files on the native database without the 5MB limit

Related

Best way to store large data clientside in an gwt offline application?

We have written an Vaadin7/GWT application where the user can select multiple images and upload them. The application works offline, so we want to store the images clientside and only upload them when the user is pressing the sync button. The clue is that we want to keep the selected images, even when the user is closing the Tab/Browser. The clientside storage should also work with mobile browsers (Android and iOS)
We have found the following possibilities to store data on the client
Session Storage is killed when the tab/browser is closed. Not suited for our case.
Local Storage is limited to 5MB which is not enough. Is there a way to extend that limit?
IndexedDB does not work on IOS devices (http://caniuse.com/indexeddb)
WebSQL does work on IOS and Android devices (http://caniuse.com/sql-storage) but is deprecated
So the question are. Does anyone know a good Frameworks in conjunction with gwt? Which storage type/DB would you prefer and why? Or even more general, how would you solve the Problem?
Thanks for any advice, suggestion or experiences you had.
Unfortunately, there is no magic solution for all operating systems/browsers. I believe that you your only option for large objects is to build native apps for each platform that use a web browser for their client.

How can I store more that 5MB in HTML 5 local storage

I need to write an app to run on iPhone, iPad, Android phones & tablets. WinPhone 7 and desktop browsers would also be nice, but not necessary. I'm a desktop/Silverlight developer, but it seems this is a job for HTML 5 & javascript. Right?
I'm looking at Sencha touch, jquery, and amplify.js to simplify my life. My app has to be available in app stores, so I'm looking at PhoneGap to help with that.
The app needs to work offline which means I have need for local storage of about 10 megs. I don't know how to deal with this requirement because all the local storage options seem to top off at 5 megs.
Any ideas about how to deal with this? (Or any suggestions as to a better approach or libraries?)
I would try your best to get your app down to less than 5 Mb. This means perhaps compression of some sort before locally storing, perhaps only having the essential features available offline, and optimizing your data such that you can reduce any redundancy. Even after all of this, you are still dependent on whether or not the user's browser allows local storage, and whether it allows 5 Mb of it.
As per an answer on a question earlier today, the Web SQL Database spec is your friend here, at least on iOS 4.3

A caching solution for iPhone application

What I'm building is simply an application that fetches data over the web and displays them on the iOS views. Data are text and, sometimes, images / music files / movies.
I'd like to use some caching solution for the media. What it needs to do is:
get an url of the file
check if it's alredy downloaded in the cache storage, if it is, serve it
if not, download it
while also checking how much of the storage the current cache uses, and, if it's over the quota, delete oldest files
Best would be to have a simple interface for this - so I can just give an url and get the file of it (while files can change over time and reside on the same URL, so this should be handled too, in a perfect case).
Anyone knows a library to do it, on iPhone/iPad application?
ASIHttpRequest has a DownloadCache option that may work for you. From their documentation:
* You want to have access to the data when there is no internet connection and you can't download it again
* You want to download something only if it has changed since you last downloaded it
* The content you are working with will never change, so you only want to download it once
This is what I used in my iPad app and it works pretty well.
You could try looking at using a UIWebview for the view. If I am understanding this correctly, you will be hosting your content on a web server and would simply like the iOS device to pull the content from the URL. This is what UIWebview is. It is essentially programmable access to Safari.

Single web app for all device?

When i create web app for all mobile devices, what are all things need to follow,
Is it enough to create single html app for all device?
Or, create every single app for a device based on web browser?
Is there any Framework has overcome above mentioned issues?
Thanks in advance,
sri
No - different phone browser have different levels of HTML compliance. Compare iPhone/Android browser with, say, a 3 year old Nokia phone (that most corporate users probably have to use)
No - there are far too many browser/device/operator combinations for you to write individual web apps. This is known as the mobile web fragmentation problem.
Luckily yes - have a look at http://wurfl.sourceforge.net/ or http://deviceatlas.com/. These frameworks let you write one web app (within some limits). These frameworks will recognise the browser (through the User Agent) and output the most appropriate HTML for that device. They can also deal with issues like resizing images for lower end devices.
You need to be aware of the screen size as i think it's bad form to have to scroll left and right as well as up and down.
also, keep the page sizes small as your page may not be the only one open so you want to give users the ability to open more than a single page. also helps in speed and keeping the cost for the user down.
remember to have text size at a readable scale as mobiles are used not only stationary but also when in motion and being bumped around.

Safari Cache size for iPhone 3.0

Various sites on the internet claims that Safari cache on iPhone 2.2 is 25k and 19 objects. Does anyone know what is the cache size for Safari/webview on iPhone 3.0.
specially if you use the client side storage or a cache manifest, you can store much more data
Client application storage is different than the Safari's own cache, to which the original poster was referring. We know that in 2.2, Safari can store 19 objects each up to 25K in size. What are the new numbers for 3.0+? The posted link/pdf doesn't seem to have the answer.
hmm... as far as i'm aware of, the cache size since version 2.2 is much larger.
specially if you use the client side storage or a cache manifest, you can store much more data.
how to store values clientside can be read here
Apple developer Connection
PDF version