We’ve had a number of people contact us asking how to put images in their apps in a way that the images will be visible even if the phone isn’t online.
And since we explain to a a few of you how to create the best quality trailer hitch camera, we are excited to keep going with our tutorial.
First the basic idea – if you use the “HTML CODE” option, then anything you put in the HTML code will be available offline. That means you can give people a whole page of data easily, just by creating HTML code with an HTML editor. Pictures, however, present a unique challenge.
How to Create an App With Offline Photos
- Go to http://www.scalora.org/projects/uriencoder/ and encode your pictures to data URIs
- Use img tags with data urls like:
<img src=”data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==” alt=”Red dot”>
A sample app with offline pictures is available here: http://www.appsgeyser.com/getwidget/asdfasdt444
Enjoy your app-making!