<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Posts about Iphone</title>
    <link>http://wiki.futuretoby.com/tag/iphone</link>
    <language>en-us</language>
    <item>
      <title>Making a Morning Checklist out of HTML</title>
      <description>&lt;p&gt;While &lt;a href="http://boingboing.net/2011/02/17/reduce-stress-by-mak.html"&gt;Mark Frauenfelder&#8217;s morning checklist&lt;/a&gt; was inspiring and relevant for me, the solution didn&#8217;t work for me because&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It does not save the trees!&lt;/li&gt;
&lt;li&gt;An iPhone would work better for me best because I always have it with me.&lt;/li&gt;
&lt;li&gt;It&#8217;s not made with HTML5.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So right. If you are an iOS hacker you&#8217;d probably reach for xcode right away, but for a task like this, it&#8217;s simply orders of magnitude faster to do using plain HTML. Let&#8217;s get started. First thing to do is fire up a text editor and type in your check list of a &lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt; of &lt;code&gt;&amp;lt;li&amp;gt;'s&lt;/code&gt; with &lt;code&gt;&amp;lt;input type="checkbox"&amp;gt;'s&lt;/code&gt; in each of them.&lt;/p&gt;

&lt;pre id="scroll_to_here"&gt;&lt;code&gt;&amp;lt;!doctype html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Morning Checklist&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;h1&amp;gt;Morning Checklist&amp;lt;/h1&amp;gt;
&amp;lt;ul&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;input type="checkbox"/&amp;gt;&amp;lt;label&amp;gt;Change&amp;lt;/label&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;input type="checkbox"/&amp;gt;&amp;lt;label&amp;gt;Contacts&amp;lt;/label&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;input type="checkbox"/&amp;gt;&amp;lt;label&amp;gt;Potty&amp;lt;/label&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;input type="checkbox"/&amp;gt;&amp;lt;label&amp;gt;Rinse Mouth&amp;lt;/label&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;input type="checkbox"/&amp;gt;&amp;lt;label&amp;gt;Laptop, wallet and keys&amp;lt;/label&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;input type="checkbox"/&amp;gt;&amp;lt;label&amp;gt;Shoes &amp;amp; Coat&amp;lt;/label&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;input type="checkbox"/&amp;gt;&amp;lt;label&amp;gt;Backpack&amp;lt;/label&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Cool, this is functional, but will look like this&lt;/p&gt;

&lt;p&gt;&lt;img src="https://lh4.googleusercontent.com/_1m4jxPGXQAo/TWhnnvP9iiI/AAAAAAAARj4/b9gqwJ0c_FQ/s800/step1.jpg" alt="Step 1" title=""&gt;&lt;/p&gt;

&lt;p&gt;Okay, that doesn&#8217;t look great. You&#8217;ll need to pinch zoom in order to see anything. What we need to do is to format the web page specifically for the iPhone screen. To do that, add this line inside of your &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;meta name="viewport"
content="width=device-width,
minimum-scale=1.0, maximum-scale=1.0" /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This will tell your iPhone to set the page&#8217;s viewport to exactly the same as the width of its screen, and also to disallow pinch to zoom. The result is this&lt;/p&gt;

&lt;p&gt;&lt;img src="https://lh3.googleusercontent.com/_1m4jxPGXQAo/TWhnn-s3IzI/AAAAAAAARj8/vpkjrADkLho/s800/step2.jpg" alt="Step 2" title=""&gt;&lt;/p&gt;

&lt;p&gt;Okay, nice! Now let&#8217;s make it look non-ugly with some CSS. First, change to the font to something san-serif. Take away the bullet points from the list items, remove the unnecessary margins and paddings. Make the font bigger and the checkboxes themselves bigger because we want them and each row to be big enough for Mr. Fatfinger. While we are at it, might as well stripe the rows, you can actually do it using just CSS in a non-crappy browser such as Mobile Safari. After some playing around, I added the following styles&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;style&amp;gt;
body{
    font-family: Helvetica, Arial, Verdana, sans-serif;
    padding: 0px;
    margin: 0px;
}

ul{
    list-style: none;
    padding: 0px;
    margin: 0px;
}

li{
    clear: left;
    font-size: 25px;
    padding: 3px 0px 3px 10px;
    margin: 0px;
}

li input{
    float: left;
    margin-right: 15px;
    width: 25px;
    height: 25px;
}

li:nth-child(even){
    background-color: #eee;
}

h1{
    font-size: 20px;
    padding: 0.2em 0.5em;
    border-bottom: solid 1px #aaa;
    background-color: #eee;
    margin: 0;
}
&amp;lt;/style&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;stick these inside the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; and now it looks like&lt;/p&gt;

&lt;p&gt;&lt;img src="https://lh3.googleusercontent.com/_1m4jxPGXQAo/TWhnoP8aroI/AAAAAAAARkA/FBDaVSG48To/s800/step3.jpg" alt="Step 3" title=""&gt;&lt;/p&gt;

