<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7317370756743359832</id><updated>2012-02-15T23:51:26.868-08:00</updated><category term='webos phonegap email support forms'/><category term='webos phonegap orientation rtfm'/><category term='webos hp palm phonegap programming development'/><category term='phonegap html webos palm hp parameter passing keanu reeves'/><category term='phonegap webos palm hp functions touchpad'/><category term='webos phonegap iscroll4 inertial scrolling'/><title type='text'>webOScapades</title><subtitle type='html'>Adventures in HP webOS PhoneGap Development</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://weboscapades.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7317370756743359832/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://weboscapades.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ken Schreihofer</name><uri>http://www.blogger.com/profile/14556837503761841316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-Kp6kib7uBkw/Ti8tiVoa8zI/AAAAAAAAACI/u4cfKh9Q29Q/s220/35992_438460109342_637809342_5634970_3640496_n.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7317370756743359832.post-7194784017939681464</id><published>2011-08-06T11:10:00.000-07:00</published><updated>2011-08-06T11:10:12.803-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='webos phonegap email support forms'/><title type='text'>We All Need a Little Support</title><content type='html'>&lt;a href="http://weboscapades.blogspot.com/2011/07/passing-parameters-to-new-card-in.html"&gt;Last month&lt;/a&gt;, I alluded to a future post that would show the usefulness of&lt;i&gt; &lt;/i&gt;document.getElementById('element').value. I'm delivering on that promise now.&lt;br /&gt;&lt;br /&gt;This post explores a few different techniques within webOS and PhoneGap to create a highly functional application. To illustrate the idea, we'll make a support form.&lt;br /&gt;&lt;br /&gt;Set up a standard HTML page with the usual PhoneGap reference. We'll write the structure of the form in the body of the document.&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;div class="line" id="LC48"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="nt"&gt;&amp;lt;h2&lt;/span&gt; &lt;span class="na"&gt;align=&lt;/span&gt;&lt;span class="s"&gt;"center"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Support Request&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC49"&gt;&lt;span style="font-size: small;"&gt; &lt;span class="nt"&gt;&amp;lt;h3&lt;/span&gt; &lt;span class="na"&gt;align=&lt;/span&gt;&lt;span class="s"&gt;"center"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Help us help you!&lt;span class="nt"&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC50"&gt;&lt;span style="font-size: small;"&gt; &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;align=&lt;/span&gt;&lt;span class="s"&gt;"center"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Please fill out the below form to contact support.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC51"&gt;&lt;span style="font-size: small;"&gt; &lt;span class="nt"&gt;&amp;lt;form&lt;/span&gt; &lt;span class="na"&gt;align=&lt;/span&gt;&lt;span class="s"&gt;"center"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"oForm"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC52"&gt;&lt;span style="font-size: small;"&gt;  &lt;span class="nt"&gt;&amp;lt;table&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC53"&gt;&lt;span style="font-size: small;"&gt;  &lt;span class="nt"&gt;&amp;lt;tbody&amp;gt;&lt;/span&gt;     &lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC54"&gt;&lt;span style="font-size: small;"&gt;   &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&amp;lt;td&lt;/span&gt; &lt;span class="na"&gt;align=&lt;/span&gt;&lt;span class="s"&gt;"right"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Name:&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC55"&gt;&lt;span style="font-size: small;"&gt;   &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"name"&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"name"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC56"&gt;&lt;span style="font-size: small;"&gt;   &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&amp;lt;td&lt;/span&gt; &lt;span class="na"&gt;align=&lt;/span&gt;&lt;span class="s"&gt;"right"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;E-mail:&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC57"&gt;&lt;span style="font-size: small;"&gt;   &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"add"&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"add"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC58"&gt;&lt;span style="font-size: small;"&gt;   &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&amp;lt;td&lt;/span&gt; &lt;span class="na"&gt;align=&lt;/span&gt;&lt;span class="s"&gt;"right"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Problem:&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC59"&gt;&lt;span style="font-size: small;"&gt;   &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&amp;lt;textarea&lt;/span&gt; &lt;span class="na"&gt;rows=&lt;/span&gt;&lt;span class="s"&gt;"5"&lt;/span&gt; &lt;span class="na"&gt;cols=&lt;/span&gt;&lt;span class="s"&gt;"22"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"problem"&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"problem"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/textarea&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC60"&gt;&lt;span style="font-size: small;"&gt;  &lt;span class="nt"&gt;&amp;lt;/tbody&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC61"&gt;&lt;span style="font-size: small;"&gt;  &lt;span class="nt"&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC62"&gt;&lt;span style="font-size: small;"&gt;  &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"button"&lt;/span&gt; &lt;span class="na"&gt;onclick=&lt;/span&gt;&lt;span class="s"&gt;"formSubmit()"&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"Submit form"&lt;/span&gt; &lt;span class="na"&gt;align=&lt;/span&gt;&lt;span class="s"&gt;"center"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC63"&gt;&lt;span style="font-size: small;"&gt; &lt;span class="nt"&gt;&amp;lt;/form&amp;gt;&lt;/span&gt; &lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/blockquote&gt;There are a couple of important parts to note. Each of the input fields has its own id value to identify it, and the form triggers formSubmit() on the button click. The formSubmit function is where the fun twiddly bits go.&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;div class="line" id="LC21"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;formSubmit&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC22"&gt;&lt;span style="font-size: small;"&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;datestamp&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC23"&gt;&lt;span style="font-size: small;"&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Support Request from "&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'name'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC24"&gt;&lt;span style="font-size: small;"&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;text_cont&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"Name: "&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'name'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;br/&amp;gt;E-mail Address: "&lt;/span&gt;&lt;span class="o"&gt;&lt;/span&gt;&lt;span class="o"&gt;&lt;br /&gt;        +&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'add'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;br /&amp;gt;Timestamp: "&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nx"&gt;datestamp&lt;/span&gt;&lt;span class="o"&gt;&lt;br /&gt;        +&lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;br /&amp;gt;Problem: "&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'problem'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;div class="line" id="LC25"&gt;&lt;span style="font-size: small;"&gt; &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="font-size: small;"&gt; &lt;/span&gt;&lt;span style="font-size: small;"&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;service&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'palm://com.palm.applicationManager'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;br /&gt;  &lt;span class="nx"&gt;method&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'launch'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="font-size: small;"&gt; &lt;/span&gt;&lt;span style="font-size: small;"&gt;&lt;span class="nx"&gt;parameters&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="font-size: small;"&gt; &lt;/span&gt;&lt;span style="font-size: small;"&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"com.palm.app.email"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="font-size: small;"&gt; &lt;/span&gt;&lt;span style="font-size: small;"&gt; &lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;br /&gt;    &lt;span class="nx"&gt;summary&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;br /&gt;    &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;text_cont&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;br /&gt;    &lt;span class="nx"&gt;recipients&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC34"&gt;&lt;span style="font-size: small;"&gt;     &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC35"&gt;&lt;span style="font-size: small;"&gt;     &lt;span class="nx"&gt;role&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC36"&gt;&lt;span style="font-size: small;"&gt;     &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"johnsmith@example.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC37"&gt;&lt;span style="font-size: small;"&gt;     &lt;span class="nx"&gt;contactDisplay&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"John Smith"&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="font-size: small;"&gt;   &lt;span class="p"&gt;}]&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="font-size: small;"&gt; &lt;/span&gt;&lt;span style="font-size: small;"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="font-size: small;"&gt; &lt;/span&gt;&lt;span class="p" style="font-size: small;"&gt;}&lt;/span&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="font-size: small;"&gt; &lt;/span&gt;&lt;span class="p" style="font-size: small;"&gt;});&lt;/span&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt; &lt;/span&gt;&lt;span class="p" style="font-size: small;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="k" style="font-size: small;"&gt;catch&lt;/span&gt;&lt;span class="p" style="font-size: small;"&gt;(&lt;/span&gt;&lt;span class="nx" style="font-size: small;"&gt;ex&lt;/span&gt;&lt;span class="p" style="font-size: small;"&gt;)&lt;/span&gt;&lt;span style="font-size: small;"&gt; &lt;/span&gt;&lt;span class="p" style="font-size: small;"&gt;{&lt;/span&gt;&lt;span class="nx" style="font-size: small;"&gt;console&lt;/span&gt;&lt;span class="p" style="font-size: small;"&gt;.&lt;/span&gt;&lt;span class="nx" style="font-size: small;"&gt;log&lt;/span&gt;&lt;span class="p" style="font-size: small;"&gt;(&lt;/span&gt;&lt;span class="s2" style="font-size: small;"&gt;"error"&lt;/span&gt;&lt;span style="font-size: small;"&gt;);}&lt;/span&gt;&lt;span style="font-size: small;"&gt;&lt;span class="p"&gt;&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/blockquote&gt;The first few variables are strings that construct various parts of the message. You can see at that point that we're pulling the form field contents using document.getElementById('element').value. We then take those variables and use navigator.service.Request to &lt;a href="https://developer.palm.com/content/api/reference/application-apis/email.html"&gt;launch the e-mail app and pass the parameters to it&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;Now, let's put it to the test. Superman is having some connectivity issues.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-QJfH-OyCev0/Tj1UgQSRwGI/AAAAAAAAACo/qJb611tJU_k/s1600/Screenshot-36.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-QJfH-OyCev0/Tj1UgQSRwGI/AAAAAAAAACo/qJb611tJU_k/s320/Screenshot-36.png" width="216" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Superman then submits the form, which composes a structured and date stamped email to system administrator John Smith. (What, were you expecting Lex Luthor to be the Sysadmin? He's busy.)&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-P8EZj8o5OOY/Tj1UghR8s1I/AAAAAAAAACs/UJF5XADCEos/s1600/Screenshot-37.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-P8EZj8o5OOY/Tj1UghR8s1I/AAAAAAAAACs/UJF5XADCEos/s320/Screenshot-37.png" width="211" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;You can see the power and flexibility behind this method, as it allows you to act on any form input from a user such as radio, dropdown lists, and more. The ability to pass those parameters to a composed email is a useful trick as well. This example is posted &lt;a href="https://gist.github.com/1129394"&gt;in a github gist&lt;/a&gt;, please feel free to use and distribute the code as you see fit.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7317370756743359832-7194784017939681464?l=weboscapades.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://weboscapades.blogspot.com/feeds/7194784017939681464/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://weboscapades.blogspot.com/2011/08/we-all-need-little-support.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7317370756743359832/posts/default/7194784017939681464'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7317370756743359832/posts/default/7194784017939681464'/><link rel='alternate' type='text/html' href='http://weboscapades.blogspot.com/2011/08/we-all-need-little-support.html' title='We All Need a Little Support'/><author><name>Ken Schreihofer</name><uri>http://www.blogger.com/profile/14556837503761841316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-Kp6kib7uBkw/Ti8tiVoa8zI/AAAAAAAAACI/u4cfKh9Q29Q/s220/35992_438460109342_637809342_5634970_3640496_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-QJfH-OyCev0/Tj1UgQSRwGI/AAAAAAAAACo/qJb611tJU_k/s72-c/Screenshot-36.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7317370756743359832.post-6698079135214486818</id><published>2011-07-26T15:46:00.000-07:00</published><updated>2011-07-26T15:46:49.375-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='webos phonegap orientation rtfm'/><title type='text'>This is Why You RTFM</title><content type='html'>A more accurate title might be RTFF (Read the ****ing Framework), but that doesn't have quite the same ring to it. &lt;br /&gt;&lt;br /&gt;For a while now, I've been idly wondering how to make webOS PhoneGap apps rotate with the device orientation. I knew that there was a way to set orientation via a PhoneGap function, but I didn't bother investigating since it wasn't needed at the time. Until today. I started wondering about possible solutions, perhaps by adding event listeners to detect the orientation and set the corresponding direction.&lt;br /&gt;&lt;br /&gt;It turns out that the answer is in the framework, underneath the orientation class. &lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;/*&lt;br /&gt;&amp;nbsp;* Manually sets the orientation of the application window. &lt;br /&gt;&amp;nbsp;* 'up', 'down', 'left' or 'right' used to specify fixed window orientation&lt;br /&gt;&amp;nbsp;* 'free' WebOS will change the window orientation to match the device orientation&lt;br /&gt;&amp;nbsp;* @param {String} orientation&lt;br /&gt;&amp;nbsp;* Example:&lt;br /&gt;&amp;nbsp;*&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; navigator.orientation.setOrientation('up');&lt;br /&gt;&amp;nbsp;*/&lt;/blockquote&gt;&lt;br /&gt;Yes, it really is as easy as including "navigator.orientation.setOrientation('free');". &lt;br /&gt;&lt;br /&gt;Yes, I felt twice as dumb after realizing that the reference was part of &lt;a href="https://github.com/hermwong/phonegap-webos/blob/master/framework/index.html"&gt;Herm's example code&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Yes, I will RTFM from now on.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7317370756743359832-6698079135214486818?l=weboscapades.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://weboscapades.blogspot.com/feeds/6698079135214486818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://weboscapades.blogspot.com/2011/07/this-is-why-you-rtfm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7317370756743359832/posts/default/6698079135214486818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7317370756743359832/posts/default/6698079135214486818'/><link rel='alternate' type='text/html' href='http://weboscapades.blogspot.com/2011/07/this-is-why-you-rtfm.html' title='This is Why You RTFM'/><author><name>Ken Schreihofer</name><uri>http://www.blogger.com/profile/14556837503761841316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-Kp6kib7uBkw/Ti8tiVoa8zI/AAAAAAAAACI/u4cfKh9Q29Q/s220/35992_438460109342_637809342_5634970_3640496_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7317370756743359832.post-1244429610015484367</id><published>2011-07-17T14:09:00.000-07:00</published><updated>2011-07-17T14:11:08.691-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='phonegap webos palm hp functions touchpad'/><title type='text'>Tips from the Twitterverse</title><content type='html'>I haven't forgotten about webOScapades. Oh, not at all. I have a few new posts coming soon. Today, I'll dip into the lovely mess of Twitter for some PhoneGap tips. &lt;br /&gt;&lt;br /&gt;The first tip comes from &lt;a href="https://twitter.com/#%21/hermwong"&gt;Herm Wong&lt;/a&gt; at Nitobi, the gentleman responsible for the updates to PG-webOS. It stems from two questions that posed to him: how do you &lt;a href="https://twitter.com/#%21/hermwong/status/90616965978263552"&gt;programmatically close the card that you're currently in&lt;/a&gt;, and how do you &lt;a href="https://twitter.com/#%21/hermwong/status/90654679717003264"&gt;close the parent of the card that you've opened&lt;/a&gt;? He's compiled the answers &lt;a href="http://www.digitaldogbyte.com/2011/07/15/phonegap-webos-newcard-api-tricks/"&gt;into a comprehensive post on his blog&lt;/a&gt;, which also includes &lt;a href="http://weboscapades.blogspot.com/2011/07/passing-parameters-to-new-card-in.html"&gt;the parameter passing tricks&lt;/a&gt;. Window.close() and other functions are &lt;a href="http://www.devguru.com/technologies/ecmascript/quickref/window.html"&gt;part of the Javascript Window object&lt;/a&gt;, so if you find other window functions that work well with PhoneGap/webOS, please post about it in the comments!&lt;br /&gt;&lt;br /&gt;The second tip is from &lt;span class="user-name-and-actions"&gt;&lt;span class="user-full-name"&gt;&lt;a href="https://twitter.com/#%21/twtomcat"&gt;Markus Leutwyler&lt;/a&gt; at HP. If you've gotten your hands on one of those shiny new HP Touchpads, &lt;a href="http://weboscapades.blogspot.com/2011/06/inertial-scrolling-on-webos-using.html"&gt;the inertial scrolling examples that I posted about&lt;/a&gt; work very well. Just add &lt;/span&gt;&lt;/span&gt;&lt;a href="https://twitter.com/#%21/twtomcat/status/89786201418104832"&gt;"uiRevision" : "2" to your appinfo.json file&lt;/a&gt;. The end result is a full-screen app with code that works on webOS 1.x, 2.x, and 3.x at the same time. In my opinion, &lt;a href="https://twitter.com/#%21/webosinternals/status/91634947932176384"&gt;that's a pretty good answer to the Mojo/Enyo debate&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;One final bit of news: &lt;a href="https://twitter.com/#%21/hermwong/status/90648542477172736"&gt;PhoneGap 1.0.0&lt;/a&gt; is on its way. Woohoo! It includes support for touch events, &lt;a href="http://www.digitaldogbyte.com/2011/07/12/phonegap-webos-1-0-0rc1-now-with-touch-events-2/"&gt;which has been documented by Herm on his blog&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7317370756743359832-1244429610015484367?l=weboscapades.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://weboscapades.blogspot.com/feeds/1244429610015484367/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://weboscapades.blogspot.com/2011/07/tips-from-twitterverse.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7317370756743359832/posts/default/1244429610015484367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7317370756743359832/posts/default/1244429610015484367'/><link rel='alternate' type='text/html' href='http://weboscapades.blogspot.com/2011/07/tips-from-twitterverse.html' title='Tips from the Twitterverse'/><author><name>Ken Schreihofer</name><uri>http://www.blogger.com/profile/14556837503761841316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-Kp6kib7uBkw/Ti8tiVoa8zI/AAAAAAAAACI/u4cfKh9Q29Q/s220/35992_438460109342_637809342_5634970_3640496_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7317370756743359832.post-4852786090905631271</id><published>2011-07-02T16:50:00.000-07:00</published><updated>2011-07-02T19:29:26.561-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='phonegap html webos palm hp parameter passing keanu reeves'/><title type='text'>Passing Parameters to a New Card in PhoneGap</title><content type='html'>&lt;div style="text-align: left;"&gt;Here's a neat trick to whet your PhoneGappetites. As I've said before, &lt;a href="https://twitter.com/hermwong"&gt;Herm Wong's&lt;/a&gt; excellent tutorial series on using PhoneGap with webOS is a great place to get started with development. I'm going to concentrate on a particular post of his, &lt;a href="http://www.digitaldogbyte.com/2011/05/13/phonegap-0-9-5-webos-newcard-api/"&gt;how to use the New Card API in PhoneGap&lt;/a&gt;.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;To launch a new card, just use the form of "&lt;i&gt;navigator.window.newCard(url, html);"&lt;/i&gt;. While this invocation is both simple and powerful, it's also somewhat lacking. If you open a new card using the url parameter, it&amp;nbsp; just calls that page statically. Using the optional html field to pass code gives you some options of interacting with the new card, but isn't a reusable method and your code becomes needlessly messy. The most successful apps live and breathe on passing dynamic data. What can you do to get there?&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The solution came from &lt;a href="http://www.htmlforums.com/archive/index.php/t-38747.html"&gt;this post on the HTML Forums&lt;/a&gt;. Simply pass parameters via the URL, the same way that you would for other web languages like PHP. It takes the form of file.html?firstname=Keanu&amp;amp;lastname=Reeves.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;No SEO trickery going on here. Nope.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Here's a PhoneGap-ready example of the code. Put these two files in your webos/framework directory.&lt;/div&gt;&lt;br /&gt;&lt;u&gt;index.html&lt;/u&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size: x-small;"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;lt;title&amp;gt;PhoneGap WebOS&amp;lt;/title&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;script type="text/javascript" src="phonegap.js"&amp;gt;&amp;lt;/script&amp;gt;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;script type="text/javascript"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;function onLoad() {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;navigator.device.deviceReady();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;lt;body onload="onLoad();"&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;p&amp;gt;&amp;lt;input type="button" value="Launch a new card" onclick="navigator.window.newCard('passing.html?firstname=Keanu&amp;amp;lastname=Reeves');"&amp;gt;&amp;lt;/p&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;u&gt;passing.html&lt;/u&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size: x-small;"&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;Page 2&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript" src="phonegap.js"&amp;gt;&amp;lt;/script&amp;gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var query = location.href.substring((location.href.indexOf('?')+1), location.href.length);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(location.href.indexOf('?') &amp;lt; 0) query = '';&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; querysplit = query.split('&amp;amp;');&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; query = new Array();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(var i = 0; i &amp;lt; querysplit.length; i++){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; var namevalue = querysplit[i].split('=');&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; namevalue[1] = namevalue[1].replace(/\+/g, ' ');&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; query[namevalue[0]] = unescape(namevalue[1]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.onload = function(){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; document.getElementById('firstname').innerHTML = query['firstname'];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.getElementById('lastname').innerHTML = query['lastname'];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt;Who are you?&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;Your name is &amp;lt;span id="firstname"&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span id="lastname"&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/span&gt; &lt;/blockquote&gt;&lt;div style="text-align: left;"&gt;Voilà! For added fun, try to modify the example to use input from two text fields to pass data to the new card. Not sure how? Here's a hint: Use &lt;i&gt;"document.getElementById('element').value"&lt;/i&gt; to access the contents of the form fields. More on that in a coming post.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7317370756743359832-4852786090905631271?l=weboscapades.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://weboscapades.blogspot.com/feeds/4852786090905631271/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://weboscapades.blogspot.com/2011/07/passing-parameters-to-new-card-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7317370756743359832/posts/default/4852786090905631271'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7317370756743359832/posts/default/4852786090905631271'/><link rel='alternate' type='text/html' href='http://weboscapades.blogspot.com/2011/07/passing-parameters-to-new-card-in.html' title='Passing Parameters to a New Card in PhoneGap'/><author><name>Ken Schreihofer</name><uri>http://www.blogger.com/profile/14556837503761841316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-Kp6kib7uBkw/Ti8tiVoa8zI/AAAAAAAAACI/u4cfKh9Q29Q/s220/35992_438460109342_637809342_5634970_3640496_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7317370756743359832.post-8757294420062444480</id><published>2011-06-30T11:43:00.000-07:00</published><updated>2011-07-02T16:52:02.819-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='webos phonegap iscroll4 inertial scrolling'/><title type='text'>Inertial Scrolling on webOS using PhoneGap and iScroll 4</title><content type='html'>&lt;div style="text-align: left;"&gt;So, let's get down to working with &lt;a href="http://www.phonegap.com/"&gt;PhoneGap&lt;/a&gt;. One of the first things you'll notice when you make a PhoneGap app on webOS is that the page doesn't scroll. &lt;a href="https://developer.palm.com/content/api/reference/mojo/widgets/scroller.html"&gt;Palm has a nice inertial scrolling widget&lt;/a&gt;, so what's going on? Well, there's no scrolling widget in stock PhoneGap. If you drag your finger on a page, it'll just highlight the contents. Don't worry. There's an easy way to fix this.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;My solution of choice is the &lt;a href="http://cubiq.org/iscroll-4"&gt;iScroll 4 framework&lt;/a&gt; by &lt;a href="https://twitter.com/cubiq"&gt;Matteo Spinelli&lt;/a&gt;. The beauty of iScroll is that it allows you to scroll within a fixed space, letting you set a header and footer -- perfect for mobile apps. A great starting point is to try out the examples provided with the framework. I've tested both the &lt;a href="https://github.com/cubiq/iscroll/blob/master/examples/simple/index.html"&gt;Simple Scroll&lt;/a&gt; and &lt;a href="https://github.com/cubiq/iscroll/blob/master/examples/carousel/index.html"&gt;Carousel&lt;/a&gt; samples  on webOS 2.1 with excellent success. &lt;a href="https://github.com/cubiq/iscroll/tarball/master"&gt;Download the latest iscroll.js file&lt;/a&gt; and put it in your webOS/framework PhoneGap folder. If you're using the stock examples in iScroll 4, make sure to include the &lt;i&gt;&amp;lt;script type="text/javascript" src="phonegap.js"&amp;gt; &amp;lt;/script&amp;gt;&lt;/i&gt; reference in the head of your code, and &lt;i&gt;&amp;lt;script type="text/javascript"&amp;gt; navigator.device.deviceReady(); &amp;lt;/script&amp;gt;&lt;/i&gt; in the body. &lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Now, iScroll 4 likes to scroll lists. If you want a single page scrolled and are using one of the provided examples as a template, you can simply put the entire contents of your page into one &amp;lt;li&amp;gt;. Just go to the #scroller li style section and remove height:40px.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The framework has quite a bit to offer beyond just scrolling, but I haven't been able to get some of the other functions running just yet. The &lt;a href="http://cubiq.org/dropbox/iscroll4/examples/zoom/"&gt;Pinch/Zoom&lt;/a&gt; and &lt;a href="http://cubiq.org/dropbox/iscroll4/examples/pull-to-refresh/"&gt;Pull to Refresh&lt;/a&gt; examples aren't working out of the box on webOS. Really, those would just be icing on a very delicious cake. With the scrolling functionality alone, iScroll 4 is a powerful and much needed option in your programming toolbox.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7317370756743359832-8757294420062444480?l=weboscapades.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://weboscapades.blogspot.com/feeds/8757294420062444480/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://weboscapades.blogspot.com/2011/06/inertial-scrolling-on-webos-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7317370756743359832/posts/default/8757294420062444480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7317370756743359832/posts/default/8757294420062444480'/><link rel='alternate' type='text/html' href='http://weboscapades.blogspot.com/2011/06/inertial-scrolling-on-webos-using.html' title='Inertial Scrolling on webOS using PhoneGap and iScroll 4'/><author><name>Ken Schreihofer</name><uri>http://www.blogger.com/profile/14556837503761841316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-Kp6kib7uBkw/Ti8tiVoa8zI/AAAAAAAAACI/u4cfKh9Q29Q/s220/35992_438460109342_637809342_5634970_3640496_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7317370756743359832.post-7351224129403584950</id><published>2011-06-26T18:51:00.000-07:00</published><updated>2011-07-02T16:52:16.922-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='webos hp palm phonegap programming development'/><title type='text'>webOScapades -- Occasional Adventures in webOS Development</title><content type='html'>&lt;div style="text-align: left;"&gt;&lt;span style="font-size: small;"&gt;I make no bones about it, I like HP's (nee Palm's) webOS platform. &lt;a href="http://www.engadget.com/2010/10/19/webos-2-0-review/"&gt;The operating system is beautiful&lt;/a&gt;, &lt;a href="http://webos.meetup.com/"&gt;the community is incredible&lt;/a&gt;, &lt;a href="https://developer.palm.com/content/showcase/developer_voices"&gt;and the development process is a charm&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-size: small;"&gt;The power of webOS lies in the use of web technologies. You can build a quality app with nothing more than HTML, CSS and JavaScript. Web programmers will be right at home. For webOS 1.x and 2.x, you generally needed to learn &lt;a href="http://arstechnica.com/gadgets/news/2009/01/the-pres-got-mojo-a-developer-speaks-about-palms-new-sdk.ars"&gt;an MVC style framework called Mojo&lt;/a&gt;. Mojo is old news -- starting with webOS 3.0, &lt;a href="http://pdnblog.palm.com/2011/03/get-the-webos-3-0-sdk-develop-for-hp-touchpad-and-beyond/"&gt;the new hotness is Enyo&lt;/a&gt;. The Enyo SDK is currently under NDA in the HP Early Access Program, but will be presumably be publicly released in the near future &lt;a href="http://blog.palm.com/palm/2011/06/hp-touchpad-its-a-date.html"&gt;when the HP TouchPad ships on July 1st, 2011&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-size: small;"&gt;I'm not walking the Enyo road just yet. Right now, I'm having much more fun playing with &lt;a href="http://www.phonegap.com/"&gt;PhoneGap&lt;/a&gt;, a cross-platform framework that allows you to write HTML/JavaScript apps and author them on multiple platforms. As of version 0.9.5, PhoneGap is Mojo-free. You write just as you would for a standard web page and include a little PhoneGap JS code. The best way to get started would be to &lt;a href="http://www.phonegap.com/download/"&gt;download the latest version of PhoneGap&lt;/a&gt; (0.9.5.1 at this writing) and delve into &lt;a href="https://twitter.com/hermwong"&gt;Herm Wong's&lt;/a&gt; excellent &lt;a href="http://www.digitaldogbyte.com/category/webos/"&gt;webOS PhoneGap tutorials&lt;/a&gt;. His &lt;/span&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.digitaldogbyte.com/2011/05/10/getting-started-with-phonegap-webos-0-9-5/"&gt;"Getting Started with PhoneGap WebOS 0.9.5"&lt;/a&gt; post is a good place for beginners, and includes links to other needed steps.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-size: small;"&gt;Becoming a webOS developer couldn't be easier -- or cheaper, for that matter. It's free. As in zero, zip, nada. Just &lt;a href="https://developer.palm.com/index.php?option=com_user&amp;amp;view=login&amp;amp;signup"&gt;sign up&lt;/a&gt; at the HP webOS Developer Portal.  Community accounts will give you access to play around with the SDK and  post in the forums, but you'll need a Developer account to publish apps  in the App Catalog. For that, you need a PayPal account (to get paid)  and a business tax id number (to pay the government).&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-size: small;"&gt;By itself, &lt;/span&gt;&lt;span style="font-size: small;"&gt;PhoneGap isn't enough to make a quality webOS app. You need &lt;/span&gt;&lt;span style="font-size: small;"&gt;to add the functionality in bits and parts. &lt;/span&gt;&lt;span style="font-size: small;"&gt;As I discover more pieces of the puzzle, I'll put together posts and tutorials on the process. &lt;/span&gt;&lt;span style="font-size: small;"&gt;This blog will hopefully be an aid to others on the same path.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-size: small;"&gt;Ken Schreihofer&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7317370756743359832-7351224129403584950?l=weboscapades.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://weboscapades.blogspot.com/feeds/7351224129403584950/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://weboscapades.blogspot.com/2011/06/weboscapades-occasional-adventures-in.html#comment-form' title='15 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7317370756743359832/posts/default/7351224129403584950'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7317370756743359832/posts/default/7351224129403584950'/><link rel='alternate' type='text/html' href='http://weboscapades.blogspot.com/2011/06/weboscapades-occasional-adventures-in.html' title='webOScapades -- Occasional Adventures in webOS Development'/><author><name>Ken Schreihofer</name><uri>http://www.blogger.com/profile/14556837503761841316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-Kp6kib7uBkw/Ti8tiVoa8zI/AAAAAAAAACI/u4cfKh9Q29Q/s220/35992_438460109342_637809342_5634970_3640496_n.jpg'/></author><thr:total>15</thr:total></entry></feed>
