{"id":1126,"date":"2011-03-02T17:38:10","date_gmt":"2011-03-02T09:38:10","guid":{"rendered":"http:\/\/www.tzlee.com\/blog\/?p=1126"},"modified":"2011-03-02T17:39:15","modified_gmt":"2011-03-02T09:39:15","slug":"offline-html-mobile-apps","status":"publish","type":"post","link":"https:\/\/tzlee.com\/blog\/2011\/03\/offline-html-mobile-apps\/","title":{"rendered":"Offline HTML Mobile Apps"},"content":{"rendered":"<p>Picking up iOS is quite a bit of work plus you need to buy a Mac to get Xcode running.<\/p>\n<p><em>Yes I know you Hackintosh folks are going to start making some noise but let&#8217;s keep this legal.<\/em><\/p>\n<p>So I&#8217;ve decided to build quick apps using <a href=\"http:\/\/jqtouch.com\/\">jQTouch<\/a>.<\/p>\n<p>To get an App icon on your home screen, simply&#8230; add the page to your home screen! Duh. It&#8217;s like adding a bookmark. Try it &#8211; it works!<\/p>\n<p>But here&#8217;s the next problem &#8211; how do we get the apps to work without network connectivity?<\/p>\n<p>HTML5 introduced something called the offline cache manifest. Here&#8217;s how to use it&#8230;<\/p>\n<p><strong>Step 1<\/strong> &#8211; Create a file called yourfilename.manifest with the following content<\/p>\n<blockquote><p><code>CACHE MAINFEST<br \/>\ndemos\/main\/ajax.html<br \/>\ndemos\/main\/ajax_post.php<br \/>\ndemos\/main\/index.html<br \/>\ndemos\/main\/jqt_startup.png<br \/>\ndemos\/main\/jqtouch.png<br \/>\njqtouch\/jqtouch.min.css<br \/>\njqtouch\/jqtouch.min.js<br \/>\njqtouch\/jquery.1.3.2.min.js<br \/>\nthemes\/jqt\/img\/back_button.png<br \/>\nthemes\/jqt\/img\/back_button_clicked.png<br \/>\nthemes\/jqt\/img\/button.png<br \/>\nthemes\/jqt\/img\/button_clicked.png<br \/>\nthemes\/jqt\/img\/chevron.png<br \/>\nthemes\/jqt\/img\/chevron_circle.png<br \/>\nthemes\/jqt\/img\/grayButton.png<br \/>\nthemes\/jqt\/img\/loading.gif<br \/>\nthemes\/jqt\/img\/on_off.png<br \/>\nthemes\/jqt\/img\/rowhead.png<br \/>\nthemes\/jqt\/img\/toggle.png<br \/>\nthemes\/jqt\/img\/toggleOn.png<br \/>\nthemes\/jqt\/img\/toolbar.png<br \/>\nthemes\/jqt\/img\/whiteButton.png<br \/>\nthemes\/jqt\/theme.min.css<br \/>\nsome\/other\/file.name<br \/>\n<\/code><\/p><\/blockquote>\n<p><strong>Step 2<\/strong> &#8211; Make sure your web server reports the MIME type correctly by adding the following config to Apache. You might need to contact your hosting provider to get this done.<\/p>\n<blockquote><p><code>AddType text\/cache-manifest .manifest<br \/>\n<\/code><\/p><\/blockquote>\n<p><strong>Step 3<\/strong> &#8211; Add the following tag to your HTML page so the browser knows where to find the manifest.<\/p>\n<blockquote><p><code>&lt;html manifest=\"yourfilename.manifest\"&gt;<\/code><\/p><\/blockquote>\n<p>That&#8217;s it!<\/p>\n<p>Original reference material <a href=\"http:\/\/code.google.com\/p\/jqtouch\/wiki\/OfflineSupport\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Picking up iOS is quite a bit of work plus you need to buy a Mac to get Xcode running. Yes I know you Hackintosh folks are going to start making some noise but let&#8217;s keep this legal. So I&#8217;ve&#8230; <a class=\"more-link\" href=\"https:\/\/tzlee.com\/blog\/2011\/03\/offline-html-mobile-apps\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[8],"tags":[254,173,13,253,255],"class_list":["post-1126","post","type-post","status-publish","format-standard","hentry","category-tech","tag-html5","tag-ipad","tag-iphone","tag-jqtouch","tag-offline-cache"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/posts\/1126","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/comments?post=1126"}],"version-history":[{"count":2,"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/posts\/1126\/revisions"}],"predecessor-version":[{"id":1128,"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/posts\/1126\/revisions\/1128"}],"wp:attachment":[{"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/media?parent=1126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/categories?post=1126"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/tags?post=1126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}