&lt;p&gt;Great! Are we done? Well, there&#8217;s one usability problem: you have to click on the checkbox itself to check it. Id&#8217;d be nice if you could check it by click anywhere on the row. Let&#8217;s drop some Javascript on this&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;script&amp;gt;
Array.prototype.slice.call(document.getElementsByTagName('li'))
    .forEach(function(li){
        var cb = li.childNodes[0]
        cb.addEventListener('click', function(e){
            e.stopPropagation()
        })
        li.addEventListener('click', function(){
            cb.checked = !cb.checked
        }, false)
    })
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;em&gt;Note: if you see me writing some non-IE-compatible code that&#8217;s because I am only writing for the iPhone&lt;/em&gt;. Nice, now you can click anywhere on a row to check or uncheck the box. Are we done? Now let&#8217;s add it as a shortcut on your &lt;em&gt;Home Screen&lt;/em&gt;. To do that, click on the &lt;code&gt;+&lt;/code&gt; sign on the bottom middle of the screen, and tap on &lt;em&gt;Add to Home Screen&lt;/em&gt;. Edit the name of the button if you need to (I called it &lt;em&gt;Checklist&lt;/em&gt;), and tap &lt;em&gt;Add&lt;/em&gt;. Now you&#8217;ll get &lt;/p&gt;

&lt;p&gt;&lt;img src="https://lh4.googleusercontent.com/_1m4jxPGXQAo/TWhnoVMKFzI/AAAAAAAARkE/op1sFnwlFbE/s800/Home%20Screen.jpg" alt="Home Screen" title=""&gt;&lt;/p&gt;

&lt;p&gt;If you tap on it, the checklist opens right up. But, it&#8217;d be nice to get rid of the browser chrome and buttons, that way we have less clutter and it also looks more like a real app. To do this, stick this&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;meta name="apple-mobile-web-app-capable" content="yes" /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;into your &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;. Unfortunately, you&#8217;ll have to re-create your Home Screen button, so delete it and go back and create again. Now, when you tab on it you&#8217;ll get&lt;/p&gt;

&lt;p&gt;&lt;img src="https://lh4.googleusercontent.com/_1m4jxPGXQAo/TWhnooLNoyI/AAAAAAAARkI/wRxrwMETcB4/s800/step4.jpg" alt="Step 4" title=""&gt;&lt;/p&gt;

&lt;p&gt;Great, we are almost done! One more thing though. Now that we are serving the checklist from a web server, if it goes down or we lose our internet connection, we won&#8217;t be able to access it. Granted this will be rare since I&#8217;ll be at home when using this, but it can happen. So we use HTML5&#8217;s &lt;code&gt;applicationCache&lt;/code&gt; to make this page offline capable. To do this, we&#8217;ll make a cache manifest file and point our HTML page to it. First, in the &lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt;
tag of the file add the &lt;code&gt;manifest&lt;/code&gt; attribute like so&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;html manifest="/cache.manifest"&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Next, create the &lt;code&gt;cache.manifest&lt;/code&gt; file in the same directory. With the following content.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;CACHE MANIFEST
index.html
# version 1
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;the cache manifest is in a simple text format that lists all the resources that this page depends on. Our checklist only has one file. Also, we put a version number there in comments because the next time you&#8217;d want to change the checklist, in order for the browser to update the file in its cache, you&#8217;ll have to change the content of the cache manifest - so we&#8217;ll just update the version number when that happens. Next, there&#8217;s one more thing you have to do: in order for the browser to recognize the cache manifest as such, your web server must send with it a special header &lt;code&gt;text/cache-manifest&lt;/code&gt;. If you or your web host is using Apache you can simply put the following line&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;AddType text/cache-manifest .manifest
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;inside the &lt;code&gt;.htaccess&lt;/code&gt; file in the same directory - create it if it&#8217;s not there. There, try refreshing the page now. And then, to test offline mode, set your phone into Airplane mode, and then refresh the page again, it should still work.&lt;/p&gt;

