<?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-4423160453611868821</id><updated>2012-01-20T07:04:54.108-08:00</updated><category term='android'/><category term='java'/><category term='Iphone'/><title type='text'>Everyday is a new day</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://zhoupengylx.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4423160453611868821/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://zhoupengylx.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>yellowstonemay</name><uri>http://www.blogger.com/profile/05670200739872876579</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4423160453611868821.post-2758357112150616893</id><published>2010-06-15T19:56:00.001-07:00</published><updated>2010-06-15T20:17:01.028-07:00</updated><title type='text'>RESTful on Google App Engine in 5</title><content type='html'>&lt;p&gt;&lt;a title="https://wikihub.berkeley.edu/display/sbint/RESTful+on+Google+App+Engine+in+5" href="https://wikihub.berkeley.edu/display/sbint/RESTful+on+Google+App+Engine+in+5"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="https://wikihub.berkeley.edu/display/sbint/RESTful+on+Google+App+Engine+in+5"&gt;RESTful on Google App Engine in 5&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Quick prototyping and publishing is very useful in developing RESTful services.&amp;#160; It's essential that consumers can access and experiment with a service while it's being developed.&amp;#160; The Google App Engine (GAE) platform is free at the entry level, and provides sufficient capabilities to deploy RESTful applications with a public URI.&lt;/p&gt;  &lt;h6&gt;&lt;a name="RESTfulonGoogleAppEnginein5-PreparetheEnvironment"&gt;&lt;/a&gt;Prepare the Environment&lt;/h6&gt;  &lt;ol&gt;   &lt;li&gt;Obtain a free GAE account by visiting: &lt;a href="http://appengine.google.com"&gt;appengine.google.com&lt;/a&gt;. &lt;/li&gt;    &lt;li&gt;From the &amp;quot;My Applications&amp;quot; view on the appengine page, create a new application ID. &lt;/li&gt;    &lt;li&gt;Install the &lt;a href="http://code.google.com/appengine/docs/java/tools/eclipse.html"&gt;Eclipse plugin&lt;/a&gt; . &lt;/li&gt; &lt;/ol&gt;  &lt;h6&gt;&lt;a name="RESTfulonGoogleAppEnginein5-Creating%26DeployingaRESTfulApponGAE"&gt;&lt;/a&gt;Creating &amp;amp; Deploying a RESTful App on GAE&lt;/h6&gt;  &lt;ol&gt;   &lt;li&gt;In Eclipse, create a new web application (File / New / Web Application Project), notice the Google logo next to this option. &lt;/li&gt;    &lt;li&gt;Modify the appengine-web.xml file to reflect your new application ID:      &lt;pre&gt;&amp;lt;application&amp;gt;your-app-id&amp;lt;/application&amp;gt;&lt;/pre&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Create a package for your REST classes &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Update web.xml with the following:&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre class="csharpcode"&gt;    &amp;lt;servlet&amp;gt;&lt;br /&gt;        &amp;lt;servlet-name&amp;gt;jersey&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;        &amp;lt;servlet-&lt;span class="kwrd"&gt;class&lt;/span&gt;&amp;gt;com.sun.jersey.spi.container.servlet.ServletContainer&amp;lt;/servlet-&lt;span class="kwrd"&gt;class&lt;/span&gt;&amp;gt;&lt;br /&gt;        &amp;lt;init-param&amp;gt;&lt;br /&gt;            &amp;lt;param-name&amp;gt;com.sun.jersey.config.property.packages&amp;lt;/param-name&amp;gt;&lt;br /&gt;            &amp;lt;param-&lt;span class="kwrd"&gt;value&lt;/span&gt;&amp;gt;zpylx.restful&amp;lt;/param-&lt;span class="kwrd"&gt;value&lt;/span&gt;&amp;gt;&lt;br /&gt;        &amp;lt;/init-param&amp;gt;&lt;br /&gt;        &amp;lt;load-on-startup&amp;gt;1&amp;lt;/load-on-startup&amp;gt;&lt;br /&gt;    &amp;lt;/servlet&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;        &amp;lt;servlet-name&amp;gt;jersey&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;        &amp;lt;url-pattern&amp;gt;/rest/*&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;    &amp;lt;/servlet-mapping&amp;gt;&lt;/pre&gt;&lt;br /&gt;  &lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Download &lt;a href="https://jaxb.dev.java.net/2.1.9/JAXB2_20081030.jar"&gt;JAXB 2.1&lt;/a&gt; ; note that 2.2 does not run on GAE at this time; unpack the file or, if your systems is unix-based, run: &lt;br /&gt;&lt;br /&gt;    &lt;pre&gt;java -jar JAXB2_20081030.jar&lt;/pre&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Download the &lt;a href="http://download.java.net/maven/2/com/sun/jersey/jersey-archive/1.2/jersey-archive-1.2.zip"&gt;JAX-RS reference implementation&lt;/a&gt; (&lt;a href="https://jersey.dev.java.net/"&gt;jersey&lt;/a&gt;), and unpack. &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Place the JAXB and JAX-RS jars in the Eclipse project under /war/WEB-INF/lib.&amp;#160; Also, add the jars to the Java build path of the project. &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre class="csharpcode"&gt;package zpylx.restful.action;&lt;br /&gt;&lt;br /&gt;import javax.ws.rs.GET;&lt;br /&gt;import javax.ws.rs.Path;&lt;br /&gt;import javax.ws.rs.Produces;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;@Path(&lt;span class="str"&gt;&amp;quot;/activitieslist&amp;quot;&lt;/span&gt;)&lt;br /&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; MapActivities {&lt;br /&gt;&lt;br /&gt;    @GET&lt;br /&gt;    @Produces(&lt;span class="str"&gt;&amp;quot;text/plain&amp;quot;&lt;/span&gt;)&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; String getItems() {&lt;br /&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="str"&gt;&amp;quot;restful web service example&amp;quot;&lt;/span&gt;;&lt;br /&gt;    }&lt;/pre&gt;&lt;br /&gt;  &lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Create RESTful classes, e.g.: Deploy to app engine from Eclipse, by clicking on the &amp;quot;Deploy App Engine Project&amp;quot; icon in the toolbar (installed by the GAE plugin). &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;The application, based on the configuration above, would be accessible from this URI:&amp;#160; your-app-id.appspot.com/rest/activitieslist&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Manage application versions and view logs from the admin dashbord: &lt;a href="https://appengine.google.com/dashboard?&amp;amp;app_id=&amp;lt;font color="&gt;appengine.google.com/dashboard?&amp;amp;app_id=your-app-id&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="https://wikihub.berkeley.edu/"&gt;&lt;/a&gt;&lt;a href="https://wikihub.berkeley.edu/"&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;example link: &lt;a title="http://zhoupengylx.appspot.com/rest/activitieslist" href="http://zhoupengylx.appspot.com/rest/activitieslist"&gt;http://zhoupengylx.appspot.com/rest/activitieslist&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4423160453611868821-2758357112150616893?l=zhoupengylx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zhoupengylx.blogspot.com/feeds/2758357112150616893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zhoupengylx.blogspot.com/2010/06/restful-on-google-app-engine-in-5.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4423160453611868821/posts/default/2758357112150616893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4423160453611868821/posts/default/2758357112150616893'/><link rel='alternate' type='text/html' href='http://zhoupengylx.blogspot.com/2010/06/restful-on-google-app-engine-in-5.html' title='RESTful on Google App Engine in 5'/><author><name>yellowstonemay</name><uri>http://www.blogger.com/profile/05670200739872876579</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4423160453611868821.post-7457765809085869179</id><published>2010-06-03T18:09:00.000-07:00</published><updated>2010-06-17T19:59:28.123-07:00</updated><title type='text'>Seamless Java RDP client</title><content type='html'>&lt;p&gt;(I had done this two years ago and posted on my personal website. I never thought someone still sent email to me for this, even ask for source code. I think maybe more people want to know it. Posting on blogger is absolutely much popular than on my personal website).&lt;/p&gt;  &lt;p&gt;&lt;img src="http://zhoupenghust.web.officelive.com/images/rdesktop.jpg" /&gt;&lt;/p&gt;  &lt;p&gt;It is built base on &lt;a href="http://properjavardp.sourceforge.net/"&gt;properJavaRDP&lt;/a&gt;, which is an open source Java RDP client for Windows Terminal Services. The idea of &amp;quot;seamless&amp;quot; is come from &lt;a href="http://www.rdesktop.org/"&gt;rdesktop&lt;/a&gt;, which is a open source RDP client on unix platform. &amp;quot;seamless&amp;quot; can make remote running application looks like running locally. I upgrad properJavaRDP code from AWT to Swing, and add the functionality to handle &amp;quot;seamless&amp;quot; message in a special rdp vchannel. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;strong&gt;&lt;font color="#ff0000"&gt;new update(2010.06): support window 2008 now&lt;/font&gt;&lt;/strong&gt; (solve problem of “wrong modulus size! expected64+8got:264”)&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;new update(2010.06.17): support seamless mode applet&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Seamless Java RDP client&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;It is a general Java RDP client for Windows Terminal Services with &amp;quot;seamless&amp;quot; feature. It is built base on &lt;a href="http://properjavardp.sourceforge.net/"&gt;properJavaRDP&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;Product details&lt;/b&gt;&lt;/p&gt;  &lt;hr /&gt;  &lt;p&gt;To use seamless feature, you need seamlessRDP server extension. A SeamlessRDP server extension is available to support integration of individual applications with the client desktop. Precompiled binaries are available from &lt;a href="http://www.cendio.com/seamlessrdp/"&gt;Cendio&lt;/a&gt; (If you want Connetion sharing feature, you have to get patch from &lt;a href="http://www.fontis.com.au/rdesktop"&gt;http://www.fontis.com.au/rdesktop&lt;/a&gt;). My contribution is updated properJavaRDP code from AWT to Swing, and add the functionality to handle &amp;quot;seamless&amp;quot; message in a special rdp vchannel. jdk1.6.0-10 is needed, since shaping jframe is a new feature of jdk1.6.0-10. &lt;/p&gt;  &lt;p&gt;To download the client jar file: &lt;a href="http://zhoupenghust.web.officelive.com/Documents/javaRDP16-1.1.jar"&gt;javaRDP16-1.1.jar&lt;/a&gt;. A usage document is here:&lt;a href="http://zhoupenghust.web.officelive.com/Documents/how%20to%20use%20JavaRDP16-1.1.jar.doc"&gt;HowTo&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;I also write a Adito extension: &lt;a href="http://zhoupenghust.web.officelive.com/Documents/adito-application-seamlessjavardp.zip"&gt;adito-application-seamlessjavardp.zip&lt;/a&gt;. Just for you convenience, i upload service side exe package here:&lt;a href="http://zhoupenghust.web.officelive.com/Documents/seamlessrdp_server.zip"&gt;seamlessrdp_server.zip&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;(&lt;em&gt;05/12/2009&lt;/em&gt;) Recently, i got chance to take a look at &amp;quot;&lt;strong&gt;rdesktop session connection-sharing&lt;/strong&gt;&amp;quot; from &lt;a href="http://www.fontis.com.au/rdesktop"&gt;http://www.fontis.com.au/rdesktop&lt;/a&gt;. It is a very interesting feature which can save TS session. I think it is good to port this feature to my seamless JavaRDPClient. It took me one day to do this. I have updated all above link with the new update. Welcome you to try this cool feature.&lt;/p&gt;  &lt;p&gt;&amp;quot;&lt;strong&gt;Connection sharing &lt;/strong&gt;- allows a single rdesktop connection to launch multiple applications. When run in seamless mode, rdesktop creates and listens on a control socket. A new option allows rdesktop to be run in slave mode, which notifies the master rdesktop instance of a new command to be run and then exits. The master instance sends a client-to-server message to the SeamlessRDP server component, which runs the new command&amp;quot;. &lt;/p&gt;  &lt;p&gt;see the difference of &amp;quot;seamless rdp&amp;quot; from normal rdp client with following screenshot:&lt;/p&gt;  &lt;p&gt;1. nornal properJavaRdp client: ie and notepad is running on a remote server. you can see there is always a &amp;quot;frame&amp;quot; around the remote application.(My OS is english version XP, remote server is a chinese version windows 2003)&lt;img src="http://zhoupenghust.web.officelive.com/images/normalrdp.jpg" /&gt;&lt;/p&gt;  &lt;p&gt;2. Seamless rdp client: ie and notepad is running on a remote server. you can are running like &amp;quot;local&amp;quot; application. (My OS is english version XP, remote server is a chinese version windows 2003)&lt;/p&gt;  &lt;p&gt;&lt;img src="http://zhoupenghust.web.officelive.com/images/seamless.jpg" /&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;The usage&lt;/em&gt;&lt;/strong&gt;:&lt;/p&gt;  &lt;p&gt;First, On windows as server &lt;/p&gt;  &lt;p&gt;download &lt;a href="http://zhoupenghust.web.officelive.com/Documents/seamlessrdp_server.zip"&gt;seamlessrdp_server.zip&lt;/a&gt; and upzip it to C:\seamlessrdp&lt;/p&gt;  &lt;p&gt;Then, on client side (windows or unix support jdk1.6u10),&lt;/p&gt;  &lt;p&gt;Run the pure seamless client: &lt;/p&gt;  &lt;p&gt;c:\&amp;gt;java -jar JavaRDP16-1.1.jar -u administrator -p 111111 -fs -s &amp;quot;C:\seamlessrdp\seamlessrdpshell.exe C:\Program Files\Internet Explorer\iexplore.exe&amp;quot; 192.168.1.135:3389 &lt;/p&gt;  &lt;p&gt;Run as seamless client with Connection-sharing feature:&lt;/p&gt;  &lt;p&gt;1. start the firt client : &lt;/p&gt;  &lt;p&gt;c:\&amp;gt;java -jar JavaRDP16-1.1.jar -u administrator -p 111111 -fm -s &amp;quot;C:\seamlessrdp\seamlessrdpshell.exe C:\Program Files\Internet Explorer\iexplore.exe&amp;quot; 192.168.1.135:3389&lt;/p&gt;  &lt;p&gt;2. start more client but share the same connection with above one:&lt;/p&gt;  &lt;p&gt;c:\&amp;gt;java -jar JavaRDP16-1.1.jar -fc -s &amp;quot;C:\Program Files\Internet Explorer\iexplore.exe&amp;quot; &lt;/p&gt;  &lt;p&gt;------------------------------------------------------------------------------------------------------------------------&lt;/p&gt;  &lt;p&gt;&lt;b&gt;How to run as applet:&amp;#160;&amp;#160; &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;(take a look at &lt;a href="http://zhoupenghust.web.officelive.com/Documents/javaRdpApplet.html"&gt;exampleHtml&lt;/a&gt; to be aware of how to fill the params.)&lt;/p&gt;  &lt;p&gt;First, the JavaRDP16-1.1.jar should be signed, and make sure it is in the right directory. I wrote a html(javaRdpApplet.html) and “sign.bat” in case you do not know how to sign and run the RDP jar.&lt;/p&gt;  &lt;p&gt;Step by step:&lt;/p&gt;  &lt;p&gt;1. create self certification and sign the jar package. In “sign.bat”, there are four commands to be executed:&lt;/p&gt;  &lt;p&gt;&lt;b&gt;keytool&lt;/b&gt; -genkey -dname &amp;quot;cn=BeanSoft Studio, ou=Java Software, o=BeanSoft Studio, c=China&amp;quot; -alias beansoft -keypass beansoft -storepass beansoft -validity 365 -keystore .\beansoft&lt;/p&gt;  &lt;p&gt;&lt;b&gt;keytool&lt;/b&gt; -list -keystore .\beansoft -storepass beansoft&lt;/p&gt;  &lt;p&gt;&lt;b&gt;keytool&lt;/b&gt; -export -keystore .\beansoft -storepass beansoft -file beansoft.cer -alias beansoft&lt;/p&gt;  &lt;p&gt;&lt;b&gt;jarsigner&lt;/b&gt; -verbose -keystore .\beansoft javaRDP16-1.1.jar beansoft&lt;/p&gt;  &lt;p&gt;If you already have your certification file, you may just need to run the command in last line.&lt;/p&gt;  &lt;p&gt;Before running sign.bat, the file list is as below:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_lK7WLUR1JQA/TBbgWLdstOI/AAAAAAAAADQ/f77IhahVdyA/s1600-h/clip_image002%5B3%5D.jpg"&gt;&lt;img title="clip_image002" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="37" alt="clip_image002" src="http://lh4.ggpht.com/_lK7WLUR1JQA/TBbgW4QiYWI/AAAAAAAAADU/q7fAJJnEzG8/clip_image002_thumb.jpg?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;2. run the sign.bat, you will get a window as below, input your password, in my case, it is “beansoft”. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_lK7WLUR1JQA/TBbgXeD-xdI/AAAAAAAAADY/C9BIScR092Q/s1600-h/clip_image004%5B4%5D.jpg"&gt;&lt;img title="clip_image004" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="198" alt="clip_image004" src="http://lh4.ggpht.com/_lK7WLUR1JQA/TBbgcnDrGZI/AAAAAAAAADc/tMea7zfZGl4/clip_image004_thumb%5B1%5D.jpg?imgmax=800" width="303" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;3. Now, you got file list should like:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_lK7WLUR1JQA/TBbgc2IdzlI/AAAAAAAAADg/3U5MxLbInqk/s1600-h/clip_image006%5B4%5D.jpg"&gt;&lt;img title="clip_image006" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="59" alt="clip_image006" src="http://lh3.ggpht.com/_lK7WLUR1JQA/TBbgd4_dn9I/AAAAAAAAADk/6CS7MR2Q5sU/clip_image006_thumb%5B1%5D.jpg?imgmax=800" width="285" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Notice that the size of javaRDP16-1.1.jar is bigger than original one. (in my testing, it is from 352KB to 374KB). It is becase it is signed. “jarsigner” add some file to META-INF.&lt;/p&gt;  &lt;p&gt;4. Now you can try javaRdpApplet.html with IE explorer. I got message like below and it work well if you input correct IP address. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_lK7WLUR1JQA/TBbgeINx0PI/AAAAAAAAADo/9BwRrQ7E-jQ/s1600-h/clip_image008%5B4%5D.jpg"&gt;&lt;img title="clip_image008" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="170" alt="clip_image008" src="http://lh3.ggpht.com/_lK7WLUR1JQA/TBbgeTujwuI/AAAAAAAAADs/U2uQhlNnddw/clip_image008_thumb%5B1%5D.jpg?imgmax=800" width="322" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4423160453611868821-7457765809085869179?l=zhoupengylx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zhoupengylx.blogspot.com/feeds/7457765809085869179/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zhoupengylx.blogspot.com/2010/03/seamless-java-rdp-client.html#comment-form' title='41 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4423160453611868821/posts/default/7457765809085869179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4423160453611868821/posts/default/7457765809085869179'/><link rel='alternate' type='text/html' href='http://zhoupengylx.blogspot.com/2010/03/seamless-java-rdp-client.html' title='Seamless Java RDP client'/><author><name>yellowstonemay</name><uri>http://www.blogger.com/profile/05670200739872876579</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_lK7WLUR1JQA/TBbgW4QiYWI/AAAAAAAAADU/q7fAJJnEzG8/s72-c/clip_image002_thumb.jpg?imgmax=800' height='72' width='72'/><thr:total>41</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4423160453611868821.post-5442874334153137742</id><published>2010-06-02T09:50:00.001-07:00</published><updated>2010-06-02T09:50:45.640-07:00</updated><title type='text'>Flex tips</title><content type='html'>&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;1. &lt;strong&gt;fileReference.load undefined - wrong SDK&lt;/strong&gt;:&lt;/p&gt;  &lt;p&gt;1061: Call to a possibly undefined method load through a reference with static type flash.net:FileReference&lt;/p&gt;  &lt;p&gt;solution: &lt;/p&gt;  &lt;p&gt;in Flex Bulider 3/4:   &lt;br /&gt;Project &amp;gt; Properties &amp;gt; Flex compiler    &lt;br /&gt;Change &amp;quot;HTML wrapper&amp;quot; --&amp;gt; &amp;quot;Require Flash Player version&amp;quot; from 9.x.x to 10.x.x where x is some numbers (In my case, I just change 9.0.124 to 10.0.0)&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4423160453611868821-5442874334153137742?l=zhoupengylx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zhoupengylx.blogspot.com/feeds/5442874334153137742/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zhoupengylx.blogspot.com/2010/06/flex-tips.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4423160453611868821/posts/default/5442874334153137742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4423160453611868821/posts/default/5442874334153137742'/><link rel='alternate' type='text/html' href='http://zhoupengylx.blogspot.com/2010/06/flex-tips.html' title='Flex tips'/><author><name>yellowstonemay</name><uri>http://www.blogger.com/profile/05670200739872876579</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4423160453611868821.post-8999934365550449222</id><published>2010-03-28T19:13:00.001-07:00</published><updated>2010-05-24T19:33:44.398-07:00</updated><title type='text'>Adito standalone agent client</title><content type='html'>&lt;pre class="csharpcode"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;(I had done this one and half year ago and posted on my personal website. I never thought someone still sent email to me for this. I think maybe more people want to know it. Posting on blogger is absolutely much popular than on my personal website).&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;  &lt;br /&gt;Adito is an open-source, browser-based SSL VPN solution. It’s a remote access solution that provides users and businesses alike with a means of securely accessing network resources from outside the network perimeter using only a standard web browser.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;What is my contribute?&lt;/strong&gt; &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;I go throught almost all the code of Adito and debug it in Eclipse. Base on Agent code, i add a swing wrapper to it and run it as a standalone client. Related technology is java swing GUI, TLS socket. You can download it from &lt;a href="http://zhoupenghust.web.officelive.com/Documents/agent.rar"&gt;here&lt;/a&gt;. Any bugs, please leave your comments below.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Adito&lt;/strong&gt; &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;It is an open-source, browser-based SSL VPN solution. It’s a remote access solution that provides users and businesses alike with a means of securely accessing network resources from outside the network perimeter using only a standard web browser. For more information regarding Adito go &lt;a href="https://sourceforge.net/projects/adito"&gt;here&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Background&lt;/strong&gt; &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;This is the open-source clone of SSL-Explorer after it went biz-o-matic.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;img src="http://zhoupenghust.web.officelive.com/images/frame-agent.gif" /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;What is &lt;b&gt;standalone agent client&lt;/b&gt; &lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Generally, agent client is a systray and used like a applet. I notice that someone like to use it as a standalone application that you do not need to access web site each time and can run it from even console (of cause, you have to have jre), and it is convenient for debug agent server. I like the idea, so i add a Java Swing Wrapper base on original Adito agent code. Only Swing is supported, no swt.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Screenshots&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;img src="http://zhoupenghust.web.officelive.com/images/login.jpg" /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;login GUI&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;img src="http://zhoupenghust.web.officelive.com/images/adito.jpg" /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Main board&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;To download: &lt;a href="http://zhoupenghust.web.officelive.com/Documents/agent.zip"&gt;agent.zip&lt;/a&gt;&amp;#160;&lt;font color="#ff0000"&gt;(new updated usage document, 2010.05)&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font color="#ff0000"&gt;the source code is at : &lt;a title="https://sourceforge.net/projects/aditoagentclien/" href="https://sourceforge.net/projects/aditoagentclien/"&gt;https://sourceforge.net/projects/aditoagentclien/&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4423160453611868821-8999934365550449222?l=zhoupengylx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zhoupengylx.blogspot.com/feeds/8999934365550449222/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zhoupengylx.blogspot.com/2010/03/adito-standalone-agent-client.html#comment-form' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4423160453611868821/posts/default/8999934365550449222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4423160453611868821/posts/default/8999934365550449222'/><link rel='alternate' type='text/html' href='http://zhoupengylx.blogspot.com/2010/03/adito-standalone-agent-client.html' title='Adito standalone agent client'/><author><name>yellowstonemay</name><uri>http://www.blogger.com/profile/05670200739872876579</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4423160453611868821.post-5768651402339659505</id><published>2010-02-03T07:01:00.001-08:00</published><updated>2010-02-03T07:02:00.078-08:00</updated><title type='text'>how to use JExcel with spring 3 on google app engine</title><content type='html'>&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;First, i tried org.apache.poi. It works in local but throw exception when i upload it to google app engine. Then i have to to JExcel, it works well till now.&lt;/p&gt;  &lt;p&gt;step 1: setup your spring environment for your google app engine, please refer my previous article for this. &lt;/p&gt;  &lt;p&gt;step 2: download jexcelapi, what i used is jexcelapi_2_6_12. Then copy jxl.jar into war/WEB-INF/lib/ and add it to build path.&lt;/p&gt;  &lt;p&gt;step 3: configure web.xml to add spring configuration as below&lt;/p&gt;  &lt;pre class="csharpcode"&gt;    &amp;lt;servlet&amp;gt;&lt;br /&gt;        &amp;lt;servlet-name&amp;gt;web-dispatcher&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;        &amp;lt;servlet-&lt;span class="kwrd"&gt;class&lt;/span&gt;&amp;gt;org.springframework.web.servlet.DispatcherServlet&amp;lt;/servlet-&lt;span class="kwrd"&gt;class&lt;/span&gt;&amp;gt;&lt;br /&gt;        &amp;lt;load-on-startup&amp;gt;1&amp;lt;/load-on-startup&amp;gt;&lt;br /&gt;    &amp;lt;/servlet&amp;gt;&lt;br /&gt;    &amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;        &amp;lt;servlet-name&amp;gt;web-dispatcher&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;        &amp;lt;url-pattern&amp;gt;/&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;    &amp;lt;/servlet-mapping&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;step 4: create web-dispatcher-servlet.xml which is required by spring looks like below:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&amp;lt;?xml version=&lt;span class="str"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt; encoding=&lt;span class="str"&gt;&amp;quot;UTF-8&amp;quot;&lt;/span&gt;?&amp;gt;&lt;br /&gt;&amp;lt;beans xmlns=&lt;span class="str"&gt;&amp;quot;http://www.springframework.org/schema/beans&amp;quot;&lt;/span&gt;&lt;br /&gt;    xmlns:xsi=&lt;span class="str"&gt;&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&lt;/span&gt; xmlns:p=&lt;span class="str"&gt;&amp;quot;http://www.springframework.org/schema/p&amp;quot;&lt;/span&gt;&lt;br /&gt;    xmlns:context=&lt;span class="str"&gt;&amp;quot;http://www.springframework.org/schema/context&amp;quot;&lt;/span&gt;&lt;br /&gt;    xsi:schemaLocation=&lt;span class="str"&gt;&amp;quot;&lt;br /&gt;        http://www.springframework.org/schema/beans &lt;br /&gt;        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd&lt;br /&gt;        http://www.springframework.org/schema/context &lt;br /&gt;        http://www.springframework.org/schema/context/spring-context-3.0.xsd&amp;quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;context:component-scan &lt;span class="kwrd"&gt;base&lt;/span&gt;-package=&lt;span class="str"&gt;&amp;quot;com.zpylxapp.controller.html&amp;quot;&lt;/span&gt; /&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;bean id=&lt;span class="str"&gt;&amp;quot;viewResolver&amp;quot;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;class&lt;/span&gt;=&lt;span class="str"&gt;&amp;quot;org.springframework.web.servlet.view.ResourceBundleViewResolver&amp;quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;        &amp;lt;property name=&lt;span class="str"&gt;&amp;quot;basename&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt;=&lt;span class="str"&gt;&amp;quot;views&amp;quot;&lt;/span&gt; /&amp;gt;&lt;br /&gt;    &amp;lt;/bean&amp;gt;&lt;br /&gt;&amp;lt;/beans&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;step 5: create views.properties file under your “src” directory and add following configuration&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;xl.(&lt;span class="kwrd"&gt;class&lt;/span&gt;)=com.zpylxapp.excel.HomePage&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;step 6: create com.zpylxapp.excel.HomePage view class&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;package com.zpylxapp.excel;&lt;br /&gt;&lt;br /&gt;import java.util.List;&lt;br /&gt;import java.util.Map;&lt;br /&gt;&lt;br /&gt;import javax.servlet.http.HttpServletRequest;&lt;br /&gt;import javax.servlet.http.HttpServletResponse;&lt;br /&gt;&lt;br /&gt;import jxl.*;&lt;br /&gt;import jxl.write.Label;&lt;br /&gt;import jxl.write.WritableSheet;&lt;br /&gt;import jxl.write.WritableWorkbook;&lt;br /&gt;import org.springframework.web.servlet.view.document.AbstractJExcelView;&lt;br /&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; HomePage extends AbstractJExcelView {&lt;br /&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; buildExcelDocument(Map model, WritableWorkbook wb,&lt;br /&gt;            HttpServletRequest request, HttpServletResponse response)&lt;br /&gt;            throws Exception {&lt;br /&gt;        WritableSheet sheet = wb.createSheet(&lt;span class="str"&gt;&amp;quot;Spring&amp;quot;&lt;/span&gt;, 0);&lt;br /&gt;        sheet.addCell(&lt;span class="kwrd"&gt;new&lt;/span&gt; Label(0, 0, &lt;span class="str"&gt;&amp;quot;Spring-Excel jexcel&amp;quot;&lt;/span&gt;));&lt;br /&gt;        List words = (List) model.get(&lt;span class="str"&gt;&amp;quot;wordList&amp;quot;&lt;/span&gt;);&lt;br /&gt;        &lt;span class="kwrd"&gt;for&lt;/span&gt; (&lt;span class="kwrd"&gt;int&lt;/span&gt; i = 0; i &amp;lt; words.size(); i++) {&lt;br /&gt;            sheet.addCell(&lt;span class="kwrd"&gt;new&lt;/span&gt; Label(2 + i, 0, (String) words.get(i)));&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;step 7: create your controller use “&lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; ModelAndView(&lt;span class="str"&gt;&amp;quot;xl&amp;quot;&lt;/span&gt;, map);” as return&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;@Controller&lt;br /&gt;@RequestMapping(&lt;span class="str"&gt;&amp;quot;/inventory&amp;quot;&lt;/span&gt;)&lt;br /&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; InventoryController {&lt;br /&gt;&lt;br /&gt;    @RequestMapping(&lt;span class="kwrd"&gt;value&lt;/span&gt; = &lt;span class="str"&gt;&amp;quot;/{item}&amp;quot;&lt;/span&gt;, method = RequestMethod.GET)&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; ModelAndView getxls(Inventory item) {&lt;br /&gt;        &lt;br /&gt;        Map map = &lt;span class="kwrd"&gt;new&lt;/span&gt; HashMap();&lt;br /&gt;        List wordList = &lt;span class="kwrd"&gt;new&lt;/span&gt; ArrayList();&lt;br /&gt;        wordList.add(&lt;span class="str"&gt;&amp;quot;hello&amp;quot;&lt;/span&gt;);&lt;br /&gt;        wordList.add(&lt;span class="str"&gt;&amp;quot;world&amp;quot;&lt;/span&gt;);&lt;br /&gt;        map.put(&lt;span class="str"&gt;&amp;quot;wordList&amp;quot;&lt;/span&gt;, wordList);&lt;br /&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; ModelAndView(&lt;span class="str"&gt;&amp;quot;xl&amp;quot;&lt;/span&gt;, map);&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;step 8: done! try it in your google app engine.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4423160453611868821-5768651402339659505?l=zhoupengylx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zhoupengylx.blogspot.com/feeds/5768651402339659505/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zhoupengylx.blogspot.com/2010/02/how-to-use-jexcel-with-spring-3-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4423160453611868821/posts/default/5768651402339659505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4423160453611868821/posts/default/5768651402339659505'/><link rel='alternate' type='text/html' href='http://zhoupengylx.blogspot.com/2010/02/how-to-use-jexcel-with-spring-3-on.html' title='how to use JExcel with spring 3 on google app engine'/><author><name>yellowstonemay</name><uri>http://www.blogger.com/profile/05670200739872876579</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4423160453611868821.post-4485941054938176195</id><published>2010-02-01T19:57:00.001-08:00</published><updated>2010-02-01T19:57:36.240-08:00</updated><title type='text'>Iphone NSDate and NSDateComponents</title><content type='html'>&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a title="http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/DatesAndTimes/Articles/dtCalendars.html#//apple_ref/doc/uid/TP40003470-SW1" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/DatesAndTimes/Articles/dtCalendars.html#//apple_ref/doc/uid/TP40003470-SW1"&gt;http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/DatesAndTimes/Articles/dtCalendars.html#//apple_ref/doc/uid/TP40003470-SW1&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;1. use &lt;code&gt;&lt;a href="http://developer.apple.com/Reference/Foundation/Classes/NSCalendar_Class/Reference/NSCalendar.html#//apple_ref/occ/instm/NSCalendar/components:fromDate:toDate:options:"&gt;components:fromDate:toDate:options:&lt;/a&gt;&lt;/code&gt; to determine the temporal difference between two dates in units other than seconds (which you could calculate with the &lt;code&gt;NSDate&lt;/code&gt; method &lt;code&gt;&lt;a href="http://developer.apple.com/Reference/Foundation/Classes/NSDate_Class/Reference/Reference.html#//apple_ref/occ/instm/NSDate/timeIntervalSinceDate:"&gt;timeIntervalSinceDate&lt;/a&gt;&lt;/code&gt;&lt;/p&gt;  &lt;pre class="csharpcode"&gt;NSDate *startDate = ...; &lt;br /&gt;NSDate *endDate = ...; &lt;br /&gt;  &lt;br /&gt;NSCalendar *gregorian = [[NSCalendar alloc] &lt;br /&gt;                 initWithCalendarIdentifier:NSGregorianCalendar]; &lt;br /&gt;  &lt;br /&gt;NSUInteger unitFlags = NSMonthCalendarUnit | NSDayCalendarUnit; &lt;br /&gt;  &lt;br /&gt;NSDateComponents *components = [gregorian components:unitFlags &lt;br /&gt;                                          fromDate:startDate &lt;br /&gt;                                          toDate:endDate options:0]; &lt;br /&gt;NSInteger months = [components month]; &lt;br /&gt;NSInteger days = [components day]; &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font face="Courier New" color="#999999"&gt;2. use the &lt;code&gt;&lt;a href="http://developer.apple.com/Reference/Foundation/Classes/NSCalendar_Class/Reference/NSCalendar.html#//apple_ref/occ/instm/NSCalendar/dateByAddingComponents:toDate:options:"&gt;dateByAddingComponents:toDate:options:&lt;/a&gt;&lt;/code&gt; method to add components of a date (such as hours or months) to an existing date&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;NSDate *today = [[NSDate alloc] init]; &lt;br /&gt;NSDateComponents *offsetComponents = [[NSDateComponents alloc] init]; &lt;br /&gt;[offsetComponents setHour:1]; &lt;br /&gt;[offsetComponents setMinutes:30]; &lt;br /&gt;&lt;span class="rem"&gt;// Calculate when, according to Tom Lehrer, World War III will end &lt;/span&gt;&lt;br /&gt;NSDate *endOfWorldWar3 = [gregorian dateByAddingComponents:comps toDate:today options:0]; &lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4423160453611868821-4485941054938176195?l=zhoupengylx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zhoupengylx.blogspot.com/feeds/4485941054938176195/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zhoupengylx.blogspot.com/2010/02/iphone-nsdate-and-nsdatecomponents.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4423160453611868821/posts/default/4485941054938176195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4423160453611868821/posts/default/4485941054938176195'/><link rel='alternate' type='text/html' href='http://zhoupengylx.blogspot.com/2010/02/iphone-nsdate-and-nsdatecomponents.html' title='Iphone NSDate and NSDateComponents'/><author><name>yellowstonemay</name><uri>http://www.blogger.com/profile/05670200739872876579</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4423160453611868821.post-5342669546817438792</id><published>2010-01-14T20:46:00.001-08:00</published><updated>2010-01-14T20:46:54.339-08:00</updated><title type='text'>Goolge app engine +JPA+ java + spring + REST + JSON + Iphone</title><content type='html'>&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I have been inching to try out google app engine and its capabilities with &amp;quot;app engine + java + BlazeDS + Flex&amp;quot;, it works well on my personal website. But &amp;quot;remote object data accessing&amp;quot; is not suitable for client platform like Iphone and Android. I happend find a great topic talking about &amp;quot;&lt;a href="http://www.wetfeetblog.com/category/google-app-engine"&gt;app engine + java + spring + REST + JSON&lt;/a&gt;&amp;quot;, it does help me with my Planned Iphone preject. &lt;/p&gt;  &lt;p&gt;The end product will be spring mvc app running in google app engine handling GET, POST, PUT and DELETE http requests with JSON objects in and out utilizing JDO and seesions. And you can access it from you Iphone App.    &lt;br /&gt;So here you have it. Step by step.     &lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Part One&lt;/strong&gt;: Once you are finished with this article, you will be able to implement REST services in Google Apps Engine using JAVA, Spring 3.0 and JSON. &lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;strong&gt;Eclipse with google App engine&lt;/strong&gt;. I am using Eclipse, which is my favorite IDE. There is a lot of article about how to install Google App Engine on eclipse, and google also have great help doc here: &lt;a href="http://code.google.com/eclipse/docs/download.html"&gt;http://code.google.com/eclipse/docs/download.html&lt;/a&gt;. I believe you can get it done easily and finally you will got something like:       &lt;p&gt;&lt;img alt="" src="http://1.bp.blogspot.com/_lK7WLUR1JQA/S0n3gKhBrOI/AAAAAAAAAAg/Yrs8MU33MWE/s320/gae.jpg" border="0" /&gt;&lt;/p&gt;   &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Create a new google Web Application Project&lt;/strong&gt;: File -&amp;gt; new -&amp;gt; Web Application Project (google), and named it like &amp;quot;gae-json-iphone&amp;quot; &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Add Spring Support&lt;/strong&gt;.       &lt;p&gt;Go Download the latest version of Spring 3 from &lt;a href="http://www.springsource.org/download"&gt;http://www.springsource.org/download&lt;/a&gt;. For this tutorial we have downloaded spring-framework-3.0.0.RELEASE-with-docs.zip, which contains the documentation also. unzip it into a folder where you keep your java libs. Copy the following Jars into war\WEB-INF\llib directory:         &lt;br /&gt;1.&amp;#160;&amp;#160; org.springframework.asm-3.0.0.RELEASE.jar         &lt;br /&gt;2.&amp;#160;&amp;#160; org.springframework.beans-3.0.0.RELEASE.jar         &lt;br /&gt;3.&amp;#160;&amp;#160; org.springframework.context-3.0.0.RELEASE.jar         &lt;br /&gt;4.&amp;#160;&amp;#160; org.springframework.core-3.0.0.RELEASE.jar         &lt;br /&gt;5.&amp;#160;&amp;#160; org.springframework.expression-3.0.0.RELEASE.jar         &lt;br /&gt;6.&amp;#160;&amp;#160; org.springframework.oxm-3.0.0.RELEASE.jar         &lt;br /&gt;7.&amp;#160;&amp;#160; org.springframework.web-3.0.0.RELEASE.jar         &lt;br /&gt;8.&amp;#160;&amp;#160; org.springframework.web.servlet-3.0.0.RELEASE.jar :         &lt;br /&gt;Also grab your favorite version of &lt;a href="http://logging.apache.org/log4j/1.2/index.html"&gt;log4j.jar&lt;/a&gt; and &lt;a href="http://commons.apache.org/downloads/download_logging.cgi"&gt;commons-logging-1.1.1.jar&lt;/a&gt;. Remember to rename commons-logging-1.1.1.jar to something like commons-logging-1.1.jar, google app engine replaces this jar with its own version with crippled packages, by providing different name we keep both versions and make spring happy. see more &lt;a href="http://groups.google.com/group/google-appengine-java/browse_thread/thread/d88f23730971bb66/ae82095066350b29"&gt;why &lt;/a&gt;. Once you copied the jars, open project preferences and add those jars to the build library path:&lt;/p&gt;   &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;configuring spring. &lt;/strong&gt;      &lt;br /&gt;The final version should look like this:       &lt;pre class="csharpcode"&gt;&amp;lt;?xml version=&lt;span class="str"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt; encoding=&lt;span class="str"&gt;&amp;quot;utf-8&amp;quot;&lt;/span&gt;?&amp;gt;&lt;br /&gt;&amp;lt;web-app xmlns:xsi=&lt;span class="str"&gt;&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&lt;/span&gt;&lt;br /&gt;    xmlns=&lt;span class="str"&gt;&amp;quot;http://java.sun.com/xml/ns/javaee&amp;quot;&lt;/span&gt; xmlns:web=&lt;span class="str"&gt;&amp;quot;http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&amp;quot;&lt;/span&gt;&lt;br /&gt;    xsi:schemaLocation=&lt;span class="str"&gt;&amp;quot;http://java.sun.com/xml/ns/javaee&lt;br /&gt;http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&amp;quot;&lt;/span&gt;&lt;br /&gt;    version=&lt;span class="str"&gt;&amp;quot;2.5&amp;quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;    &amp;lt;context-param&amp;gt;&lt;br /&gt;        &amp;lt;param-name&amp;gt;log4jConfigLocation&amp;lt;/param-name&amp;gt;&lt;br /&gt;        &amp;lt;param-&lt;span class="kwrd"&gt;value&lt;/span&gt;&amp;gt;/WEB-INF/log4j.properties&amp;lt;/param-&lt;span class="kwrd"&gt;value&lt;/span&gt;&amp;gt;&lt;br /&gt;    &amp;lt;/context-param&amp;gt;&lt;br /&gt;    &amp;lt;listener&amp;gt;&lt;br /&gt;        &amp;lt;listener-&lt;span class="kwrd"&gt;class&lt;/span&gt;&amp;gt;org.springframework.web.util.Log4jConfigListener&amp;lt;/listener-&lt;span class="kwrd"&gt;class&lt;/span&gt;&amp;gt;&lt;br /&gt;    &amp;lt;/listener&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;servlet&amp;gt;&lt;br /&gt;        &amp;lt;servlet-name&amp;gt;rest-json&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;        &amp;lt;servlet-&lt;span class="kwrd"&gt;class&lt;/span&gt;&amp;gt;org.springframework.web.servlet.DispatcherServlet&amp;lt;/servlet-&lt;span class="kwrd"&gt;class&lt;/span&gt;&amp;gt;&lt;br /&gt;        &amp;lt;load-on-startup&amp;gt;1&amp;lt;/load-on-startup&amp;gt;&lt;br /&gt;    &amp;lt;/servlet&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;        &amp;lt;servlet-name&amp;gt;rest-json&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;        &amp;lt;url-pattern&amp;gt;/api/*&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;    &amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;welcome-file-list&amp;gt;&lt;br /&gt;        &amp;lt;welcome-file&amp;gt;index.html&amp;lt;/welcome-file&amp;gt;&lt;br /&gt;    &amp;lt;/welcome-file-list&amp;gt;&lt;br /&gt;&amp;lt;/web-app&amp;gt;&lt;/pre&gt;&lt;br /&gt;    &lt;style type="text/css"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;&lt;strong&gt;Add JSON support&lt;/strong&gt;. -- Jackson JSON.&lt;a href="http://jackson.codehaus.org/"&gt;Grab the library from here&lt;/a&gt; and put jackson-core-1.4.jar and jackson-mapper-1.4.jar file into projects WEB-INF/lib directory &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;&lt;strong&gt;Configure Spring&lt;/strong&gt; &lt;br /&gt;&lt;br /&gt;    &lt;p&gt;To configure Spring servlet we need to create servletname-servlet.xml file for spring bean configuration. Our file has to be named &lt;b&gt;rest-json-servlet.xml&lt;/b&gt;.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre class="csharpcode"&gt;&amp;lt;?xml version=&lt;span class="str"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt; encoding=&lt;span class="str"&gt;&amp;quot;UTF-8&amp;quot;&lt;/span&gt;?&amp;gt;&lt;br /&gt;&amp;lt;beans xmlns=&lt;span class="str"&gt;&amp;quot;http://www.springframework.org/schema/beans&amp;quot;&lt;/span&gt;&lt;br /&gt;    xmlns:xsi=&lt;span class="str"&gt;&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&lt;/span&gt; xmlns:p=&lt;span class="str"&gt;&amp;quot;http://www.springframework.org/schema/p&amp;quot;&lt;/span&gt;&lt;br /&gt;    xmlns:context=&lt;span class="str"&gt;&amp;quot;http://www.springframework.org/schema/context&amp;quot;&lt;/span&gt;&lt;br /&gt;    xsi:schemaLocation=&lt;span class="str"&gt;&amp;quot;&lt;br /&gt;        http://www.springframework.org/schema/beans &lt;br /&gt;        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd&lt;br /&gt;        http://www.springframework.org/schema/context &lt;br /&gt;        http://www.springframework.org/schema/context/spring-context-3.0.xsd&amp;quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;!--&lt;br /&gt;        tell String to scan “com.zpylxapp.iphone” package &lt;span class="kwrd"&gt;for&lt;/span&gt; any bean&lt;br /&gt;        annotations&lt;br /&gt;    --&amp;gt;&lt;br /&gt;    &amp;lt;context:component-scan &lt;span class="kwrd"&gt;base&lt;/span&gt;-package=&lt;span class="str"&gt;&amp;quot;com.zpylxapp.iphone&amp;quot;&lt;/span&gt; /&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;!--&lt;br /&gt;        define message converter to convert messages sent to the server into&lt;br /&gt;        beans &lt;span class="kwrd"&gt;using&lt;/span&gt; MappingJacksonHttpMessageConverter&lt;br /&gt;    --&amp;gt;&lt;br /&gt;    &amp;lt;bean&lt;br /&gt;        &lt;span class="kwrd"&gt;class&lt;/span&gt;=&lt;span class="str"&gt;&amp;quot;org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter&amp;quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;        &amp;lt;property name=&lt;span class="str"&gt;&amp;quot;messageConverters&amp;quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;            &amp;lt;list&amp;gt;&lt;br /&gt;                &amp;lt;&lt;span class="kwrd"&gt;ref&lt;/span&gt; bean=&lt;span class="str"&gt;&amp;quot;jsonHttpMessageConverter&amp;quot;&lt;/span&gt; /&amp;gt;&lt;br /&gt;            &amp;lt;/list&amp;gt;&lt;br /&gt;        &amp;lt;/property&amp;gt;&lt;br /&gt;    &amp;lt;/bean&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;bean id=&lt;span class="str"&gt;&amp;quot;jsonHttpMessageConverter&amp;quot;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;class&lt;/span&gt;=&lt;span class="str"&gt;&amp;quot;org.springframework.http.converter.json.MappingJacksonHttpMessageConverter&amp;quot;&lt;/span&gt; /&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;!--&lt;br /&gt;        tells spring to render messages sent from the server to the client&lt;br /&gt;        &lt;span class="kwrd"&gt;using&lt;/span&gt; JsonView&lt;br /&gt;    --&amp;gt;&lt;br /&gt;    &amp;lt;bean &lt;span class="kwrd"&gt;class&lt;/span&gt;=&lt;span class="str"&gt;&amp;quot;org.springframework.web.servlet.view.ContentNegotiatingViewResolver&amp;quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;        &amp;lt;property name=&lt;span class="str"&gt;&amp;quot;mediaTypes&amp;quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;            &amp;lt;map&amp;gt;&lt;br /&gt;                &amp;lt;entry key=&lt;span class="str"&gt;&amp;quot;json&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt;=&lt;span class="str"&gt;&amp;quot;application/json&amp;quot;&lt;/span&gt; /&amp;gt;&lt;br /&gt;            &amp;lt;/map&amp;gt;&lt;br /&gt;        &amp;lt;/property&amp;gt;&lt;br /&gt;        &amp;lt;property name=&lt;span class="str"&gt;&amp;quot;defaultContentType&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt;=&lt;span class="str"&gt;&amp;quot;application/json&amp;quot;&lt;/span&gt; /&amp;gt;&lt;br /&gt;        &amp;lt;property name=&lt;span class="str"&gt;&amp;quot;defaultViews&amp;quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;            &amp;lt;list&amp;gt;&lt;br /&gt;                &amp;lt;bean &lt;span class="kwrd"&gt;class&lt;/span&gt;=&lt;span class="str"&gt;&amp;quot;org.springframework.web.servlet.view.json.MappingJacksonJsonView&amp;quot;&lt;/span&gt; /&amp;gt;&lt;br /&gt;            &amp;lt;/list&amp;gt;&lt;br /&gt;        &amp;lt;/property&amp;gt;&lt;br /&gt;    &amp;lt;/bean&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/beans&amp;gt;&lt;/pre&gt;&lt;br /&gt;    &lt;style type="text/css"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Part Two: Using JPA with App Engine&lt;/strong&gt;. GAE support both JDO and JPA. I use JPA here. see detail of GAE JPA &lt;a href="http://code.google.com/appengine/docs/java/datastore/usingjpa.html"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;  &lt;li&gt;Creating the persistence.xml File. The JPA interface needs a configuration file named &lt;code&gt;persistence.xml&lt;/code&gt; . You can create this file in /src/META-INF/&lt;code&gt;persistence.xml&lt;/code&gt; : &lt;br /&gt;&lt;br /&gt;    &lt;pre class="csharpcode"&gt;&amp;lt;?xml version=&lt;span class="str"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt; encoding=&lt;span class="str"&gt;&amp;quot;UTF-8&amp;quot;&lt;/span&gt; ?&amp;gt; &lt;br /&gt;&amp;lt;persistence xmlns=&lt;span class="str"&gt;&amp;quot;http://java.sun.com/xml/ns/persistence&amp;quot;&lt;/span&gt; &lt;br /&gt;    xmlns:xsi=&lt;span class="str"&gt;&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&lt;/span&gt; &lt;br /&gt;    xsi:schemaLocation=&lt;span class="str"&gt;&amp;quot;http://java.sun.com/xml/ns/persistence &lt;br /&gt;        http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd&amp;quot;&lt;/span&gt; version=&lt;span class="str"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt;&amp;gt; &lt;br /&gt; &lt;br /&gt;    &amp;lt;persistence-unit name=&lt;span class="str"&gt;&amp;quot;transactions-optional&amp;quot;&lt;/span&gt;&amp;gt; &lt;br /&gt;        &amp;lt;provider&amp;gt;org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider&amp;lt;/provider&amp;gt; &lt;br /&gt;        &amp;lt;properties&amp;gt; &lt;br /&gt;            &amp;lt;property name=&lt;span class="str"&gt;&amp;quot;datanucleus.NontransactionalRead&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt;=&lt;span class="str"&gt;&amp;quot;true&amp;quot;&lt;/span&gt;/&amp;gt; &lt;br /&gt;            &amp;lt;property name=&lt;span class="str"&gt;&amp;quot;datanucleus.NontransactionalWrite&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt;=&lt;span class="str"&gt;&amp;quot;true&amp;quot;&lt;/span&gt;/&amp;gt; &lt;br /&gt;            &amp;lt;property name=&lt;span class="str"&gt;&amp;quot;datanucleus.ConnectionURL&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt;=&lt;span class="str"&gt;&amp;quot;appengine&amp;quot;&lt;/span&gt;/&amp;gt; &lt;br /&gt;        &amp;lt;/properties&amp;gt; &lt;br /&gt;    &amp;lt;/persistence-unit&amp;gt; &lt;br /&gt; &lt;br /&gt;&amp;lt;/persistence&amp;gt;&lt;/pre&gt;&lt;br /&gt;    &lt;style type="text/css"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Getting an EntityManager Instance. &lt;br /&gt;    &lt;p&gt;An app interacts with JPA using an instance of the EntityManager class. You get this instance by instantiating and calling a method on an instance of the EntityManagerFactory class. The factory uses the JPA configuration (identified by the name &lt;code&gt;&amp;quot;transactions-optional&amp;quot;&lt;/code&gt;) to create EntityManager instances.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;    &lt;p&gt;Because an EntityManagerFactory instance takes time to initialize, it's a good idea to reuse a single instance as much as possible. An easy way to do this is to create a singleton wrapper class with a static instance, as follows:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;    &lt;p&gt;&lt;code&gt;&lt;b&gt;EMF.java&lt;/b&gt;&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre class="csharpcode"&gt;import javax.persistence.EntityManagerFactory; &lt;br /&gt;import javax.persistence.Persistence; &lt;br /&gt; &lt;br /&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; final &lt;span class="kwrd"&gt;class&lt;/span&gt; EMF { &lt;br /&gt;    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; final EntityManagerFactory emfInstance = &lt;br /&gt;        Persistence.createEntityManagerFactory(&lt;span class="str"&gt;&amp;quot;transactions-optional&amp;quot;&lt;/span&gt;); &lt;br /&gt; &lt;br /&gt;    &lt;span class="kwrd"&gt;private&lt;/span&gt; EMF() {} &lt;br /&gt; &lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; EntityManagerFactory get() { &lt;br /&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; emfInstance; &lt;br /&gt;    } &lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;    &lt;style type="text/css"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;User bean to support permissions. &lt;br /&gt;    &lt;pre class="csharpcode"&gt;package com.zpylxapp.iphone;&lt;br /&gt;&lt;br /&gt;import javax.persistence.Entity;&lt;br /&gt;import javax.persistence.GeneratedValue;&lt;br /&gt;import javax.persistence.GenerationType;&lt;br /&gt;import javax.persistence.Id;&lt;br /&gt;&lt;br /&gt;@Entity&lt;br /&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; User {&lt;br /&gt;&lt;br /&gt;    @Id&lt;br /&gt;    @GeneratedValue(strategy = GenerationType.IDENTITY)&lt;br /&gt;    &lt;span class="kwrd"&gt;private&lt;/span&gt; Long id;&lt;br /&gt;    &lt;span class="kwrd"&gt;private&lt;/span&gt; String email;&lt;br /&gt;    &lt;span class="kwrd"&gt;private&lt;/span&gt; String name;&lt;br /&gt;    &lt;span class="kwrd"&gt;private&lt;/span&gt; String password;&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;long&lt;/span&gt; getId() {&lt;br /&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; id;&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; setId(&lt;span class="kwrd"&gt;long&lt;/span&gt; id) {&lt;br /&gt;        &lt;span class="kwrd"&gt;this&lt;/span&gt;.id = id;&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; String getEmail() {&lt;br /&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; email;&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; setEmail(String email) {&lt;br /&gt;        &lt;span class="kwrd"&gt;this&lt;/span&gt;.email = email;&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; String getName() {&lt;br /&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; name;&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; setName(String name) {&lt;br /&gt;        &lt;span class="kwrd"&gt;this&lt;/span&gt;.name = name;&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; setPassword(String password) {&lt;br /&gt;        &lt;span class="kwrd"&gt;this&lt;/span&gt;.password = password;&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; String getPassword() {&lt;br /&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; password;&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;    &lt;style type="text/css"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Implement Login Controller. (for POST request “/login”) &lt;br /&gt;    &lt;pre class="csharpcode"&gt;package com.zpylxapp.iphone;&lt;br /&gt;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;import java.util.List;&lt;br /&gt;&lt;br /&gt;import javax.persistence.EntityManager;&lt;br /&gt;import javax.servlet.http.HttpServletRequest;&lt;br /&gt;&lt;br /&gt;import org.apache.log4j.Logger;&lt;br /&gt;import org.springframework.stereotype.Controller;&lt;br /&gt;import org.springframework.web.bind.annotation.ModelAttribute;&lt;br /&gt;import org.springframework.web.bind.annotation.RequestBody;&lt;br /&gt;import org.springframework.web.bind.annotation.RequestMapping;&lt;br /&gt;import org.springframework.web.bind.annotation.RequestMethod;&lt;br /&gt;&lt;br /&gt;import com.zpylxapp.jpa.*;&lt;br /&gt;&lt;br /&gt;@Controller&lt;br /&gt;@RequestMapping(&lt;span class="str"&gt;&amp;quot;/login&amp;quot;&lt;/span&gt;)&lt;br /&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; LoginController {&lt;br /&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; Logger logger = Logger.getLogger( LoginController.&lt;span class="kwrd"&gt;class&lt;/span&gt; );&lt;br /&gt;&lt;br /&gt;    @SuppressWarnings(&lt;span class="str"&gt;&amp;quot;unchecked&amp;quot;&lt;/span&gt;)&lt;br /&gt;    @ModelAttribute(&lt;span class="str"&gt;&amp;quot;user&amp;quot;&lt;/span&gt;)&lt;br /&gt;    @RequestMapping(&lt;span class="kwrd"&gt;value&lt;/span&gt; = &lt;span class="str"&gt;&amp;quot;/&amp;quot;&lt;/span&gt;, method = RequestMethod.POST)&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; User login( @RequestBody User user, HttpServletRequest request ) throws IOException {&lt;br /&gt;            logger.debug(user);&lt;br /&gt;            &lt;br /&gt;            &lt;span class="rem"&gt;// Hardcoded for demo website&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;if&lt;/span&gt;( user.getName().equalsIgnoreCase(&lt;span class="str"&gt;&amp;quot;user1&amp;quot;&lt;/span&gt;) &amp;amp;&amp;amp; user.getPassword().equals(&lt;span class="str"&gt;&amp;quot;password1&amp;quot;&lt;/span&gt;) ) {&lt;br /&gt;                    user.setId(1001);&lt;br /&gt;                    user.setEmail(&lt;span class="str"&gt;&amp;quot;fake@email.com&amp;quot;&lt;/span&gt;);&lt;br /&gt;                    &lt;span class="rem"&gt;//set user session to check if user login or not.Even it is RESTful, we still need &amp;quot;Session&amp;quot;&lt;/span&gt;&lt;br /&gt;                    request.getSession(&lt;span class="kwrd"&gt;true&lt;/span&gt;).setAttribute( Constants.SESSION_USER , user);&lt;br /&gt;                    &lt;span class="kwrd"&gt;return&lt;/span&gt; user;&lt;br /&gt;            }&lt;br /&gt;            &lt;br /&gt;            EntityManager em = EMF.get().createEntityManager();&lt;br /&gt;            List&amp;lt;User&amp;gt; users;&lt;br /&gt;            &lt;span class="kwrd"&gt;try&lt;/span&gt; {             &lt;br /&gt;                javax.persistence.Query query = em.createQuery(&lt;span class="str"&gt;&amp;quot;select p from User p &amp;quot;&lt;/span&gt;);&lt;br /&gt;                users = (List&amp;lt;User&amp;gt;)query.getResultList();&lt;br /&gt;                &lt;span class="kwrd"&gt;if&lt;/span&gt;(users.size()&amp;gt;0)&lt;br /&gt;                    &lt;span class="kwrd"&gt;return&lt;/span&gt; users.get(0);&lt;br /&gt;            } &lt;span class="kwrd"&gt;finally&lt;/span&gt; {&lt;br /&gt;                em.close();&lt;br /&gt;            }&lt;br /&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;null&lt;/span&gt;;&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;    &lt;style type="text/css"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Add a preHandle interceptor, to check only if the user is present in the session. If no user is present and user is not trying to log in, send back an error. lets code our interceptor. I named it SessionInerceptor: &lt;br /&gt;    &lt;pre class="csharpcode"&gt;package com.zpylxapp.iphone;&lt;br /&gt;&lt;br /&gt;import javax.servlet.http.HttpServletRequest;&lt;br /&gt;import javax.servlet.http.HttpServletResponse;&lt;br /&gt;&lt;br /&gt;import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; SessionInterceptor extends HandlerInterceptorAdapter {&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; boolean preHandle(HttpServletRequest request,&lt;br /&gt;            HttpServletResponse response, Object handler) throws Exception {&lt;br /&gt;        User user = (User) request.getSession().getAttribute(&lt;br /&gt;                Constants.SESSION_USER);&lt;br /&gt;        String uri = request.getRequestURI();&lt;br /&gt;        String &lt;span class="kwrd"&gt;base&lt;/span&gt; = request.getContextPath();&lt;br /&gt;        uri = uri.substring(&lt;span class="kwrd"&gt;base&lt;/span&gt;.length());&lt;br /&gt;        &lt;span class="kwrd"&gt;if&lt;/span&gt; (user == &lt;span class="kwrd"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; !uri.startsWith(&lt;span class="str"&gt;&amp;quot;/api/login&amp;quot;&lt;/span&gt;)) {&lt;br /&gt;            request.getSession().invalidate();&lt;br /&gt;            response.setContentType(&lt;span class="str"&gt;&amp;quot;application/json&amp;quot;&lt;/span&gt;);&lt;br /&gt;            response.getWriter().write(&lt;span class="str"&gt;&amp;quot;{\&amp;quot;error\&amp;quot;:\&amp;quot;SESSION-EXPIRED\&amp;quot;}&amp;quot;&lt;/span&gt;);&lt;br /&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;false&lt;/span&gt;;&lt;br /&gt;        }&lt;br /&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;true&lt;/span&gt;;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;    &lt;style type="text/css"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;    &lt;p&gt;Now lets add this interceptor to the Spring MVC stack by adding these 5 lines to our rest-json-flex-servlet.xml file.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre class="csharpcode"&gt;&amp;lt;bean &lt;span class="kwrd"&gt;class&lt;/span&gt;=&lt;span class="str"&gt;&amp;quot;org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping&amp;quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;        &amp;lt;property name=&lt;span class="str"&gt;&amp;quot;interceptors&amp;quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;                &amp;lt;bean &lt;span class="kwrd"&gt;class&lt;/span&gt;=&lt;span class="str"&gt;&amp;quot;com.lureto.rjf.SessionInterceptor&amp;quot;&lt;/span&gt;/&amp;gt;&lt;br /&gt;        &amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;/bean&amp;gt;&lt;/pre&gt;&lt;br /&gt;    &lt;style type="text/css"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;    &lt;p&gt;One more thing – we need to enable session in google app engine. Add this line to your appengine-web.xml.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre class="csharpcode"&gt;&amp;lt;sessions-enabled&amp;gt;&lt;span class="kwrd"&gt;true&lt;/span&gt;&amp;lt;/sessions-enabled&amp;gt;&lt;/pre&gt;&lt;br /&gt;    &lt;style type="text/css"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;    &lt;p&gt;sessions are backed up by the datastore, you should be able to see the session data using the Data Viewer in the Admin Console. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;    &lt;p&gt;work on java part is already done. Let us move to Iphone client.&lt;/p&gt;&lt;br /&gt;    &lt;style type="text/css"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Part Three: Using JPA with App Engine&lt;/strong&gt;. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;  &lt;li&gt;To use JSON in Iphone, you need third part library like &lt;a href="http://code.google.com/p/json-framework/"&gt;json-framework&lt;/a&gt;. Download JSON_2.2.2.dmg and open it, then drag the JSON directory into your project. &lt;br /&gt;&lt;br /&gt;    &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_lK7WLUR1JQA/S0_zM3y6QgI/AAAAAAAAABk/z5SGZWfjfzc/s1600-h/Picture_7%5B7%5D.png"&gt;&lt;img title="Picture_7" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="259" alt="Picture_7" src="http://lh6.ggpht.com/_lK7WLUR1JQA/S0_zNBWmDxI/AAAAAAAAABo/EBAF9ijVD5E/Picture_7_thumb%5B3%5D.png?imgmax=800" width="352" border="0" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Create a view based iphone project, add button and textfield as following: &lt;br /&gt;    &lt;p&gt;&amp;#160;&lt;a href="http://lh3.ggpht.com/_lK7WLUR1JQA/S0_zNYuS72I/AAAAAAAAABs/UPsMLJIBuS8/s1600-h/Picture_8%5B4%5D.png"&gt;&lt;img title="Picture_8" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="309" alt="Picture_8" src="http://lh3.ggpht.com/_lK7WLUR1JQA/S0_zN_MIrBI/AAAAAAAAABw/L0mwI177g7U/Picture_8_thumb%5B2%5D.png?imgmax=800" width="206" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;    &lt;p&gt;&amp;#160;&lt;/p&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Handler to the “login” button is as below. which will get user/password from user input and encapsulate them in a JSON post request. If the user is invalid, give an alert window. If it is valid, the response is a NSDictionary type. It will be display in another TableView based page. &lt;br /&gt;    &lt;pre class="csharpcode"&gt;-(IBAction)sendLogin:(id)sender{&lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;//prepare json data&lt;/span&gt;&lt;br /&gt;NSString *username = tfUsername.text;&lt;br /&gt;NSString *password = tfPassword.text;&lt;br /&gt;&lt;br /&gt;NSDictionary *data = [[NSDictionary alloc] initWithObjectsAndKeys:&lt;br /&gt;username, USERNAMEKEY,&lt;br /&gt;password, PASSWORDKEY,&lt;br /&gt;  nil];&lt;br /&gt;SBJsonWriter *json = [SBJsonWriter alloc];&lt;br /&gt;NSString *jsonString = [json stringWithObject:data];&lt;br /&gt;NSLog(jsonString);&lt;br /&gt;&lt;br /&gt;[data release];&lt;br /&gt;[json release];&lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;//create/send http post request&lt;/span&gt;&lt;br /&gt;NSData *postData = [jsonString dataUsingEncoding:NSASCIIStringEncoding];&lt;br /&gt;&lt;br /&gt;NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];&lt;br /&gt;[request setURL:[NSURL URLWithString:&lt;span class="str"&gt;@&amp;quot;http://zpylxrealtors.appspot.com/api/login/&amp;quot;&lt;/span&gt;]];&lt;br /&gt;[request setHTTPMethod:&lt;span class="str"&gt;@&amp;quot;POST&amp;quot;&lt;/span&gt;];&lt;br /&gt;[request setValue:&lt;span class="str"&gt;@&amp;quot;application/json&amp;quot;&lt;/span&gt; forHTTPHeaderField:&lt;span class="str"&gt;@&amp;quot;Content-Type&amp;quot;&lt;/span&gt;];&lt;br /&gt;[request setHTTPBody:postData];&lt;br /&gt;&lt;br /&gt;NSURLResponse *urlResponse;&lt;br /&gt;NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&amp;amp;urlResponse error:nil];&lt;br /&gt;[request release];&lt;br /&gt;NSString *jsonData = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];&lt;br /&gt;NSLog(jsonData);&lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;//parse response json data&lt;/span&gt;&lt;br /&gt;&lt;span class="rem"&gt;// Create a dictionary from the JSON string&lt;/span&gt;&lt;br /&gt;@&lt;span class="kwrd"&gt;try&lt;/span&gt; {&lt;br /&gt;NSDictionary *response = [jsonData JSONValue];&lt;br /&gt;id user = [response objectForKey:&lt;span class="str"&gt;@&amp;quot;user&amp;quot;&lt;/span&gt;];&lt;br /&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt;(user != nil &amp;amp;&amp;amp; [user isKindOfClass:[NSDictionary &lt;span class="kwrd"&gt;class&lt;/span&gt;]]){&lt;br /&gt;&lt;span class="rem"&gt;//go to next view&lt;/span&gt;&lt;br /&gt;UserListViewController *nextview = [[UserListViewController alloc] initWithStyle:UITableViewStyleGrouped];&lt;br /&gt;nextview.user = user;&lt;br /&gt;[self presentModalViewController:nextview animated:YES];&lt;br /&gt;[nextview release];&lt;br /&gt;}&lt;br /&gt;&lt;span class="kwrd"&gt;else&lt;/span&gt;{&lt;br /&gt;&lt;span class="rem"&gt;//alert &lt;/span&gt;&lt;br /&gt;UIAlertView *myAlert = [[UIAlertView alloc] initWithTitle:&lt;span class="str"&gt;@&amp;quot;Error&amp;quot;&lt;/span&gt; &lt;br /&gt;  message:&lt;span class="str"&gt;@&amp;quot;invalid user/password!&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;delegate&lt;/span&gt;:nil &lt;br /&gt;cancelButtonTitle:nil otherButtonTitles:&lt;span class="str"&gt;@&amp;quot;OK&amp;quot;&lt;/span&gt;, nil];&lt;br /&gt;[myAlert show];&lt;br /&gt;[myAlert release];&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;@&lt;span class="kwrd"&gt;catch&lt;/span&gt; (NSException * e) {&lt;br /&gt;&lt;span class="rem"&gt;//nothing to do here, just provent to crash when google location search does not work&lt;/span&gt;&lt;br /&gt;NSLog(&lt;span class="str"&gt;@&amp;quot;NSException: ....&amp;quot;&lt;/span&gt;);&lt;br /&gt;}&lt;br /&gt;@&lt;span class="kwrd"&gt;finally&lt;/span&gt; {&lt;br /&gt;[jsonData release];&lt;br /&gt;}&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;    &lt;style type="text/css"&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;delegation code for the table view: &lt;br /&gt;    &lt;pre class="csharpcode"&gt;@&lt;span class="kwrd"&gt;interface&lt;/span&gt; UserListViewController : UITableViewController {&lt;br /&gt;NSDictionary *user;&lt;br /&gt;}&lt;br /&gt;@property(nonatomic, retain) NSDictionary *user;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;……………&lt;br /&gt;&lt;br /&gt;&lt;span class="preproc"&gt;#pragma&lt;/span&gt; mark Table view methods&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {&lt;br /&gt;    &lt;span class="kwrd"&gt;return&lt;/span&gt; 1;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;// Customize the number of rows in the table view.&lt;/span&gt;&lt;br /&gt;- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {&lt;br /&gt;    &lt;span class="kwrd"&gt;return&lt;/span&gt; 3;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;// Customize the appearance of table view cells.&lt;/span&gt;&lt;br /&gt;- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {&lt;br /&gt;    &lt;br /&gt;    &lt;span class="kwrd"&gt;static&lt;/span&gt; NSString *CellIdentifier = &lt;span class="str"&gt;@&amp;quot;Cell&amp;quot;&lt;/span&gt;;&lt;br /&gt;    &lt;br /&gt;    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];&lt;br /&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (cell == nil) {&lt;br /&gt;        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:CellIdentifier] autorelease];&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    &lt;span class="rem"&gt;// Set up the cell...&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt;(indexPath.row == 0){&lt;br /&gt;cell.textLabel.text = &lt;span class="str"&gt;@&amp;quot;name&amp;quot;&lt;/span&gt;;&lt;br /&gt;cell.detailTextLabel.text = [user objectForKey:&lt;span class="str"&gt;@&amp;quot;name&amp;quot;&lt;/span&gt;];&lt;br /&gt;}&lt;br /&gt;&lt;span class="kwrd"&gt;else&lt;/span&gt; &lt;span class="kwrd"&gt;if&lt;/span&gt;(indexPath.row == 1){&lt;br /&gt;cell.textLabel.text = &lt;span class="str"&gt;@&amp;quot;id&amp;quot;&lt;/span&gt;;&lt;br /&gt;cell.detailTextLabel.text = [NSString stringWithFormat:&lt;span class="str"&gt;@&amp;quot;%d&amp;quot;&lt;/span&gt;, [user objectForKey:&lt;span class="str"&gt;@&amp;quot;id&amp;quot;&lt;/span&gt;]];&lt;br /&gt;}&lt;br /&gt;&lt;span class="kwrd"&gt;else&lt;/span&gt;{&lt;br /&gt;cell.textLabel.text = &lt;span class="str"&gt;@&amp;quot;email&amp;quot;&lt;/span&gt;;&lt;br /&gt;cell.detailTextLabel.text = [user objectForKey:&lt;span class="str"&gt;@&amp;quot;email&amp;quot;&lt;/span&gt;];&lt;br /&gt;}&lt;br /&gt;    &lt;span class="kwrd"&gt;return&lt;/span&gt; cell;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;    &lt;style type="text/css"&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;result page: &lt;br /&gt;    &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_lK7WLUR1JQA/S0_zOKqQShI/AAAAAAAAAB0/D7doHklyH3g/s1600-h/Picture_9%5B3%5D.png"&gt;&lt;img title="Picture_9" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="321" alt="Picture_9" src="http://lh3.ggpht.com/_lK7WLUR1JQA/S0_zOiu9DZI/AAAAAAAAAB4/yR8mNEnQRaE/Picture_9_thumb%5B1%5D.png?imgmax=800" width="218" border="0" /&gt;&lt;/a&gt; &lt;a href="http://lh3.ggpht.com/_lK7WLUR1JQA/S0_zPNWb2dI/AAAAAAAAAB8/kyg4VABA428/s1600-h/Picture_10%5B3%5D.png"&gt;&lt;img title="Picture_10" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="319" alt="Picture_10" src="http://lh3.ggpht.com/_lK7WLUR1JQA/S0_zPXACOgI/AAAAAAAAACA/b_krvL9izgU/Picture_10_thumb%5B1%5D.png?imgmax=800" width="215" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;    &lt;p&gt;&amp;#160;&lt;/p&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4423160453611868821-5342669546817438792?l=zhoupengylx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zhoupengylx.blogspot.com/feeds/5342669546817438792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zhoupengylx.blogspot.com/2010/01/goolge-app-engine-jpa-java-spring-rest.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4423160453611868821/posts/default/5342669546817438792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4423160453611868821/posts/default/5342669546817438792'/><link rel='alternate' type='text/html' href='http://zhoupengylx.blogspot.com/2010/01/goolge-app-engine-jpa-java-spring-rest.html' title='Goolge app engine +JPA+ java + spring + REST + JSON + Iphone'/><author><name>yellowstonemay</name><uri>http://www.blogger.com/profile/05670200739872876579</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_lK7WLUR1JQA/S0n3gKhBrOI/AAAAAAAAAAg/Yrs8MU33MWE/s72-c/gae.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4423160453611868821.post-4392136386993721799</id><published>2010-01-10T19:56:00.000-08:00</published><updated>2010-01-31T15:27:38.452-08:00</updated><title type='text'>using xmpp in google app engine</title><content type='html'>&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;To enable the XMPP service for a Java app, edit the &lt;code&gt;appengine-web.xml&lt;/code&gt; file and include the following lines:&lt;/p&gt;  &lt;pre&gt;&amp;#160; &amp;lt;inbound-services&amp;gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;service&amp;gt;xmpp_message&amp;lt;/service&amp;gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/inbound-services&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;With the XMPP service enabled, when App Engine receives a chat message for the app, it makes an HTTP POST request to the following URL path:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;code&gt;/_ah/xmpp/message/chat/&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;To handle incoming messages, you simply create a request handler that accepts POST requests at this URL path.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;package com.zpylxapp.xmpp;&lt;br /&gt;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;&lt;br /&gt;import javax.servlet.http.HttpServlet;&lt;br /&gt;import javax.servlet.http.HttpServletRequest;&lt;br /&gt;import javax.servlet.http.HttpServletResponse;&lt;br /&gt;&lt;br /&gt;import com.google.appengine.api.xmpp.JID;&lt;br /&gt;import com.google.appengine.api.xmpp.Message;&lt;br /&gt;import com.google.appengine.api.xmpp.MessageBuilder;&lt;br /&gt;import com.google.appengine.api.xmpp.XMPPService;&lt;br /&gt;import com.google.appengine.api.xmpp.XMPPServiceFactory;&lt;br /&gt;&lt;br /&gt;@SuppressWarnings(&lt;span class="str"&gt;&amp;quot;serial&amp;quot;&lt;/span&gt;)&lt;br /&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; XMPPReceiverServlet extends HttpServlet {&lt;br /&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; doPost(HttpServletRequest req, HttpServletResponse res)&lt;br /&gt;            throws IOException {&lt;br /&gt;        XMPPService xmpp = XMPPServiceFactory.getXMPPService();&lt;br /&gt;        Message message = xmpp.parseMessage(req);&lt;br /&gt;&lt;br /&gt;        JID fromJid = message.getFromJid();&lt;br /&gt;        String body = message.getBody();&lt;br /&gt;&lt;br /&gt;        System.&lt;span class="kwrd"&gt;out&lt;/span&gt;.println(body + fromJid);&lt;br /&gt;&lt;br /&gt;        &lt;span class="rem"&gt;// Create a response&lt;/span&gt;&lt;br /&gt;        String response = &lt;span class="str"&gt;&amp;quot;echo: &amp;quot;&lt;/span&gt; + body;&lt;br /&gt;        System.&lt;span class="kwrd"&gt;out&lt;/span&gt;.println(fromJid.getId() + &lt;span class="str"&gt;&amp;quot; &amp;lt;-- JEliza: &amp;quot;&lt;/span&gt; + response);&lt;br /&gt;        &lt;span class="rem"&gt;// Send out response&lt;/span&gt;&lt;br /&gt;        message = &lt;span class="kwrd"&gt;new&lt;/span&gt; MessageBuilder().withRecipientJids(fromJid).withBody(&lt;br /&gt;                response).build();&lt;br /&gt;        xmpp.sendMessage(message);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;To map this servlet to the XMPP URL path, put the following section in your &lt;code&gt;web.xml&lt;/code&gt; file, inside the &lt;code&gt;&amp;lt;web-app&amp;gt;&lt;/code&gt; element:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;    &amp;lt;servlet&amp;gt;&lt;br /&gt;        &amp;lt;servlet-name&amp;gt;xmppreceiver&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;        &amp;lt;servlet-&lt;span class="kwrd"&gt;class&lt;/span&gt;&amp;gt;com.zpylxapp.xmpp.XMPPReceiverServlet&amp;lt;/servlet-&lt;span class="kwrd"&gt;class&lt;/span&gt;&amp;gt;&lt;br /&gt;    &amp;lt;/servlet&amp;gt;&lt;br /&gt;    &amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;        &amp;lt;servlet-name&amp;gt;xmppreceiver&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;        &amp;lt;url-pattern&amp;gt;/_ah/xmpp/message/chat/&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;    &amp;lt;/servlet-mapping&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4423160453611868821-4392136386993721799?l=zhoupengylx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zhoupengylx.blogspot.com/feeds/4392136386993721799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zhoupengylx.blogspot.com/2010/01/using-xmpp-in-google-app-engine.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4423160453611868821/posts/default/4392136386993721799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4423160453611868821/posts/default/4392136386993721799'/><link rel='alternate' type='text/html' href='http://zhoupengylx.blogspot.com/2010/01/using-xmpp-in-google-app-engine.html' title='using xmpp in google app engine'/><author><name>yellowstonemay</name><uri>http://www.blogger.com/profile/05670200739872876579</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4423160453611868821.post-7025246655820539704</id><published>2009-12-24T13:06:00.001-08:00</published><updated>2009-12-24T13:08:37.483-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'></title><content type='html'>Android Basics - Dialogs and Floating Activities&lt;br /&gt;&lt;br /&gt;original link: http://www.androidcompetencycenter.com/tag/alertdialogbuilder/&lt;br /&gt;&lt;br /&gt;As we know android provide Activity class for developing application screens. But many a time application needs to show Dialog boxes or floating screen to do simple tasks likes taking input from user or ask for confirmation etc.&lt;br /&gt;&lt;br /&gt;In android Dialogs can be created in following 2 ways:&lt;br /&gt;&lt;br /&gt;1. Creating a dialog with the help of android Dialog class or its subclass like AlertDialog.&lt;br /&gt;2. Using dialog theme for the activity.&lt;br /&gt;&lt;br /&gt;Using android Dialog class:&lt;br /&gt;Let see how we can create a dialog with the help of Dialog class. To define a dialog the dialog class has to extend the android Dialog class.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;class MyDialog extends Dialog {&lt;br /&gt;/**&lt;br /&gt;* @param context&lt;br /&gt;*/&lt;br /&gt;public MyDialog(Context context) {&lt;br /&gt;super(context);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Define a layout for our dialog. Here is the xml file for of the layout that asks for user’s name.&lt;br /&gt;&lt;br /&gt;&lt;?xml version=”1.0″ encoding=”utf-8″?&gt;&lt;br /&gt;&lt;LinearLayout&lt;br /&gt;android:id=”@+id/widget28″&lt;br /&gt;android:layout_width=”fill_parent”&lt;br /&gt;android:layout_height=”fill_parent”&lt;br /&gt;android:orientation=”vertical”&lt;br /&gt;xmlns:android =”http://schemas.android.com/apk/res/android”&lt;br /&gt;&gt;&lt;br /&gt;&lt;TextView&lt;br /&gt;android:id=”@+id/nameMessage”&lt;br /&gt;android:layout_width=”fill_parent”&lt;br /&gt;android:layout_height=”wrap_content”&lt;br /&gt;android:text=”Enter Name:”&lt;br /&gt;&gt;&lt;br /&gt;&lt;/TextView&gt;&lt;br /&gt;&lt;EditText&lt;br /&gt;android:id=”@+id/nameEditText”&lt;br /&gt;android:layout_width=”fill_parent”&lt;br /&gt;android:layout_height=”wrap_content”&lt;br /&gt;android:textSize=”18sp”&lt;br /&gt;&gt;&lt;br /&gt;&lt;/EditText&gt;&lt;br /&gt;&lt;LinearLayout&lt;br /&gt;android:id=”@+id/buttonLayout”&lt;br /&gt;android:layout_width=”fill_parent”&lt;br /&gt;android:layout_height=”wrap_content”&lt;br /&gt;android:layout_gravity=”center_horizontal”&lt;br /&gt;&gt;&lt;br /&gt;&lt;Button&lt;br /&gt;android:id=”@+id/okButton”&lt;br /&gt;android:layout_width=”wrap_content”&lt;br /&gt;android:layout_height=”wrap_content”&lt;br /&gt;android:text=”OK”&lt;br /&gt;&gt;&lt;br /&gt;&lt;/Button&gt;&lt;br /&gt;&lt;Button&lt;br /&gt;android:id=”@+id/cancelButton”&lt;br /&gt;android:layout_width=”wrap_content”&lt;br /&gt;android:layout_height=”wrap_content”&lt;br /&gt;android:text=”Cancel”&lt;br /&gt;&gt;&lt;br /&gt;&lt;/Button&gt;&lt;br /&gt;&lt;/LinearLayout&gt;&lt;br /&gt;&lt;/LinearLayout&gt;&lt;br /&gt;&lt;br /&gt;Use the above layout for our dialog&lt;br /&gt;&lt;br /&gt;class MyDialog extends Dialog {&lt;br /&gt;….&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* @see android.app.Dialog#onCreate(android.os.Bundle)&lt;br /&gt;*/&lt;br /&gt;@Override&lt;br /&gt;protected void onCreate(Bundle savedInstanceState) {&lt;br /&gt;super.onCreate(savedInstanceState);&lt;br /&gt;Log.d(”TestApp”, “Dialog created”);&lt;br /&gt;setContentView(R.layout.mydialog);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Now the dialog can be shown by calling the show method like this&lt;br /&gt;&lt;br /&gt;…&lt;br /&gt;MyDialog dialog = new MyDialog(context);&lt;br /&gt;dialog.show();&lt;br /&gt;…&lt;br /&gt;&lt;br /&gt;Event handling for the Dialog controls are same as in case of the activity. Modify the dialog code to handle the onclick event on the ok and cancel button.&lt;br /&gt;&lt;br /&gt;class MyDialog extends Dialog implements OnClickListener {&lt;br /&gt;&lt;br /&gt;private Button           okButton;&lt;br /&gt;&lt;br /&gt;private Button           cancelButton;&lt;br /&gt;&lt;br /&gt;private EditText         nameEditText;&lt;br /&gt;&lt;br /&gt;protected void onCreate(Bundle savedInstanceState) {&lt;br /&gt;okButton = (Button) findViewById(R.id.okButton);&lt;br /&gt;cancelButton = (Button) findViewById(R.id.cancelButton);&lt;br /&gt;&lt;br /&gt;nameEditText = (EditText) findViewById(R.id.nameEditText);&lt;br /&gt;&lt;br /&gt;okButton.setOnClickListener(this);&lt;br /&gt;cancelButton.setOnClickListener(this);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void onClick(View view) {&lt;br /&gt;switch (view.getId()) {&lt;br /&gt;case R.id.okButton:&lt;br /&gt;dismiss();&lt;br /&gt;break;&lt;br /&gt;case R.id.cancelButton:&lt;br /&gt;cancel();&lt;br /&gt;break;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;To close the dialog the dismiss() method can be called. The dialog can call the dismiss method itself or some other code can also close the dialog by calling dismiss().&lt;br /&gt;&lt;br /&gt;The dialog also supports cancel. Canceling means the dialog action is canceled and does not need to perform any operation. Dialog can be canceled by calling cancel() method. Canceling the dialog also dismisses the dialog.&lt;br /&gt;&lt;br /&gt;When user clicks the phones BACK button the dialog gets canceled. If you do not want to cancel the dialog on BACK button you can set cancelable to false as&lt;br /&gt;&lt;br /&gt;setCancelable(false);&lt;br /&gt;&lt;br /&gt;Note that the cancel() method call till be able to cancel the dialog (which is the desirable functionality in most cases). The dialog’s cancel and dismiss events can be listened with the help of OnCancelListener and OnDismissListener.&lt;br /&gt;&lt;br /&gt;Returning information from dialog:&lt;br /&gt;Now our dialog can take the name from the user. We need to pass that name to the calling activity. Dialog class does not provide any direct method for returning values. But our own Listener can be created as follows:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public interface MyDialogListener {&lt;br /&gt;&lt;br /&gt;public void onOkClick(String name); // User name is provided here.&lt;br /&gt;&lt;br /&gt;public void onCancelClick();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;The dialog’s constructor has to be modified to take the object of the listener:&lt;br /&gt;&lt;br /&gt;public MyDialog(Context context, MyDialogListener listener) {&lt;br /&gt;super(context);&lt;br /&gt;this.listener = listener;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Now the calling activity needs to provide the object of the class that implements the MyDialogListener which will gets called on ok or cancel button clicks.&lt;br /&gt;&lt;br /&gt;Now we need update the onclick method to return the user name.&lt;br /&gt;&lt;br /&gt;public void onClick(View view) {&lt;br /&gt;switch (view.getId()) {&lt;br /&gt;case R.id.okButton:&lt;br /&gt;listener.onOkClick(nameEditText.getText().toString()); // returning the user’s name.&lt;br /&gt;dismiss();&lt;br /&gt;break;&lt;br /&gt;case R.id.cancelButton:&lt;br /&gt;cancel();&lt;br /&gt;break;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Using AlertDialog:&lt;br /&gt;&lt;br /&gt;AlertDialog is the subclass of the Dialog. It by default provide 3 buttons and text message. The buttons can be made visible as required. Following code creates an AlertDialog that ask user a question and provide Yes, No option.&lt;br /&gt;&lt;br /&gt;AlertDialog dialog = new AlertDialog.Builder(context).create();&lt;br /&gt;&lt;br /&gt;dialog.setMessage(”Do you play cricket?”);&lt;br /&gt;dialog.setButton(”Yes”, myOnClickListener);&lt;br /&gt;dialog.setButton2(”No”, myOnClickListener);&lt;br /&gt;&lt;br /&gt;dialog.show();&lt;br /&gt;&lt;br /&gt;The onClick method code for the button listener myOnClickListener will be like this:&lt;br /&gt;&lt;br /&gt;public void onClick(DialogInterface dialog, int i) {&lt;br /&gt;switch (i) {&lt;br /&gt;case AlertDialog.BUTTON1:&lt;br /&gt;/* Button1 is clicked. Do something */&lt;br /&gt;break;&lt;br /&gt;case AlertDialog.BUTTON2:&lt;br /&gt;/* Button2 is clicked. Do something */&lt;br /&gt;break;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;AlertDialog.Builder:&lt;br /&gt;AlertDialog has a nested class called ‘Builder’. Builder class provides facility to add multichoice or single choice lists. The class also provides methods to set the appropriate Adaptors for the lists, set event handlers for the list events etc. The Builder button calls the Button1, Button2, Button3 as PositiveButton, NeutralButton, NegativeButton.&lt;br /&gt;&lt;br /&gt;Here is an example of dialog box with Multichoice list&lt;br /&gt;&lt;br /&gt;new AlertDialog.Builder(context)&lt;br /&gt;.setIcon(R.drawable.icon)&lt;br /&gt;.setTitle(R.string.alert_dialog_multi_choice)&lt;br /&gt;.setMultiChoiceItems(R.array.select_dialog_items,&lt;br /&gt;new boolean[]{false, true, false, true, false},&lt;br /&gt;new DialogInterface.OnMultiChoiceClickListener() {&lt;br /&gt;public void onClick(DialogInterface dialog, int whichButton, boolean isChecked) {&lt;br /&gt;/* Something on click of the check box */&lt;br /&gt;}&lt;br /&gt;})&lt;br /&gt;.setPositiveButton(R.string.alert_dialog_ok, new DialogInterface.OnClickListener() {&lt;br /&gt;public void onClick(DialogInterface dialog, int whichButton) {&lt;br /&gt;&lt;br /&gt;/* User clicked Yes so do some stuff */&lt;br /&gt;}&lt;br /&gt;})&lt;br /&gt;.setNegativeButton(R.string.alert_dialog_cancel, new DialogInterface.OnClickListener() {&lt;br /&gt;public void onClick(DialogInterface dialog, int whichButton) {&lt;br /&gt;&lt;br /&gt;/* User clicked No so do some stuff */&lt;br /&gt;}&lt;br /&gt;})&lt;br /&gt;.create();&lt;br /&gt;&lt;br /&gt;Activity Managed Dialog:&lt;br /&gt;&lt;br /&gt;Android also provide facility to create dialogs. Activity created dialog can be managed by Activity methods like showDialog(), onCreateDialog(), onPrepareDialog(), dismissDialog(), removeDialog().&lt;br /&gt;The onCreateDialog create the dialog that needs to be shown, for example&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* @see android.app.Activity#onCreateDialog(int)&lt;br /&gt;*/&lt;br /&gt;@Override&lt;br /&gt;protected Dialog onCreateDialog(int id) {&lt;br /&gt;return new AlertDialog.Builder(this).setMessage(”How are you?”).setPositiveButton(”Fine”, new DialogInterface.OnClickListener() {&lt;br /&gt;&lt;br /&gt;public void onClick(DialogInterface dialog, int which) {&lt;br /&gt;/* Do something here */&lt;br /&gt;}&lt;br /&gt;}).setNegativeButton(”Not so good”, new DialogInterface.OnClickListener() {&lt;br /&gt;&lt;br /&gt;public void onClick(DialogInterface dialog, int which) {&lt;br /&gt;/* Do something here */&lt;br /&gt;}&lt;br /&gt;}).create();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;You can create multiple dialog boxes and differentiate them with the id parameter. The dialog can be shown with the help of showDialog(id) method. The onCreateDialog method gets called for the first time when showDialog method is called. For subsequent calls to the showDialog() the dialog is not created but shown directly.&lt;br /&gt;If you need to update the dialog before it is getting shown then you can do that in onPrepareDialog() method. The methods get called just before the dialog is shown to the user.&lt;br /&gt;To close the dialog you can call dismissDialog() method. Generally you will dismiss the dialogs in the click handles of the dialog buttons.&lt;br /&gt;The removeDialog() method will remove the dialog from the activity management and if showDialog is again called for that dialog, the dialog needs to be created.&lt;br /&gt;&lt;br /&gt;Using android Dialog theme for activity:&lt;br /&gt;Another simple way to show the dialog is to make the Activity to work as a Dialog (floating activity). This can be done by applying dialog Theme while defining the activity entry in the AndroidManifest.xml&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;…&lt;br /&gt;&lt;/activity&gt;&lt;br /&gt;&lt;br /&gt;The activity will be shown as a dialog as the activity is using ‘Theme.Dialog’ as theme.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4423160453611868821-7025246655820539704?l=zhoupengylx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zhoupengylx.blogspot.com/feeds/7025246655820539704/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zhoupengylx.blogspot.com/2009/12/original-link-httpwww.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4423160453611868821/posts/default/7025246655820539704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4423160453611868821/posts/default/7025246655820539704'/><link rel='alternate' type='text/html' href='http://zhoupengylx.blogspot.com/2009/12/original-link-httpwww.html' title=''/><author><name>yellowstonemay</name><uri>http://www.blogger.com/profile/05670200739872876579</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4423160453611868821.post-4055361412842548048</id><published>2009-12-22T11:16:00.000-08:00</published><updated>2009-12-22T11:25:43.387-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Iphone'/><title type='text'>iphone: tips collection</title><content type='html'>&lt;span class="Apple-style-span"   style="  ;font-family:arial;font-size:small;"&gt;&lt;span style="  white-space: pre; border-collapse: collapse; font-family:arial, sans-serif;font-size:13px;"&gt;&lt;div&gt;&lt;span style=" ;font-size:large;"&gt;&lt;i&gt;&lt;span style=" line-height: 12px; font-style: normal;  white-space: normal; border-collapse: separate; font-family:'Trebuchet MS', Helvetica, sans-serif;font-size:13px;"&gt;&lt;h2   style="border-top-width: 0px; padding-right: 0px; padding-left: 0px; font-weight: bold; border-left-width: 0px; border-bottom-width: 0px; padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 7px; margin-left: 0px; vertical-align: baseline; padding-top: 0px;  background- border-right-width: 0px; font-family:'Trebuchet MS', Helvetica, sans-serif;color:transparent;"&gt;&lt;span class="Apple-style-span"   style="font-family:verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;font-size:130%;"&gt;&lt;span class="Apple-style-span"  style=" font-weight: normal; line-height: normal;font-size:16px;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"    style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:7;color:#111111;"&gt;&lt;span class="Apple-style-span"  style=" line-height: 36px;font-size:72px;"&gt;&lt;b&gt;&lt;span class="Apple-style-span"   style="color: rgb(0, 0, 0);   font-style: normal; font-weight: normal; line-height: 12px; font-family:'Trebuchet MS', Helvetica, sans-serif;font-size:13px;"&gt;&lt;h2   style="border-top-width: 0px; padding-right: 0px; padding-left: 0px; font-weight: bold; border-left-width: 0px; border-bottom-width: 0px; padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 7px; margin-left: 0px; vertical-align: baseline; padding-top: 0px;  background- border-right-width: 0px; font-family:'Trebuchet MS', Helvetica, sans-serif;color:transparent;"&gt;&lt;span class="Apple-style-span"   style="font-family:verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;font-size:100%;"&gt;&lt;span class="Apple-style-span"  style=" line-height: normal;font-size:13px;"&gt;&lt;span class="Apple-style-span"    style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:7;color:#111111;"&gt;&lt;span class="Apple-style-span"  style=" line-height: 36px;font-size:72px;"&gt;&lt;i&gt;&lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;iPhone: Make your Default.png&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt; &lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;A UIPickerView &lt;span style="color:#aa0d91;"&gt;with&lt;/span&gt; labels&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;http://blog.nottoobadsoftware.com/&lt;span style="color:#1c00cf;"&gt;2009&lt;/span&gt;/&lt;span style="color:#1c00cf;"&gt;03&lt;/span&gt;/a-uipickerview-&lt;span style="color:#aa0d91;"&gt;with&lt;/span&gt;-labels/&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;how &lt;span style="color:#aa0d91;"&gt;to&lt;/span&gt; send SMS/Email &lt;span style="color:#aa0d91;"&gt;from&lt;/span&gt; an &lt;span style="color:#aa0d91;"&gt;application&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;You can do this &lt;span style="color:#aa0d91;"&gt;with&lt;/span&gt; a short code &lt;span style="color:#aa0d91;"&gt;by&lt;/span&gt; way &lt;span style="color:#aa0d91;"&gt;of&lt;/span&gt; a SMS/MMS aggregator like OpenMarket &lt;span style="color:#aa0d91;"&gt;or&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;as&lt;/span&gt; another person has posted you can use &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; SMS Gateway &lt;span style="color:#aa0d91;"&gt;but&lt;/span&gt; this requires &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; knowledge &lt;span style="color:#aa0d91;"&gt;of&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;end&lt;/span&gt; users carrier &lt;span style="color:#aa0d91;"&gt;name&lt;/span&gt;. If your replying &lt;span style="color:#aa0d91;"&gt;to&lt;/span&gt; a SMS &lt;span style="color:#aa0d91;"&gt;on&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; iPhone I believe you can use &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; API which &lt;span style="color:#aa0d91;"&gt;in&lt;/span&gt; turn would give you &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; carrier &lt;span style="color:#aa0d91;"&gt;id&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;of&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; incoming SMS message you would like &lt;span style="color:#aa0d91;"&gt;to&lt;/span&gt; reply &lt;span style="color:#aa0d91;"&gt;to&lt;/span&gt;.&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;Launch SMS &lt;span style="color:#aa0d91;"&gt;with&lt;/span&gt; New Message Window Open:&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;http://www.iphonedevsdk.com/forum/iphone-sdk-development/&lt;span style="color:#1c00cf;"&gt;10998&lt;/span&gt;-&lt;span style="color:#aa0d91;"&gt;launch&lt;/span&gt;-sms-new-message-window-&lt;span style="color:#aa0d91;"&gt;open&lt;/span&gt;.html &lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@&lt;span style="color:#c41a16;"&gt;"sms:"&lt;/span&gt;]]&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span style="color:#c41a16;"&gt;"sms"&lt;/span&gt; - brings up general Text Messages screen&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span style="color:#c41a16;"&gt;"sms: "&lt;/span&gt; - brings up &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; New Message screen, &lt;span style="color:#aa0d91;"&gt;but&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;with&lt;/span&gt; a little blue circle &lt;span style="color:#aa0d91;"&gt;in&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; To field &lt;span style="color:#aa0d91;"&gt;that&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;it&lt;/span&gt; a little confusing &lt;span style="color:#aa0d91;"&gt;and&lt;/span&gt; probably needs &lt;span style="color:#aa0d91;"&gt;to&lt;/span&gt; be deleted.&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span style="color:#c41a16;"&gt;"sms:?"&lt;/span&gt; - brings up &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; New Message screen, &lt;span style="color:#aa0d91;"&gt;but&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;with&lt;/span&gt; a question mark &lt;span style="color:#aa0d91;"&gt;in&lt;/span&gt; a blue circle &lt;span style="color:#aa0d91;"&gt;in&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; To field&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span style="color:#c41a16;"&gt;"sms://"&lt;/span&gt; - brings up general Text Messages screen&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span style="color:#c41a16;"&gt;"sms:&amp;amp;"&lt;/span&gt; - brings up &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; New Message screen, &lt;span style="color:#aa0d91;"&gt;but&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;with&lt;/span&gt; a ampersand &lt;span style="color:#aa0d91;"&gt;in&lt;/span&gt; a blue circle &lt;span style="color:#aa0d91;"&gt;in&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; To field&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span style="color:#c41a16;"&gt;"sms:."&lt;/span&gt; - brings up &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; New Message screen, &lt;span style="color:#aa0d91;"&gt;but&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;with&lt;/span&gt; a period &lt;span style="color:#aa0d91;"&gt;in&lt;/span&gt; a blue circle &lt;span style="color:#aa0d91;"&gt;in&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; To field&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;how &lt;span style="color:#aa0d91;"&gt;to&lt;/span&gt; invite friends &lt;span style="color:#aa0d91;"&gt;from&lt;/span&gt; facebook conenct &lt;span style="color:#aa0d91;"&gt;in&lt;/span&gt; iphone app:  &lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;You can find info &lt;span style="color:#aa0d91;"&gt;about&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;using&lt;/span&gt; FBC &lt;span style="color:#aa0d91;"&gt;on&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; iPhone here(http://developers.facebook.com/connect.php?&lt;span style="color:#aa0d91;"&gt;tab&lt;/span&gt;=iphone)&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;there are two modes you can use &lt;span style="color:#aa0d91;"&gt;it&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;in&lt;/span&gt;. One &lt;span style="color:#aa0d91;"&gt;where&lt;/span&gt; your developer secret &lt;span style="color:#aa0d91;"&gt;is&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;in&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; phone app, &lt;span style="color:#aa0d91;"&gt;if&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;that&lt;/span&gt; makes you nervous you can proxy &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; authentication &lt;span style="color:#aa0d91;"&gt;through&lt;/span&gt; your own server. FB developer site has &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; info along &lt;span style="color:#aa0d91;"&gt;with&lt;/span&gt; programmer supported wikis&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;Facebook Connect &lt;span style="font: 12.0px Hiragino Kaku Gothic ProN"&gt;能做什么&lt;/span&gt;? &lt;span style="font: 12.0px STHeiti Light"&gt;这个是个老外做的，想像了一些商业场景：如果&lt;/span&gt; Amazon/iTunes/iPhone &lt;span style="font: 12.0px STHeiti Light"&gt;这些网站&lt;/span&gt;/&lt;span style="font: 12.0px Hiragino Kaku Gothic ProN"&gt;服&lt;/span&gt;&lt;span style="font: 12.0px STHeiti Light"&gt;务&lt;/span&gt;/&lt;span style="font: 12.0px STHeiti Light"&gt;设备实现了&lt;/span&gt;Facebook Connect……&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;how &lt;span style="color:#aa0d91;"&gt;to&lt;/span&gt; debug EXC_BAD_ACCESS &lt;span style="color:#aa0d91;"&gt;on&lt;/span&gt; iPhone http://www.codza.com/how-&lt;span style="color:#aa0d91;"&gt;to&lt;/span&gt;-debug-exc_bad_access-&lt;span style="color:#aa0d91;"&gt;on&lt;/span&gt;-iphone &lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;Instruments &lt;span style="color:#aa0d91;"&gt;on&lt;/span&gt; Leopard: How &lt;span style="color:#aa0d91;"&gt;to&lt;/span&gt; debug those random crashes &lt;span style="color:#aa0d91;"&gt;in&lt;/span&gt; your Cocoa app &lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;google geocoding UK postcode issue:&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;oogle Maps API provides a geocoding feature, &lt;span style="color:#aa0d91;"&gt;for&lt;/span&gt; finding &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; latitude &lt;span style="color:#aa0d91;"&gt;and&lt;/span&gt; longitude &lt;span style="color:#aa0d91;"&gt;of&lt;/span&gt; places &lt;span style="color:#aa0d91;"&gt;or&lt;/span&gt; addresses; &lt;span style="color:#aa0d91;"&gt;but&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;it&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;does&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;not&lt;/span&gt; work &lt;span style="color:#aa0d91;"&gt;for&lt;/span&gt; UK postcodes. This &lt;span style="color:#aa0d91;"&gt;is&lt;/span&gt; thanks &lt;span style="color:#aa0d91;"&gt;to&lt;/span&gt; Royal Mail who have a copyright &lt;span style="color:#aa0d91;"&gt;on&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;data&lt;/span&gt;, &lt;span style="color:#aa0d91;"&gt;and&lt;/span&gt; are very restrictive &lt;span style="color:#aa0d91;"&gt;with&lt;/span&gt; their (expensive) licenses &lt;span style="color:#aa0d91;"&gt;for&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;it&lt;/span&gt;.&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;solution: http://www.tomanthony.co.uk/blog/geocoding-uk-postcodes-&lt;span style="color:#aa0d91;"&gt;with&lt;/span&gt;-google-map-api/ &lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span style="color:#aa0d91;"&gt;if&lt;/span&gt; use restFul ajax &lt;span style="color:#aa0d91;"&gt;local&lt;/span&gt; search, use this: http://ajax.googleapis.com/ajax/services/search/&lt;span style="color:#aa0d91;"&gt;local&lt;/span&gt;?v=&lt;span style="color:#1c00cf;"&gt;1.0&lt;/span&gt;&amp;amp;q=xxx&amp;amp;gl=fr &lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span style="color:#aa0d91;"&gt;reference&lt;/span&gt;: http://code.google.com/apis/ajaxsearch/documentation/&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt; memory leaks detecting:&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;un &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; tools within XCode &lt;span style="color:#aa0d91;"&gt;over&lt;/span&gt; menu -&gt; &lt;span style="color:#aa0d91;"&gt;run&lt;/span&gt; -&gt; &lt;span style="color:#aa0d91;"&gt;start&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;with&lt;/span&gt; performance tool -&gt;......&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;Introduction &lt;span style="color:#aa0d91;"&gt;to&lt;/span&gt; Instruments User Guide http://developer.apple.com/iphone/library/documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/Introduction/Introduction.html&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;Finding iPhone Memory Leaks: A “Leaks” Tool Tutorial &lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;http://www.mobileorchard.com/find-iphone-memory-leaks-a-leaks-tool-tutorial/ &lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;Instruments &lt;span style="color:#aa0d91;"&gt;on&lt;/span&gt; Leopard: How &lt;span style="color:#aa0d91;"&gt;to&lt;/span&gt; debug those random crashes &lt;span style="color:#aa0d91;"&gt;in&lt;/span&gt; your Cocoa app&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;how &lt;span style="color:#aa0d91;"&gt;to&lt;/span&gt; handle &amp;amp; &lt;span style="color:#aa0d91;"&gt;in&lt;/span&gt; xml &lt;span style="color:#aa0d91;"&gt;file&lt;/span&gt;:&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;answer: Put &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;data&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;in&lt;/span&gt; a  section &lt;span style="color:#aa0d91;"&gt;and&lt;/span&gt; you should &lt;span style="color:#aa0d91;"&gt;get&lt;/span&gt; what you want.&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;&lt;span style="color:#aa0d91;"&gt;name&lt;/span&gt;&gt;&lt;span style="color:#aa0d91;"&gt;name&lt;/span&gt;&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;How &lt;span style="color:#aa0d91;"&gt;to&lt;/span&gt; view contents &lt;span style="color:#aa0d91;"&gt;of&lt;/span&gt; NSDictionary variable &lt;span style="color:#aa0d91;"&gt;in&lt;/span&gt; Xcode debugger?&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;In &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; gdb window you can use po &lt;span style="color:#aa0d91;"&gt;to&lt;/span&gt; inspect &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; object.&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;The difference &lt;span style="color:#aa0d91;"&gt;between&lt;/span&gt; initWithString &lt;span style="color:#aa0d91;"&gt;and&lt;/span&gt; stringWithString &lt;span style="color:#aa0d91;"&gt;is&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;that&lt;/span&gt; stringWithString returns an auto-released pointer. This means &lt;span style="color:#aa0d91;"&gt;that&lt;/span&gt; you don't need &lt;span style="color:#aa0d91;"&gt;to&lt;/span&gt; release &lt;span style="color:#aa0d91;"&gt;it&lt;/span&gt; specifically, &lt;span style="color:#aa0d91;"&gt;since&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;that&lt;/span&gt; will be taken care &lt;span style="color:#aa0d91;"&gt;of&lt;/span&gt; next time &lt;span style="color:#aa0d91;"&gt;that&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; auto-release pool cleans up any auto-released pointers. initWithString, &lt;span style="color:#aa0d91;"&gt;on&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; other hand, returns a pointer &lt;span style="color:#aa0d91;"&gt;with&lt;/span&gt; a retain &lt;span style="color:#aa0d91;"&gt;count&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;of&lt;/span&gt; &lt;span style="color:#1c00cf;"&gt;1&lt;/span&gt; - you do need &lt;span style="color:#aa0d91;"&gt;to&lt;/span&gt; call release &lt;span style="color:#aa0d91;"&gt;on&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;that&lt;/span&gt; pointer, &lt;span style="color:#aa0d91;"&gt;or&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;else&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;it&lt;/span&gt; would &lt;span style="color:#aa0d91;"&gt;result&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;in&lt;/span&gt; a memory leak.&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;code &lt;span style="color:#aa0d91;"&gt;for&lt;/span&gt; plucking useful bits &lt;span style="color:#aa0d91;"&gt;out&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;of&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; addressBook:&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker &lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;  shouldContinueAfterSelectingPerson:(ABRecordRef)person { &lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;customer.firstName = (NSString *)ABRecordCopyValue(person, kABPersonFirstNameProperty);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;customer.lastName = (NSString *)ABRecordCopyValue(person, kABPersonLastNameProperty);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;customer.companyName = (NSString *)ABRecordCopyValue(person, kABPersonOrganizationProperty);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#aa0d91;"&gt;if&lt;/span&gt; (!customer.firstName.length) {&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;customer.firstName = @&lt;span style="color:#c41a16;"&gt;"*"&lt;/span&gt;;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#aa0d91;"&gt;if&lt;/span&gt; (!customer.lastName.length) {&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;customer.lastName = @&lt;span style="color:#c41a16;"&gt;"*"&lt;/span&gt;;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#aa0d91;"&gt;if&lt;/span&gt; (!customer.companyName.length) {&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;customer.companyName = @&lt;span style="color:#c41a16;"&gt;""&lt;/span&gt;;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;CFStringRef email, emailLabel, phone, phoneLabel;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;ABMutableMultiValueRef phoneMulti = ABRecordCopyValue(person, kABPersonPhoneProperty);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;NSMutableDictionary *myPhoneDict = [NSMutableDictionary dictionaryWithCapacity:ABMultiValueGetCount(phoneMulti)];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#aa0d91;"&gt;for&lt;/span&gt; (CFIndex i = &lt;span style="color:#1c00cf;"&gt;0&lt;/span&gt;; i &lt;&gt; &lt;/p&gt;&lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;phoneLabel = ABAddressBookCopyLocalizedLabel(ABMultiValueCopyLabelAtIndex(phoneMulti, i));&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;phone = ABMultiValueCopyValueAtIndex(phoneMulti, i); &lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;[myPhoneDict setObject:(NSString*)phone forKey:(NSString*)phoneLabel];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;CFRelease(phone);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;CFRelease(phoneLabel);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;} &lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#aa0d91;"&gt;if&lt;/span&gt; ( [myPhoneDict objectForKey:@&lt;span style="color:#c41a16;"&gt;"mobile"&lt;/span&gt;] != nil) {&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;customer.phone  = [myPhoneDict objectForKey:@&lt;span style="color:#c41a16;"&gt;"mobile"&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;} &lt;span style="color:#aa0d91;"&gt;else&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;if&lt;/span&gt; ( [myPhoneDict objectForKey:@&lt;span style="color:#c41a16;"&gt;"home"&lt;/span&gt;] != nil) {&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;customer.phone  = [myPhoneDict objectForKey:@&lt;span style="color:#c41a16;"&gt;"home"&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;} &lt;span style="color:#aa0d91;"&gt;else&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;if&lt;/span&gt; ( [myPhoneDict objectForKey:@&lt;span style="color:#c41a16;"&gt;"work"&lt;/span&gt;] != nil) {&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;customer.phone  = [myPhoneDict objectForKey:@&lt;span style="color:#c41a16;"&gt;"work"&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;ABMutableMultiValueRef multi = ABRecordCopyValue(person, kABPersonEmailProperty);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;NSMutableDictionary *myEmailDict = [NSMutableDictionary dictionaryWithCapacity:ABMultiValueGetCount(multi)];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#aa0d91;"&gt;for&lt;/span&gt; (CFIndex i = &lt;span style="color:#1c00cf;"&gt;0&lt;/span&gt;; i &lt;&gt; &lt;/p&gt;&lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;emailLabel = ABAddressBookCopyLocalizedLabel(ABMultiValueCopyLabelAtIndex(multi, i));&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;email = ABMultiValueCopyValueAtIndex(multi, i); &lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;[myEmailDict setObject:(NSString*)email forKey:(NSString*)emailLabel];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;CFRelease(email);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;CFRelease(emailLabel);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;} &lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#aa0d91;"&gt;if&lt;/span&gt; ([myEmailDict objectForKey:@&lt;span style="color:#c41a16;"&gt;"home"&lt;/span&gt;] != nil) {&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;customer.email = [myEmailDict objectForKey:@&lt;span style="color:#c41a16;"&gt;"home"&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;} &lt;span style="color:#aa0d91;"&gt;else&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;if&lt;/span&gt; ([myEmailDict objectForKey:@&lt;span style="color:#c41a16;"&gt;"work"&lt;/span&gt;] != nil) {&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;customer.email = [myEmailDict objectForKey:@&lt;span style="color:#c41a16;"&gt;"work"&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;} &lt;span style="color:#aa0d91;"&gt;else&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;if&lt;/span&gt; ([myEmailDict objectForKey:@&lt;span style="color:#c41a16;"&gt;"other"&lt;/span&gt;] != nil) {&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;customer.email = [myEmailDict objectForKey:@&lt;span style="color:#c41a16;"&gt;"other"&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;// &lt;span style="color:#aa0d91;"&gt;get&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;the&lt;/span&gt; address stuff&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;ABMultiValueRef streets = ABRecordCopyValue(person, kABPersonAddressProperty);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;NSMutableDictionary *myAddressDict = [NSMutableDictionary dictionaryWithCapacity:ABMultiValueGetCount(streets)];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#aa0d91;"&gt;for&lt;/span&gt; (CFIndex j = &lt;span style="color:#1c00cf;"&gt;0&lt;/span&gt;; j &lt;&gt; &lt;/p&gt;&lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;NSMutableDictionary *myLabelDict = [[NSMutableDictionary alloc] init];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;CFDictionaryRef dict = ABMultiValueCopyValueAtIndex(streets, j);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;CFStringRef typeTmp = ABMultiValueCopyLabelAtIndex(streets, j);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;CFStringRef type = ABAddressBookCopyLocalizedLabel(typeTmp);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;NSString *street = [(NSString *)CFDictionaryGetValue(dict, kABPersonAddressStreetKey) &lt;span style="color:#aa0d91;"&gt;copy&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;NSString *city = [(NSString *)CFDictionaryGetValue(dict, kABPersonAddressCityKey) &lt;span style="color:#aa0d91;"&gt;copy&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;NSString *state = [(NSString *)CFDictionaryGetValue(dict, kABPersonAddressStateKey) &lt;span style="color:#aa0d91;"&gt;copy&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;NSString *zip = [(NSString *)CFDictionaryGetValue(dict, kABPersonAddressZIPKey) &lt;span style="color:#aa0d91;"&gt;copy&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;NSString *country = [(NSString *)CFDictionaryGetValue(dict, kABPersonAddressCountryKey) &lt;span style="color:#aa0d91;"&gt;copy&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;span style="color:#aa0d91;"&gt;if&lt;/span&gt; ((street != nil) &amp;amp;&amp;amp; (street.length &gt; &lt;span style="color:#1c00cf;"&gt;0&lt;/span&gt;))&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;[myLabelDict setObject:street forKey:@&lt;span style="color:#c41a16;"&gt;"street"&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;span style="color:#aa0d91;"&gt;if&lt;/span&gt; ((city != nil) &amp;amp;&amp;amp; (city.length &gt; &lt;span style="color:#1c00cf;"&gt;0&lt;/span&gt;))&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;[myLabelDict setObject:city forKey:@&lt;span style="color:#c41a16;"&gt;"city"&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;span style="color:#aa0d91;"&gt;if&lt;/span&gt; ((state != nil) &amp;amp;&amp;amp; (state.length &gt; &lt;span style="color:#1c00cf;"&gt;0&lt;/span&gt;))&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;[myLabelDict setObject:state forKey:@&lt;span style="color:#c41a16;"&gt;"state"&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;span style="color:#aa0d91;"&gt;if&lt;/span&gt; ((zip != nil) &amp;amp;&amp;amp; (zip.length &gt; &lt;span style="color:#1c00cf;"&gt;0&lt;/span&gt;))&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;[myLabelDict setObject:zip forKey:@&lt;span style="color:#c41a16;"&gt;"zip"&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;span style="color:#aa0d91;"&gt;if&lt;/span&gt; ((country != nil) &amp;amp;&amp;amp; (country.length &gt; &lt;span style="color:#1c00cf;"&gt;0&lt;/span&gt;))&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;[myLabelDict setObject:country forKey:@&lt;span style="color:#c41a16;"&gt;"country"&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;[myAddressDict setObject:myLabelDict forKey:(NSString *)type];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;[myLabelDict release];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;[street release];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;[city release];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;[state release];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;[zip release];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;[country release];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;CFRelease(dict);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;CFRelease(type);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;CFRelease(typeTmp);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;NSString *theKey;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#aa0d91;"&gt;if&lt;/span&gt; ([myAddressDict objectForKey:@&lt;span style="color:#c41a16;"&gt;"home"&lt;/span&gt;] != nil) {&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;theKey = @&lt;span style="color:#c41a16;"&gt;"home"&lt;/span&gt;;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;} &lt;span style="color:#aa0d91;"&gt;else&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;if&lt;/span&gt; ([myAddressDict objectForKey:@&lt;span style="color:#c41a16;"&gt;"work"&lt;/span&gt;] != nil) {&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;theKey = @&lt;span style="color:#c41a16;"&gt;"work"&lt;/span&gt;;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;} &lt;span style="color:#aa0d91;"&gt;else&lt;/span&gt; &lt;span style="color:#aa0d91;"&gt;if&lt;/span&gt; ([myAddressDict objectForKey:@&lt;span style="color:#c41a16;"&gt;"other"&lt;/span&gt;] != nil) {&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;theKey = @&lt;span style="color:#c41a16;"&gt;"other"&lt;/span&gt;;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#aa0d91;"&gt;if&lt;/span&gt; ([[[myAddressDict objectForKey:theKey] objectForKey:@&lt;span style="color:#c41a16;"&gt;"street"&lt;/span&gt;] length] &gt; &lt;span style="color:#1c00cf;"&gt;0&lt;/span&gt;) {&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;customer.street = [[myAddressDict objectForKey:theKey] objectForKey:@&lt;span style="color:#c41a16;"&gt;"street"&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;} &lt;span style="color:#aa0d91;"&gt;else&lt;/span&gt; {&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;customer.street = @&lt;span style="color:#c41a16;"&gt;""&lt;/span&gt;;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#aa0d91;"&gt;if&lt;/span&gt; ([[[myAddressDict objectForKey:theKey] objectForKey:@&lt;span style="color:#c41a16;"&gt;"city"&lt;/span&gt;] length] &gt; &lt;span style="color:#1c00cf;"&gt;0&lt;/span&gt;) {&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;customer.city = [[myAddressDict objectForKey:theKey] objectForKey:@&lt;span style="color:#c41a16;"&gt;"city"&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;} &lt;span style="color:#aa0d91;"&gt;else&lt;/span&gt; {&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;customer.city = @&lt;span style="color:#c41a16;"&gt;""&lt;/span&gt;;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#aa0d91;"&gt;if&lt;/span&gt; ([[[myAddressDict objectForKey:theKey] objectForKey:@&lt;span style="color:#c41a16;"&gt;"state"&lt;/span&gt;] length] &gt; &lt;span style="color:#1c00cf;"&gt;0&lt;/span&gt;) {&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;customer.state = [[myAddressDict objectForKey:theKey] objectForKey:@&lt;span style="color:#c41a16;"&gt;"state"&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;} &lt;span style="color:#aa0d91;"&gt;else&lt;/span&gt; {&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;customer.state = @&lt;span style="color:#c41a16;"&gt;""&lt;/span&gt;;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#aa0d91;"&gt;if&lt;/span&gt; ([[[myAddressDict objectForKey:theKey] objectForKey:@&lt;span style="color:#c41a16;"&gt;"zip"&lt;/span&gt;] length] &gt; &lt;span style="color:#1c00cf;"&gt;0&lt;/span&gt;) {&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;customer.postalCode = [[myAddressDict objectForKey:theKey] objectForKey:@&lt;span style="color:#c41a16;"&gt;"zip"&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;} &lt;span style="color:#aa0d91;"&gt;else&lt;/span&gt; {&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;customer.postalCode = @&lt;span style="color:#c41a16;"&gt;""&lt;/span&gt;;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#aa0d91;"&gt;if&lt;/span&gt; ([[[myAddressDict objectForKey:theKey] objectForKey:@&lt;span style="color:#c41a16;"&gt;"country"&lt;/span&gt;] length] &gt; &lt;span style="color:#1c00cf;"&gt;0&lt;/span&gt;) {&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;customer.country = [[myAddressDict objectForKey:theKey] objectForKey:@&lt;span style="color:#c41a16;"&gt;"country"&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;} &lt;span style="color:#aa0d91;"&gt;else&lt;/span&gt; {&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;customer.country = @&lt;span style="color:#c41a16;"&gt;""&lt;/span&gt;;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;CFRelease(streets);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;CFRelease(phoneMulti);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;CFRelease(multi);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;[customer dehydrate];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;[self dismissModalViewControllerAnimated:YES];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#aa0d91;"&gt;return&lt;/span&gt; NO; &lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier"&gt;}&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4423160453611868821-4055361412842548048?l=zhoupengylx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zhoupengylx.blogspot.com/feeds/4055361412842548048/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zhoupengylx.blogspot.com/2009/12/iphone-tips-collection.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4423160453611868821/posts/default/4055361412842548048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4423160453611868821/posts/default/4055361412842548048'/><link rel='alternate' type='text/html' href='http://zhoupengylx.blogspot.com/2009/12/iphone-tips-collection.html' title='iphone: tips collection'/><author><name>yellowstonemay</name><uri>http://www.blogger.com/profile/05670200739872876579</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4423160453611868821.post-2851693894731771935</id><published>2009-12-18T13:31:00.000-08:00</published><updated>2009-12-18T13:32:45.852-08:00</updated><title type='text'>How to add photos to iPhone Simulator from Mac OS X?</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; border-collapse: collapse; font-size: 14px; line-height: 18px; "&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: transparent; clear: both; background-position: initial initial; "&gt;Open the Window in mac where your images are stored.&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: transparent; clear: both; background-position: initial initial; "&gt;Open your simulator another side.&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: transparent; clear: both; background-position: initial initial; "&gt;Now drag your image from mac window to simulator,&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: transparent; clear: both; background-position: initial initial; "&gt;simulator will open safari, and in a safari tab your image will be shown.&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: transparent; clear: both; background-position: initial initial; "&gt;press left button of mouse and hold for a while on image in simulator,&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: transparent; clear: both; background-position: initial initial; "&gt;There will be message to "save image",&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: transparent; clear: both; background-position: initial initial; "&gt;save image.&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: transparent; clear: both; background-position: initial initial; "&gt;It will be added to your iPhone simulator.&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4423160453611868821-2851693894731771935?l=zhoupengylx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zhoupengylx.blogspot.com/feeds/2851693894731771935/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zhoupengylx.blogspot.com/2009/12/how-to-add-photos-to-iphone-simulator.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4423160453611868821/posts/default/2851693894731771935'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4423160453611868821/posts/default/2851693894731771935'/><link rel='alternate' type='text/html' href='http://zhoupengylx.blogspot.com/2009/12/how-to-add-photos-to-iphone-simulator.html' title='How to add photos to iPhone Simulator from Mac OS X?'/><author><name>yellowstonemay</name><uri>http://www.blogger.com/profile/05670200739872876579</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4423160453611868821.post-2579506698912886459</id><published>2009-12-12T13:06:00.000-08:00</published><updated>2009-12-12T13:21:38.722-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>Debug Java by JVM diagnostics tools</title><content type='html'>&lt;p&gt;sometimes I need to debug program with multiple threads and complex codes. Or  I work on analyzing and interpreting the JVM performance monitoring and  diagnostics statistics. I need a sharp tool to do it. So I find most powerful  kits to help.&lt;/p&gt; &lt;p&gt;1. &lt;a href="http://java.sun.com/developer/technicalArticles/Programming/Stacktrace/"&gt;An  Introduction to Java Stack Traces&lt;/a&gt;&lt;br /&gt;2. &lt;a href="http://javatechniques.com/blog/jdb-example-generating-a-thread-dump/"&gt;JDB  Example: Generating a Thread Dump&lt;/a&gt;&lt;br /&gt;3. &lt;a href="http://go2.wordpress.com/?id=725X1342&amp;amp;site=biese.wordpress.com&amp;amp;url=http%3A%2F%2Falbert.rierol.net%2Fjava_tricks.html"&gt;How  to debug a multithreaded java program&lt;/a&gt;&lt;br /&gt;4. &lt;a href="http://bwithers.wordpress.com/2007/12/29/schedule-your-own-java-thread-dumps/"&gt;Schedule  your own Java thread dumps&lt;/a&gt;&lt;br /&gt;5. &lt;a href="http://www.javapassion.com/javase/javadebugcommandtools.pdf"&gt;JDK Debugging  Tools&lt;/a&gt;&lt;br /&gt;6. &lt;a href="http://java.sun.com/j2se/1.5.0/docs/tooldocs/"&gt;JDK  Tools and Utilities&lt;/a&gt;&lt;br /&gt;7. &lt;a href="http://www.javapassion.com/handsonlabs/javase6tools/index.html"&gt;Exercise  basic command line debugging tools&lt;/a&gt;&lt;br /&gt;8. &lt;a href="http://articles.techrepublic.com.com/5100-10878_11-6139512.html"&gt;Debug  your Java code with ease using JPDA&lt;/a&gt;&lt;br /&gt;9. &lt;a href="http://www.infoq.com/news/2007/11/ibm-sap"&gt;IBM and SAP Open Source their  JVM Diagnostics Tools&lt;/a&gt;&lt;br /&gt;10. &lt;a href="http://www.alphaworks.ibm.com/tech/jca?open&amp;amp;S_TACT=105AGX59&amp;amp;S_CMP=GR&amp;amp;ca=dgr-jw22awjca"&gt;IBM  Thread and Monitor Dump Analyzer for Java&lt;/a&gt;&lt;br /&gt;11. &lt;a href="https://visualvm.dev.java.net/"&gt;Sun VisualVM&lt;/a&gt; is a visual tool  integrating several commandline JDK tools and lightweight profiling  capabilities.&lt;br /&gt;12. &lt;a href="http://www.eclipse.org/tptp/"&gt;Eclipse Test &amp;amp;  Performance Tools Platform Project&lt;/a&gt;&lt;br /&gt;13. &lt;a href="http://satukubik.com/2009/08/26/eclipse-tips-debugging-your-multi-thread-application-2/"&gt;Eclipse  Tips: Debugging your multi thread application&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4423160453611868821-2579506698912886459?l=zhoupengylx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zhoupengylx.blogspot.com/feeds/2579506698912886459/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zhoupengylx.blogspot.com/2009/12/debug-java-by-jvm-diagnostics-tools.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4423160453611868821/posts/default/2579506698912886459'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4423160453611868821/posts/default/2579506698912886459'/><link rel='alternate' type='text/html' href='http://zhoupengylx.blogspot.com/2009/12/debug-java-by-jvm-diagnostics-tools.html' title='Debug Java by JVM diagnostics tools'/><author><name>yellowstonemay</name><uri>http://www.blogger.com/profile/05670200739872876579</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