&lt;p&gt;There we have it. We built a checklist application for the iPhone using just HTML.&lt;/p&gt;</description>
      <pubDate>Fri, 25 Feb 2011 20:42:49 -0600</pubDate>
      <guid>http://wiki.futuretoby.com/Making_a_Morning_Checklist_out_of_HTML</guid>
      <author>toby ho</author>
      <link>http://wiki.futuretoby.com/Making_a_Morning_Checklist_out_of_HTML</link>
    </item>
    <item>
      <title>Tablets are the way of the future</title>
      <description>After watching some old &lt;a href="http://video.google.com/videosearch?q=alan+kay&amp;amp;ie=UTF-8&amp;amp;oe=utf-8&amp;amp;rls=org.mozilla:en-US:official&amp;amp;client=firefox-a&amp;amp;um=1&amp;amp;sa=N&amp;amp;tab=iv" mce_href="http://video.google.com/videosearch?q=alan+kay&amp;amp;ie=UTF-8&amp;amp;oe=utf-8&amp;amp;rls=org.mozilla:en-US:official&amp;amp;client=firefox-a&amp;amp;um=1&amp;amp;sa=N&amp;amp;tab=iv"&gt;Alan Kay videos&lt;/a&gt;, I started thinking about modeless interfaces and tablet PC's. I think that the tablet PC has been largely under-appreciated, but is a form factor that has a lot of potential. The reason that it was under-appreciated, in my opinion, is - at least partly - because of the software. The operating system on most of the tablet PCs in the market is windows, but the version of windows installed on the machines is not any different from any other windows. Aside from some duck-tape-like software to allow for hand writting recogition and a few other features, there's really very little work that's been put into making the software working great with the form factor. With the hype of multi-touch screens, I think conditions are ripe for a comeback for tablets if the right things happen. Apple has the best chance of making it work: doing with tablets what they did with mobile phones, plus they already have multitouch technology on their side, so it's a natural match.&lt;br&gt;&lt;br&gt;Now, why tablets? How did I settle on that? I guess it started with a &lt;a href="http://video.google.com/videoplay?docid=-533537336174204822&amp;amp;q=alan+kay&amp;amp;total=427&amp;amp;start=0&amp;amp;num=10&amp;amp;so=0&amp;amp;type=search&amp;amp;plindex=1"&gt;video &lt;/a&gt;Kay show of a modeless interactive system which uses a stylus. It was some sort of flow-chart editor. The main thing is that it was modeless. To create a box, you didn't have to go and select the box tool, no, you just draw a box in the shape of a rectangle. And to make a port on the box, you just draw it on the edge of the box. To write text in the box you just scribble it. To connect 2 boxes you just draw a line from the edge on one to a edge of another. Why don't we have more interfaces like this today? In photoshop, in order to do anything at all, you usually have to be aware of being in a combination of at least 3 different kinds of modes: your selection, your tool selection, and the current layer. Plus, with many of the actions you take, modal dialogs popup afterwards to asks you for parameters you want before anything actually happens. This is why doing anything in Photoshop &lt;i&gt;feels&lt;/i&gt; like such a hassle. Well, okay, that's more of a user interface issue than about the tablet, but that's what inspired it. What's special about the tablet form factor, I think, is that the stylus gives you better control of fine movements than the mouse, and therefore allows you to draw more accurate shapes, which allows you to better articulate what you mean to the machine, with which programs can better detect gestures. That's why graphic artists prefer tablets to regular laptops, after all. You may have concerns that using a stylus freehand tires your wrist, but there's no reason why you cannot rest your palm on the surface: in fact I tried out the HP tablets at Fry's the other day and resting your palm while writting does not interfere at all. The second thing that's major about the tablet form factor is the emergence of multi-touch. There isn't a major multi-touch tablet in the market today, but Apple already has the iphone and the Macboox Air - which allows you to use iphone-like gestures on the touchpad. If you haven't played with the iphone, the multi-touch hand gestures like swipe, flick, pinch, and spread, are phenomnonal in terms of user-happiness. These gestures are intuitive, easy to use, immersive, and...&lt;i&gt;modeless&lt;/i&gt;. Many iphone users have complained after going back to their macbook, that they can't use these gestures anymore. It's pretty obivious now that macbooks from now on will all have multi-touch enabled touch pads. Now, you might ask me, you like the stylus, and then you are talking about multi-touch, are we going to use the stylus or our fingers? I am just saying...we use both. In fact, one hand could be using the stylus while the other could be making gestures. Imagine, for example, editing a long document using the stylus like a pen, and swiping with the other hand to scroll the document. Now, you may object and say: you still need a keyboard. Well, I agree, and the reason is that you can type faster with a keyboard than you can write with a pen. But, with the asterisk that this is not the case with everyone, only people who can type well. If you can't type faster than you can write, then you don't need a keyboard at all! Wow! Then all you need is a giant size touch-screen. But for touch typists, yes, you will need a keyboard, otherwise you will be sacreficing a lot of speed. I don't know, will this be a slide out, or a fold up? Not really sure. What about one handed keyboard? I personally have a thing for one-handed keyboards.&lt;br&gt;&lt;br&gt;Anyway, that's my vision of the future, and I think Apple obiviously stands the best chance of making it happen, but personally I don't really care who does it. Will it happen? Well, I &lt;i&gt;was &lt;/i&gt;right about the iphone before, so...</description>
      <pubDate>Thu, 07 Feb 2008 18:02:50 -0600</pubDate>
      <guid>http://wiki.futuretoby.com/Tablets_are_the_way_of_the_future</guid>
      <author>toby ho</author>
      <link>http://wiki.futuretoby.com/Tablets_are_the_way_of_the_future</link>
    </item>
  </channel>
</rss>

