<?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:blogger='http://schemas.google.com/blogger/2008' 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-5315596295108076178</id><updated>2024-12-26T23:10:46.251-08:00</updated><category term="ios; iphone; submit; approval"/><category term="sqllite;android"/><category term="Android Marketplace; publish"/><category term="Android; SRS;"/><category term="IOS; navController"/><category term="apple; iphone; submit app"/><category term="iOS; sqllite;tutorial"/><category term="robotium; android; testing"/><category term="Adsense; statistics; CTR; inrease"/><category term="Android App; advertising; pricing"/><category term="Android; AsyncTask; Progress Bar"/><category term="Android; EditText; text highlights; styles;"/><category term="Android; ListItem; highlight;"/><category term="Android; UI; code style;"/><category term="Android; animation; onPause;"/><category term="Android; ant; multiple projects"/><category term="Android; basic authentication."/><category term="Android; content resolver"/><category term="Android; copy protection; licence checking"/><category term="Android; dailog;activity;image"/><category term="Android; file;download;"/><category term="Android; in-app-billing"/><category term="Android; java; copy file; hashmap"/><category term="Android; jumptap; advertising"/><category term="Android; junit; SRS; testing;"/><category term="Android; library project; licensing"/><category term="Android; licensing;"/><category term="Android; licensing; tips; leaked service connection"/><category term="Android; memory leak; Memory Analyzer Tool"/><category term="Android; mobfox; admob;"/><category term="Android; publishing;"/><category term="Android; removing the db; app storoage"/><category term="Android; spaced repetition systtem"/><category term="Android; tdd; robotium;"/><category term="Android; testing"/><category term="Android; to refactor or not to refactor"/><category term="Android; validation; radion button"/><category term="Android; various"/><category term="Android; xcode; download"/><category term="Android;Amazon app store; google marketplace."/><category term="Android;AsyncTask; monkey; ANR error"/><category term="Android;IOS; The Man"/><category term="Android;advertising;admob;mobfox"/><category term="Android;apk; signing; export unsigned app"/><category term="Android;app; link; android market"/><category term="Android;customdialog"/><category term="Android;datas;SQLlite"/><category term="Android;download;resources;font;"/><category term="Android;hiding files."/><category term="Android;layout;progressbar"/><category term="Android;library project."/><category term="Android;licensing; progress indicator"/><category term="Android;linkify; android.app.IntentReceiverLeaked"/><category term="Android;listactivity;font"/><category term="Android;mobfox;ads"/><category term="Android;package;rename;maifiest.xml;r file"/><category term="Android;sql;insert;update"/><category term="Android;sqlite;HTC DESIRE HD;"/><category term="Android;sqlite;insert;update"/><category term="Android;textview; align;gravity;NFD"/><category term="Android;wrap_content;layout;view;scrollview;gravity;text alignment"/><category term="ApplicationContext; SharedPreferences"/><category term="AsyncTask; file download; progress diaglog; example"/><category term="Custom Dialog; Android"/><category term="Dialog;cancel;dismiss;"/><category term="Exerciser monkey; clear shared preferences"/><category term="HTML5; database"/><category term="Html5; database; tutorial"/><category term="Html5; tutorial"/><category term="IOS; Xcode4"/><category term="IOS; review"/><category term="Intro web page;  jumptap"/><category term="Linkify; adding a linke"/><category term="Linkify;email;android;linkify.all"/><category term="List view;zero children;"/><category term="ListView; AsyncThread; workaround"/><category term="Mobfox; android; inMobi;"/><category term="Mobfox; id; android;"/><category term="PHP stripslahes"/><category term="Php;database access;mysql;"/><category term="RasorSql; sqllite;"/><category term="SQlite; android;"/><category term="SQlite;iOS;loop"/><category term="Spring"/><category term="Spring; Container pattern"/><category term="Sqlite; no such table; cursor"/><category term="Sqllite; android; table not found; compiled statement;"/><category term="Srs; testing; android;"/><category term="Timer; play audio; android; media; oncompletion;"/><category term="UIImage;UIImageView; send to back"/><category term="UIPickerView example"/><category term="UIPickerView; set default"/><category term="Web;mobile;app;apple;Jquery mobile"/><category term="admob;mobclix;mopub;android"/><category term="adroid;linkify;email"/><category term="android; 9-patch."/><category term="android; async task"/><category term="android; debugging."/><category term="android; debugging; optimizing"/><category term="android; eclipse; compilation error"/><category term="android; licensing"/><category term="android; listview; highlight"/><category term="android; memory leak"/><category term="android; memory leak;"/><category term="android; nexus one; root;"/><category term="android; programming;"/><category term="android; regex"/><category term="android; restart;"/><category term="android; robotium; sqllite"/><category term="android; space management;sdk"/><category term="android; tdd;"/><category term="android; tdd; unit testing SQLLite"/><category term="android; test driven design; unit testing;"/><category term="android; unit testing; ActivityUnitTestCase"/><category term="android;advertising;jumptap"/><category term="android;animation;fading;image"/><category term="android;countdown timer; progress bar"/><category term="android;library;licensing;paid;free;"/><category term="android;licensing"/><category term="android;media player;exerciser monkey;music player"/><category term="android;mobfox;"/><category term="android;obfuscation;proguard"/><category term="android;rename;package"/><category term="android;root;nexus one;mac;issues;fastboot-mac"/><category term="android;scrollable view;"/><category term="android;sqllite"/><category term="android;sqllite;database"/><category term="android;sqllite;tdd"/><category term="android;tdd;unit testing"/><category term="android;unit testing;"/><category term="android;xml;sqllite"/><category term="eBay;Amazon;posting items for sale"/><category term="flurry; iOS"/><category term="html5; intro"/><category term="iOS; NSDate; increment"/><category term="iOS; UITableView reload"/><category term="iOS; deploy; app; device;"/><category term="iOS; dialog box;"/><category term="iOS; iPhone"/><category term="iOS; objective c; validation; message; sqllite"/><category term="iOS; row; selection; highlight"/><category term="iOS; sqllite;"/><category term="iOS;in app purchase; testing;"/><category term="image;android;load;title"/><category term="ios; background color; UITable; rgb"/><category term="ios; prefs;"/><category term="ios; section header; uilabel"/><category term="jquery mobile; phone gap"/><category term="lean startups;"/><category term="navigation controller; stack; push; pop; bad access; zombie calls"/><category term="objective c; constants;"/><category term="sql;testing;join table"/><category term="sqllite; mac;laptop"/><category term="sqllite;android;"/><category term="tdd; android;"/><category term="tdd;android"/><title type='text'>Getting into Mobile</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gettingintomobile.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://gettingintomobile.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Getting Into Mobile</name><uri>http://www.blogger.com/profile/10712519676082391096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>250</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5315596295108076178.post-2119666543715963642</id><published>2014-01-05T12:31:00.000-08:00</published><updated>2014-01-05T12:41:36.340-08:00</updated><title type='text'>Certificate issues - what else is new? </title><content type='html'>One of the reasons I dread making changes to my IOS program is that there is virtually always some kind of issue with provision profiles and developer certificates and distribution certificates and so on and so on. It&#39;s absolutely maddening! But what can you do? You just have to try to figure it out.&lt;br /&gt;
&lt;br /&gt;
My latest idea is try to research the issues to the max possible before going to code, or trying the fix. The key to software is understanding. You have to let the light of knowledge guide you. It&#39;s about *process* - not results. Enjoy the process, and things between you and your computer will go a lot easier. Stop worrying so much about having it *done*, and concern yourself with *understanding*. If you do so, eventually the picture clears up and you have a better idea how to proceed.&lt;br /&gt;
&lt;br /&gt;
So, first off, what it the error message I&#39;m dealing with now?&lt;br /&gt;
&lt;br /&gt;
&quot;No provisioning profiles with a valid signing identity (i.e. certificate and private key pair) were found.&quot;&lt;br /&gt;
&lt;br /&gt;
&quot;No codesigning identities (i.e. certificate and private key pairs) that match the provisioning profile specified in your build settings (“JlptProfileForIphone”) were found. &amp;nbsp;Xcode can resolve this issue by downloading a new provisioning profile from the Member Center.&quot;&lt;br /&gt;
&lt;br /&gt;
So, let&#39;s take it one step at a time. I have a &quot;ProvisioningProfile&quot; named &quot;JlptProfileForIphone&quot; specified in my build settings.&lt;br /&gt;
&lt;br /&gt;
It&#39;s trying to find a &quot;codesigning identity&quot;, which is a &quot;certificate and private key pair&quot; that matches it, and doesn&#39;t (find it, that is).&lt;br /&gt;
&lt;br /&gt;
Ok, so in reviewing a previous blog I made, called &quot;Provisioning Profiles - a labor of love&quot;,&lt;br /&gt;
I discovered this information:&lt;br /&gt;
&lt;br /&gt;
&quot;To run an application you&#39;re developing for iPhone, iPad or iPod touch, you must have a Provisioning Profile and a Development Certificate installed on your device and your Mac. The Provisioning Assistant will guide you through the steps to create and install your Development Provisioning Profile and iOS Development Certificate.&quot;&lt;br /&gt;
&lt;br /&gt;
Also, &quot;A Provisioning Profile is a collection of your App ID, Apple device UDID, and iOS Development Certificate that allows you to install your application on your device.&quot;&lt;br /&gt;
&lt;br /&gt;
Also, I want to make sure my developer id is still valid. &amp;nbsp;Well, I after logging into the portal, it looks like I&#39;m still good for that. But I got an email a month or so ago stating:&lt;br /&gt;
&lt;br /&gt;
&quot;&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Myriad Pro&#39;, &#39;Lucida Grande&#39;, Helvetica, Geneva, Arial, Verdana, sans-serif; font-size: 24px; line-height: 31.200000762939453px;&quot;&gt;Your iOS Distribution Certificate will expire in 30&amp;nbsp;days&quot;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&quot;&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, Geneva, Verdana, sans-serif; font-size: 14.399999618530273px; line-height: 21px;&quot;&gt;This certificate will no longer be valid in 30 days. To create a new certificate, visit&lt;/span&gt;&lt;a href=&quot;https://developer.apple.com/account/&quot; style=&quot;background-color: white; color: #1155cc; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, Geneva, Verdana, sans-serif; font-size: 14.399999618530273px; line-height: 21px;&quot; target=&quot;_blank&quot;&gt;Certificates, Identifiers &amp;amp; Profiles&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, Geneva, Verdana, sans-serif; font-size: 14.399999618530273px; line-height: 21px;&quot;&gt;&amp;nbsp;in Member Center.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #222222; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, Geneva, Verdana, sans-serif; font-size: 14.399999618530273px; line-height: 21px;&quot; /&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, Geneva, Verdana, sans-serif; font-size: 14.399999618530273px; line-height: 21px;&quot;&gt;Certificate: iOS Distribution Certificate&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, Geneva, Verdana, sans-serif; font-size: 14.399999618530273px; line-height: 21px;&quot;&gt;Team Name: 98X643NLB6&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #222222; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, Geneva, Verdana, sans-serif; font-size: 14.399999618530273px; line-height: 21px;&quot; /&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, Geneva, Verdana, sans-serif; font-size: 14.399999618530273px; line-height: 21px;&quot;&gt;To learn more about expired certificates, visit the&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://developer.apple.com/support/technical/certificates/&quot; style=&quot;background-color: white; color: #1155cc; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, Geneva, Verdana, sans-serif; font-size: 14.399999618530273px; line-height: 21px;&quot; target=&quot;_blank&quot;&gt;certificates support page&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, Geneva, Verdana, sans-serif; font-size: 14.399999618530273px; line-height: 21px;&quot;&gt;.&quot;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;color: #222222; font-family: Lucida Grande, Arial, Helvetica, Geneva, Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 21px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #222222; font-family: Lucida Grande, Arial, Helvetica, Geneva, Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 21px;&quot;&gt;Which just happens to be 30 days to the day.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #222222; font-family: Lucida Grande, Arial, Helvetica, Geneva, Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 21px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #222222; font-family: Lucida Grande, Arial, Helvetica, Geneva, Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 21px;&quot;&gt;But, before I go there, let&#39;s note this: on that blog, I used the assistant to create a provision profile called &quot;&lt;/span&gt;&lt;/span&gt;JlptProfileForIphone&quot;. &amp;nbsp;The I picked my phone, a 4S, called &quot;Mark Donaghue’s iPhone&quot;.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Umm, I just noticed, though, when I look at my devices, that my phone is &quot;no longer connected&quot;. Could this be the problem? I need to use iTunes (btw - why a music player for all this complicated software connection stuff?) to reconnect. But, if I take the plunge and do that, it tells me I have purchased items I need to transfer. Hmmm...why isn&#39;t that being handled automatically?&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So - now I have to decide if I should go down that route, or stick with learning about the expired certificates. It could fix it - or it could make it worse. Usually, I&#39;d stick without making the change, under the theory that I need to keep the variables reduced. But I did see something on SO that talked about this problem being caused be a change to IOS7.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So, let&#39;s just hold off on that for now. I&#39;m still dealing with the disconnected issue.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Also, why is the certificate name &quot;IOS distribution certificate&quot;? Should it be under my name or my app name or something?&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Ok, there are a few things to follow up on:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
1) The email telling me that my certificates are going to expire&lt;/div&gt;
&lt;div&gt;
2) From the developer site, I have two certificates - developer and distribution. They&#39;re called IOS Developer and IOS Distribution. And they both don&#39;t expire until Jan, 2016.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
3) I have 4 app IDs:&lt;/div&gt;
&lt;div&gt;
name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; id&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #ebebeb; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 20px; white-space: nowrap;&quot;&gt;com.kanjisoft.jlptvocabquiz -&amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;background-color: #ebebeb; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 20px; white-space: nowrap;&quot;&gt;com.kanjisoft.jlptvocabquiz&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #ebebeb; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 20px; white-space: nowrap;&quot;&gt;JLPT Vocabulary Quiz App &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ebebeb; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 20px; white-space: nowrap;&quot;&gt;com.kanjisoft.JlptVocabularyQuiz&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
And a couple more unrelated. &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
4) I have 3 devices - my iphone, my ipod, and a borrowed iPhone 5.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
5) I have a 8 provision profiles - 6 development profiles, and two distribution profiles. Both distribution profiles are expired as of Jan 1, 201.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #ebebeb; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 20px; white-space: nowrap;&quot;&gt;JLPT Vocabulary Quiz App Profile &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ebebeb; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 20px; white-space: nowrap;&quot;&gt;JLPT Vocabulary Quiz App (com.kanjisoft.JlptVocabularyQuiz)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #ebebeb; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 20px; white-space: nowrap;&quot;&gt;JlPTVocabQuizDistributionProfile &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ebebeb; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 20px; white-space: nowrap;&quot;&gt;JlptVocabQuiz (*)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #ebebeb; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 20px; white-space: nowrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So now, my question is - what app Id is the one in the store? And what provision am I using for it?&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So, according to my last blog entry - and the error message - the provisioning profile FOR DEVELOPMENT is &quot;&lt;span style=&quot;background-color: #ebebeb; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 20px; white-space: nowrap;&quot;&gt;JlptProfileForIphone&quot;. &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
And the appid associated with it, (this is coming from &quot;https://developer.apple.com/account/ios/profile/profileList.action&quot;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&quot;&lt;span style=&quot;background-color: #ebebeb; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 20px; white-space: nowrap;&quot;&gt;JlptVocabQuiz (*)&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #ebebeb; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 20px; white-space: nowrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
Ok, so ideally, those are the only two I should care about.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Now, back to the &quot;expiring IOS distribution certificate&quot;. Is that one of the two from above? What was the identifier?&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, Geneva, Verdana, sans-serif; font-size: 14.399999618530273px; line-height: 21px;&quot;&gt;Certificate: iOS Distribution Certificate&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, Geneva, Verdana, sans-serif; font-size: 14.399999618530273px; line-height: 21px;&quot;&gt;Team Name: 98X643NLB6&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Well, that&#39;s the prefix for all my my JLPT apps. But, again, the IOS Distribution Certificate says it&#39;s not expired until 2015 - same as the development certificate.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Btw, here&#39;s another piece of info. This came from the email warning me about the expiring IOS distribution certificate:&lt;/div&gt;
&lt;div&gt;
&lt;h3 class=&quot;underline&quot; style=&quot;background-color: white; border-bottom-color: rgb(224, 224, 224); border-bottom-style: solid; border-bottom-width: 1px; font-family: &#39;Lucida Grande&#39;, Geneva, Arial, Verdana, sans-serif; font-size: 14px; line-height: 1.3em; margin: 0px -2px 0.6em; padding: 1em 2px 0.25em;&quot;&gt;
I received an error message saying, &quot;Xcode could not find a valid private-key/certificate pair for this profile in your keychain.&quot; What should I do?&lt;/h3&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Lucida Grande&#39;, Geneva, Arial, Verdana, sans-serif; font-size: 12px; line-height: 12px; margin-bottom: 18px; padding: 0px;&quot;&gt;
This error message indicates that your Mac&#39;s Keychain is missing either the public or private key for the certificate you are using to sign your app.&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Lucida Grande&#39;, Geneva, Arial, Verdana, sans-serif; font-size: 12px; line-height: 12px; margin-bottom: 18px; padding: 0px;&quot;&gt;
This often happens when you are trying to sign and build your app from a different Mac than the one you originally used to request your code signing certificate. It can also happen if your certificate has expired or has been revoked. Ensure that your app&#39;s provisioning profile contains a valid code signing certificate, and that your Mac&#39;s Keychain contains that certificate, the private key originally used to generate that certificate, and the WWDR Intermediate Certificate.&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Lucida Grande&#39;, Geneva, Arial, Verdana, sans-serif; font-size: 12px; line-height: 12px; margin-bottom: 18px; padding: 0px;&quot;&gt;
For instructions on how to resolve this error, review the&lt;a href=&quot;https://developer.apple.com/support/technical/code-signing/&quot; style=&quot;color: #0088cc; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&amp;nbsp;Code Signing&lt;/a&gt;&amp;nbsp;support page.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
So, Mac&#39;s keychain is missing the public or private key for the certificate I&#39;m using to sign the app. So, I&#39;m not sure if it&#39;s the developer or the distribution but I&#39;m guessing it&#39;s the developer, since that&#39;s what I&#39;m using to try to build the app.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
It would happen if I&#39;m on a different mac because...the keychain won&#39;t be there. That&#39;s not the problem, I&#39;ve only ever had this mac. So, maybe that revocation warning somehow took effect, although the site states it&#39;s valid through 2015. Why?&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Anyway, the solution looks onerous:&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Lucida Grande&#39;, Geneva, Arial, Verdana, sans-serif; font-size: 12px; line-height: 12px;&quot;&gt;Ensure that your app&#39;s provisioning profile contains a valid code signing certificate,&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Lucida Grande&#39;, Geneva, Arial, Verdana, sans-serif; font-size: 12px; line-height: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Lucida Grande&#39;, Geneva, Arial, Verdana, sans-serif; font-size: 12px; line-height: 12px;&quot;&gt;and that your Mac&#39;s Keychain contains that certificate,&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Lucida Grande&#39;, Geneva, Arial, Verdana, sans-serif; font-size: 12px; line-height: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Lucida Grande&#39;, Geneva, Arial, Verdana, sans-serif; font-size: 12px; line-height: 12px;&quot;&gt;the private key originally used to generate that certificate,&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Lucida Grande&#39;, Geneva, Arial, Verdana, sans-serif; font-size: 12px; line-height: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Lucida Grande&#39;, Geneva, Arial, Verdana, sans-serif; font-size: 12px; line-height: 12px;&quot;&gt;and the WWDR Intermediate Certificate.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Yikes. &amp;nbsp;I have vague recollections about this stuff. There&#39;s a .provision somewhere. But, with the new xcode, it was supposed to be managed from Organizer, too.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Well, let&#39;s follow the&amp;nbsp;&lt;a href=&quot;https://developer.apple.com/support/technical/code-signing/&quot; style=&quot;color: #0088cc; font-family: &#39;Lucida Grande&#39;, Geneva, Arial, Verdana, sans-serif; font-size: 12px; line-height: 12px; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Code Signing&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Lucida Grande&#39;, Geneva, Arial, Verdana, sans-serif; font-size: 12px; line-height: 12px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&amp;nbsp;link.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&quot;&lt;/div&gt;
&lt;h1 style=&quot;background-color: white; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Helvetica, Arial, Verdana, sans-serif; font-size: 28px; font-weight: normal; line-height: 1.2em; margin: 0px 0px 18px; padding: 0px;&quot;&gt;
Code Signing&lt;/h1&gt;
&lt;h3 class=&quot;underline&quot; style=&quot;background-color: white; border-bottom-color: rgb(224, 224, 224); border-bottom-style: solid; border-bottom-width: 1px; font-family: &#39;Lucida Grande&#39;, Geneva, Arial, Verdana, sans-serif; font-size: 14px; line-height: 1.3em; margin: 0px -2px 0.6em; padding: 1em 2px 0.25em;&quot;&gt;
Overview&lt;/h3&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Lucida Grande&#39;, Geneva, Arial, Verdana, sans-serif; font-size: 12px; line-height: 12px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Code signing your app assures users that it is from a known source and the app hasn’t been modified since it was last signed. Before your Mac app or iOS app be can used with store services, installed on an iOS device for development or testing, or submitted to the App Store, it must be signed with a&amp;nbsp;&lt;a href=&quot;https://developer.apple.com/support/technical/certificates/&quot; style=&quot;color: #0088cc; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;certificate&lt;/a&gt;&amp;nbsp;issued by Apple. For more information on how to request certificates and code sign your apps, review the&amp;nbsp;&lt;a href=&quot;https://developer.apple.com/library/etc/redirect/DTS/iOSAppDistGuide&quot; style=&quot;color: #0088cc; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;App Distribution Guide&lt;/a&gt;.&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Lucida Grande&#39;, Geneva, Arial, Verdana, sans-serif; font-size: 12px; line-height: 12px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
This has a very back-to-square-one look to it.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Ok, if I go back to the original error, it says: &quot;a valid signing identity could not be found&quot;. So, what if I download the certificate for development that&#39;s supposedly valid?&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
When I do that, it took me to the list of certificates in keychain. Some of them are expired, but a few aren&#39;t. So, then when I try to build, and get the error about invalid key, and choose fix, and select whatever it was I selected - suddenly it goes into seemingly successful build, which asks for access to the keychain and everything. Now, this might have worked from the get-go, but I didn&#39;t know what to choose. Anyway, it&#39;s alway better to *understand* as much as you can about what your dealing with. In the end, you know more, and you save time - sometimes a lot. The computer likes it when you try to understand her.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gettingintomobile.blogspot.com/feeds/2119666543715963642/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gettingintomobile.blogspot.com/2014/01/certificate-issues-what-else-is-new.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/2119666543715963642'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/2119666543715963642'/><link rel='alternate' type='text/html' href='http://gettingintomobile.blogspot.com/2014/01/certificate-issues-what-else-is-new.html' title='Certificate issues - what else is new? '/><author><name>Getting Into Mobile</name><uri>http://www.blogger.com/profile/10712519676082391096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5315596295108076178.post-2578984617786651207</id><published>2013-02-17T15:13:00.001-08:00</published><updated>2013-02-17T15:13:16.873-08:00</updated><title type='text'>Testing on an iPhone 5</title><content type='html'>So, I have a borrowed iPhone 5, which I&#39;m planning to test my app on. I&#39;ll never get this process down, no matter how many times I do it. But, IIRC, you need to set up a &quot;provisioning profile&quot;, which is unique to the developer, device and app.&lt;br /&gt;
&lt;br /&gt;
If I try to run it without doing anything, I get this error message: &quot;The entitlements specified in your application’s Code Signing Entitlements file do not match those specified in your provisioning profile.&quot; I&#39;m assuming that it&#39;s because the app doesn&#39;t have a provisioning profile specifying the new device.&lt;br /&gt;
&lt;br /&gt;
Ok, here&#39;s what I did:&lt;br /&gt;
&lt;br /&gt;
1) Went to organizer, right clicked on the device (the iPhone 5) and selected &quot;add device to provisioning portal&quot;&lt;br /&gt;
2) Noticed from the link below that my app id must be a specific one (not wildcard) because it uses in-app purchases.&lt;br /&gt;
3) Since there was only one profile that matched the app name (see bundle-id in the plist) that was specific, I knew that had to be the one.&lt;br /&gt;
4) I checked the devices associated with the profile, and the iPhone was on it from step 1.&lt;br /&gt;
5) I downloaded the devices and double-clicked it.&lt;br /&gt;
6) That brought it into the keychain, I think.&lt;br /&gt;
7) I ran the app and it worked!&lt;br /&gt;
&lt;br /&gt;
Here&#39;s the link I was looking at:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
http://iphone.gumbypp.com/provisioning.html&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;/h2&gt;
&lt;h2&gt;
&lt;span style=&quot;font-family: inherit; font-size: small; font-weight: normal;&quot;&gt;&quot;Provisioning is the way by which you can test on a device. Only iPhone developer program members get this privilege - which is reasonably priced at $99/year. All of the action starts at the Developer program portal.&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;h2&gt;
&lt;span style=&quot;font-family: inherit; font-size: small; font-weight: normal;&quot;&gt;Here&#39;s what you need to do for on-device testing:&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;h2&gt;
&lt;span style=&quot;font-family: inherit; font-size: small; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; Create a certificate - this I have&lt;/span&gt;&lt;/h2&gt;
&lt;h2&gt;
&lt;span style=&quot;font-family: inherit; font-size: small; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; Create a specific or Wild-card App ID - have&lt;/span&gt;&lt;/h2&gt;
&lt;h2&gt;
&lt;span style=&quot;font-family: inherit; font-size: small; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; Add one or more test devices - would be nice to have to just add the device.&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;h2&gt;
&lt;span style=&quot;font-family: inherit; font-size: small; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; Create a provisioning profile&lt;/span&gt;&lt;/h2&gt;
&lt;h2&gt;
&lt;span style=&quot;font-family: inherit; font-size: small; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; Install the app on the test device(s)&lt;/span&gt;&lt;/h2&gt;
&lt;h2&gt;
&lt;span style=&quot;font-family: inherit; font-size: small; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; Go have a beer if it all worked!&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit; font-size: small; font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit; font-size: small; font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit; font-size: small; font-weight: normal;&quot;&gt;Ok, what is my provisioning profile for this app? Maybe it&#39;s in Organizer, or Keychain.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit; font-size: small; font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Well, Organizer has a couple of them. One is name &quot;Jlpt Vocabulary Quiz App Profile&quot;. Created on 2/6/13, expiration at the end of this year. Another is the JLPT profile for iPhone. It was created 1/20/2013 and expires a year from that.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Here&#39;s the part on certificates:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Certificates&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Enter the program portal&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Click on the &quot;Certificates&quot; link on the left panel&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Select the &quot;Development&quot; or &quot;Distribution&quot; tab&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Follow the steps under the &quot;How To&quot; tab to actually create a certificate:&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Generating a Certificate Signing Request&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Submitting a Certificate Signing Request for Approval&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Approving Certificate Signing Requests&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Downloading and Installing Development Certificates&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Saving your Private Key and Transferring to other Systems&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;You&#39;ll probably need at least one development certificate and one distribution certificate. You&#39;ll need a development certificate if you want to test with the APNS (Apple Push Notification Service) sandbox, or if you want to debug on the device with Xcode. I&#39;ve never needed more than one of each. The distribution certificate can be used for both Ad Hoc and App Store distributions. Each certificate can be mapped to one or more devices in a profile when provisioning.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Note: make sure that you install the &quot;WWDR Intermediate Certificate&quot;.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Adding devices:&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Devices&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;This is how you add a new device (iPhone, iPod Touch and maybe even the new iPad) to your account. Such devices can then be provisioned with a development or distribution profile to run apps that are not available in the App Store (this is called &quot;Ad Hoc&quot; distribution).&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Adding new devices:&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; Enter the program portal&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; Click on the &quot;Devices&quot; link on the left panel&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; Click on &quot;Add Devices&quot; to enter each device&#39;s ID (40 hex characters). The device ID is available from iBeta (a free download from the app store) or from iTunes by clicking on the &quot;Serial Number&quot; label in the device&#39;s &quot;Summary&quot; tab. See here for more info.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Note: You can only have 100 devices per license-year. If you delete a device, the slot won&#39;t actually be available until the renewal date of your license. Once you add a device after your renewal date, all used slots get locked-in until the NEXT year. &quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-weight: normal;&quot;&gt;
&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-weight: normal;&quot;&gt;
&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gettingintomobile.blogspot.com/feeds/2578984617786651207/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gettingintomobile.blogspot.com/2013/02/testing-on-iphone-5.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/2578984617786651207'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/2578984617786651207'/><link rel='alternate' type='text/html' href='http://gettingintomobile.blogspot.com/2013/02/testing-on-iphone-5.html' title='Testing on an iPhone 5'/><author><name>Getting Into Mobile</name><uri>http://www.blogger.com/profile/10712519676082391096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5315596295108076178.post-1395569803556402755</id><published>2013-02-16T20:08:00.002-08:00</published><updated>2013-02-17T15:40:21.027-08:00</updated><title type='text'>Converting to iPhone 5 - step 2. </title><content type='html'>Ok, today I&#39;m going to try to get a non-spash-screen to work in the iPhone.&lt;br /&gt;
&lt;br /&gt;
Since there was a separate image for the splash, I wonder if I need a separate image for all the screens? Or can auto-resize somehow work?&lt;br /&gt;
&lt;br /&gt;
One guy on SO says&lt;br /&gt;
&lt;br /&gt;
&quot;You shouldn&#39;t change the size of your xibs, because you&#39;ll want your app
 to work on both old and new phones.  However, you may want to change 
the autoresizing masks of some of the views in your xibs so that they 
stretch to fill the larger screen.&quot;&lt;br /&gt;
&lt;br /&gt;
Ok, this looks good:&lt;br /&gt;
&lt;br /&gt;
&quot;Make sure, your Xibs/Views use auto-layout to resize themselves.&lt;br /&gt;
&lt;br /&gt;
Use 
springs and struts to resize views.&lt;br /&gt;
&lt;br /&gt;
If this is not good enough for your 
app, design your xib/storyboard for one specific screen size and 
reposition programmatically for the other.&quot;&lt;br /&gt;
&lt;br /&gt;
Ok, step one is to figure out how to get the xibs to auto-layout.&lt;br /&gt;
&lt;br /&gt;
Ah, wait, that&#39;s the one that only supports the iPhone five.&lt;br /&gt;
&lt;br /&gt;
It&#39;s the auto-resizing masks that I need.&lt;br /&gt;
&lt;br /&gt;
I found a post that says use the size inspector in the nib to set it. So, if I click on the size inspector, I get that display which has the struts and springs - looks like a square with a shock absorber.&lt;br /&gt;
&lt;br /&gt;
Clicking on view doesn&#39;t let me do anything with it, but if I click on image view, it lets me select arrange position view of &quot;resize vertically&quot;. Let&#39;s give it a try.&lt;br /&gt;
&lt;br /&gt;
Hmm.. Nothing. Why not?&lt;br /&gt;
&lt;br /&gt;
I just have a feeling I&#39;ll need to create a new screen size and code for it. Urgh.&lt;br /&gt;
&lt;br /&gt;
This resizing thing seems to be more oriented toward landscaping. It has to do with when the superview changes size. But, it&#39;s not changing size, it&#39;s starting out at that size. Could that be the problem, somehow?&lt;br /&gt;
&lt;br /&gt;
Whoah - this guy has *exactly* the same problem i do:&lt;br /&gt;
&lt;br /&gt;
http://stackoverflow.com/questions/12595049/iphone-5-cant-get-images-to-auto-resize&lt;br /&gt;
&lt;br /&gt;
and no answers!&lt;br /&gt;
&lt;br /&gt;
I think I&#39;m just going to go straight to loading a separate image based on the difference size.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 13.600000381469727px; line-height: 17.600000381469727px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;typ&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #2b91af; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CGRect&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; screenBounds &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;[[&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #2b91af; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;UIScreen&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; mainScreen&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; bounds&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;];&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: darkblue; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;screenBounds&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;height &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: maroon; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;568&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: grey; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// code for 4-inch screen&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: darkblue; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: grey; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// code for 3.5-inch screen&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
But, what do I put inside those lines? How do I load the image?&lt;br /&gt;
&lt;br /&gt;
How about this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 13.600000381469727px; line-height: 17.600000381469727px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;typ&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #2b91af; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;UIViewController&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;viewController3&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;

  &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: darkblue; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;([[&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #2b91af; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;UIScreen&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; mainScreen&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; bounds&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;height &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: maroon; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;568&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #2b91af; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;UIViewController&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;viewController3 &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;[[[&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;mainscreenview alloc&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; initWithNibName&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;:@&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: maroon; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;iphone5screen&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; bundle&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: darkblue; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; autorelease&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;];&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;               
  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;    
  &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: darkblue; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
     &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #2b91af; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;UIViewController&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;viewController3 &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;[[[&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;mainscreenview alloc&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; initWithNibName&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;:@&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: maroon; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;iphone4screen&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; bundle&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: darkblue; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; autorelease&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;];&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
What does initWithNibName do? Do I have to have a separate nib file? Thats&#39; not cool.&lt;br /&gt;
&lt;br /&gt;
hmm...I just saw a suggestion to set the image size to the iphone 5 size, and let it be cropped...&lt;br /&gt;
&lt;br /&gt;
That would be easy. Hmmm...no. It just shows the stretched image taking the same area as the previous unstretched image.&lt;br /&gt;
&lt;br /&gt;
Ok, here&#39;s the trick. Just go to the nib, select attributes, and set the size to &quot;retina 4 full screen&quot;.&lt;br /&gt;
&lt;br /&gt;
Then click on the image view, which is now showing the white space, and drag it down to the bottom of the containing view. &lt;br /&gt;
&lt;br /&gt;
Actually, I ended up setting the size to &quot;none&quot;. In a couple of views, I set the size physically like this:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
background = [&lt;span class=&quot;s1&quot;&gt;UIImage&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;imageNamed&lt;/span&gt;: &lt;span class=&quot;s5&quot;&gt;@&quot;plum_blossoms3_568.png&quot;&lt;/span&gt;];&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
Although, the &quot;_568&quot; is not a good name, because the real size is 468 x 548 pixels for the one I name 568, because I just took the existing height / 4 * 5 and increased the height to that.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;
A couple of the views had image views instead of loading the image as shown above, and I just changed the attached view to the _568 and it seemed to work ok. Although, on on display, I had to use the struts in the nib to anchor the top and bottom by setting them red, which turns off auto-sizing from the center view to the superview, which means the distance is fixed, thus the anchor. Note that setting the autosize to red on the inside allows the view to expand, so I did that for the vertical and it fixed the problem. &lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
Alright, next step - the grueling process of testing on on a borrowed iphone 5!&amp;nbsp;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://gettingintomobile.blogspot.com/feeds/1395569803556402755/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gettingintomobile.blogspot.com/2013/02/converting-to-iphone-5-step-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/1395569803556402755'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/1395569803556402755'/><link rel='alternate' type='text/html' href='http://gettingintomobile.blogspot.com/2013/02/converting-to-iphone-5-step-2.html' title='Converting to iPhone 5 - step 2. '/><author><name>Getting Into Mobile</name><uri>http://www.blogger.com/profile/10712519676082391096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5315596295108076178.post-3977569087431806172</id><published>2013-02-16T17:37:00.000-08:00</published><updated>2013-02-16T17:37:26.231-08:00</updated><title type='text'>iPhone 5 - changing to, and running on. </title><content type='html'>So, I decided to submit my app, and they came back saying they needed screenshots for an iPhone 5. It&#39;s always something! So, when I ran it on an iPhone 5 simulator, of course the bottom of the display is all white, because the display is longer. I think this is going to be yet another painful process, because I vaguely remember struggling to get the background, which is based on a ragged, parchment kind of motif to fit. It other, this is going to *SUCK*.&lt;br /&gt;
&lt;br /&gt;
Anyway, we&#39;ll never know until we try. So, let&#39;s google something basic like convert app to iphone 5.&lt;br /&gt;
&lt;br /&gt;
&quot;You definitely need to install XCode 4.5, and to create a new splash image for the 4-inch screen, called &lt;code&gt;Default-568h@2x.png&lt;/code&gt;.&lt;br /&gt;
&lt;div class=&quot;post-text&quot;&gt;
You shouldn&#39;t change the size of your xibs, because you&#39;ll want your 
app to work on both old and new phones.  However, you may want to change
 the autoresizing masks of some of the views in your xibs so that they 
stretch to fill the larger screen.&quot;&lt;br /&gt;
&lt;br /&gt;
I&#39;m on 4.6, so that&#39;s not an issue. This new splash image, I don&#39;t have any idea.&lt;br /&gt;
&lt;br /&gt;
It would be nice if I just have to change some autoresizing masks.&lt;br /&gt;
&lt;br /&gt;
This one has a ton of upvotes:&lt;br /&gt;
&lt;br /&gt;
&lt;table style=&quot;background-color: white; border-collapse: collapse; border-spacing: 0px; border: 0px; color: black; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 12.800000190734863px; line-height: 9.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;tbody style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; font-size: 12.800000190734863px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;tr style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; font-size: 12.800000190734863px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;td class=&quot;votecell&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; font-size: 12.800000190734863px; margin: 0px; padding: 0px; vertical-align: top; width: 60px;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;answercell&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; font-size: 12.800000190734863px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;div class=&quot;post-text&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; font-size: 13.600000381469727px; line-height: 17.600000381469727px; margin: 0px 5px 5px 0px; padding: 0px; vertical-align: baseline; width: 660px;&quot;&gt;
&lt;ol style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1em 30px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;Download and install latest version of&amp;nbsp;&lt;a href=&quot;http://itunes.apple.com/us/app/xcode/id497799835?mt=12&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #4a6b82; cursor: pointer; font-size: 13.600000381469727px; margin: 0px; padding: 0px; text-decoration: initial; vertical-align: baseline;&quot;&gt;Xcode&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;// I did that recently&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;ol style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1em 30px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;Set a 4-inch launch image for your app.&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
// This must be &quot;&lt;span style=&quot;background-color: transparent; font-family: Times; font-size: small; line-height: normal;&quot;&gt;create a new splash image for the 4-inch screen, called&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: transparent; font-size: 13.600000381469727px; line-height: normal;&quot;&gt;Default-568h@2x.png&lt;/code&gt;&lt;span style=&quot;background-color: transparent; font-family: Times; font-size: small; line-height: normal;&quot;&gt;.&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;ol style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1em 30px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;This is how you get 1136 px screen height (without it, you will get 960 px with black margins on top and bottom).&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
// 960 must be the 3.5&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;ol style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1em 30px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;Test your app, and hopefully do nothing else, since everything should work magically if you had set auto resizing masks properly.&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
//&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;ol style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1em 30px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;If you didn&#39;t, adjust your view layouts with proper auto resizing masks or look into Auto Layout if you only want to support iOS 6 going forward.&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;ol style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1em 30px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;If there is something you have to do for the larger screen specifically, then it looks like you have to check height of&amp;nbsp;&lt;code style=&quot;background-color: #eeeeee; background-position: initial initial; background-repeat: initial initial; border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;[[UIScreen mainScreen] bounds]&lt;/code&gt;&amp;nbsp;(or applicationFrame, but then you need to consider status bar height if it&#39;s present) as there seems to be no specific API for that.&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: transparent; border: 0px; clear: both; font-size: 13.600000381469727px; margin-bottom: 1em; padding: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;
Example:&lt;/div&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 13.600000381469727px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;typ&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #2b91af; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CGRect&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; screenBounds &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;[[&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #2b91af; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;UIScreen&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; mainScreen&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; bounds&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;];&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: darkblue; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;screenBounds&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;height &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: maroon; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;568&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: grey; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// code for 4-inch screen&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: darkblue; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: grey; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// code for 3.5-inch screen&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; font-size: 13.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: transparent; border: 0px; clear: both; font-size: 13.600000381469727px; margin-bottom: 1em; padding: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;
Also note: The auto-rotation API has changed completely, take a look at that as well if your application supports any rotation other than default.&lt;/div&gt;
&lt;/div&gt;
&lt;span style=&quot;line-height: normal;&quot;&gt;// Ok, let&#39;s create an image called&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: monospace; font-size: 14px; line-height: normal;&quot;&gt;Default-568h@2x.png that&#39;s 4 inches high (why&#39;s it named&lt;br /&gt;// 568, which is 1/2 1036 px?&lt;br /&gt;&lt;br /&gt;Hmm - what&#39;s my current splash screen named?&lt;br /&gt;&lt;br /&gt;So, I found an older blog which says there&#39;s a function built-in to iOS which automatically loads the splash screen, no coding needed. The iPhone 4 splash is 960 by 640, which is easy to remember because 960 is just like 9630 without the 3 and 640 is like 6420 without the 2. Also, the 6 in 960 is the first digit of the 640.&lt;br /&gt;&lt;br /&gt;More good info:&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: Lora, serif; font-size: 16px; line-height: 25px;&quot;&gt;&quot;The splash screen image should be in PNG format. By default, you should name the image file for lower screen resolution as “Default.png”. For the image intended for Retina Display (i.e. 640 x 960 screen resolution), name the file as “&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: Lora, serif; font-size: 16px; line-height: 25px;&quot;&gt;Default@2x.png&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: Lora, serif; font-size: 16px; line-height: 25px;&quot;&gt;”. The “@2x” is a standard scale modifier used in iOS. All image files designated for displaying in Retina Display should name with the optional string “@2x”.&lt;br /&gt;&lt;br /&gt;Let&#39;s see if I have anything named that...no such luck.&lt;br /&gt;&lt;br /&gt;Ok, let&#39;s display it in the simulator - command - s saves it directly to the desktop. Then, double-click on the image and brings it up automatically in preview. Go to tools, size and see it&#39;s very nicely in 960 x 640. So, next step is see how to get it into the app. to display.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Lora, serif; font-size: 16px; line-height: 25px;&quot;&gt;Ok, well, the splash page works. Of course, the others don&#39;t.&amp;nbsp; I&#39;ll tackle them in my next post. &amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Lora, serif; font-size: 16px; line-height: 25px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Lora, serif; font-size: 16px; line-height: 25px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Lora, serif; font-size: 16px; line-height: 25px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Lora, serif; font-size: 16px; line-height: 25px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Lora, serif; font-size: 16px; line-height: 25px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Lora, serif; font-size: 16px; line-height: 25px;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gettingintomobile.blogspot.com/feeds/3977569087431806172/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gettingintomobile.blogspot.com/2013/02/iphone-5-changing-to-and-running-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/3977569087431806172'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/3977569087431806172'/><link rel='alternate' type='text/html' href='http://gettingintomobile.blogspot.com/2013/02/iphone-5-changing-to-and-running-on.html' title='iPhone 5 - changing to, and running on. '/><author><name>Getting Into Mobile</name><uri>http://www.blogger.com/profile/10712519676082391096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5315596295108076178.post-5071543653699115722</id><published>2013-01-20T10:56:00.005-08:00</published><updated>2013-01-20T13:31:37.088-08:00</updated><title type='text'>Provisioning Profiles - a labor of love</title><content type='html'>Well, this provisioning profile thing has turned out to be quite a bear - as it always is. Yesterday, I found a post in stack overflow that seemed to be getting to the root of the issue. Today, I&#39;m going to try to see if it works.&lt;br /&gt;
&lt;br /&gt;
The first thing I&#39;m doing is backing up the project (I know - I need to put it on git or svn).&lt;br /&gt;
&lt;br /&gt;
Wait. I need to rename my device, because right now it&#39;s confusingly called &quot;My Name&#39;s iPod&quot; when it&#39;s an iPhone. Arghh.&lt;br /&gt;
&lt;br /&gt;
I deleted my app profiles, but when I try to create a new one, it&#39;s showing up with the iPod name, though (as before) with the correct id for my iPhone.&lt;br /&gt;
&lt;br /&gt;
Ok, I had to delete the old one, then added the device from Xcode&#39;s organizer view. A small victory, at least. It&#39;s showing up now as iPhone (which, btw, I renamed in organizer also just by double-clicking).&lt;br /&gt;
&lt;br /&gt;
Ok, for grins I&#39;m going use the assistant to create a provisioning profile.&lt;br /&gt;
&lt;br /&gt;
At the launch:&lt;br /&gt;
&lt;br /&gt;








&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;b&gt;&quot;Introduction&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
To run an application you&#39;re developing for iPhone, iPad or iPod touch, you must have a Provisioning Profile and a Development Certificate installed on your device and your Mac. The Provisioning Assistant will guide you through the steps to create and install your Development Provisioning Profile and iOS Development Certificate.&quot;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
So, the profile and dev cert have to be on *both* the device and the Mac.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
Ok, now select an app.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
That&#39;s good. The app name is &quot;JlptVocabQuiz&quot;.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
Now, &amp;nbsp;choose an existing iPhone device - pick my iPhone (just renamed).&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
Now, &quot;Use your existing developer certificate&quot;. &amp;nbsp;Ah, it&#39;s all starting to make sense. This wizard really organizes the process nicely.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
Now:&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;







&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;b&gt;&quot;Name your Provisioning Profile&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
A Provisioning Profile is a collection of your App ID, Apple device UDID, and iOS Development Certificate that allows you to install your application on your device.&quot;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
This is really nice. Pulling it all together. Now, I just need to give a name.&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;







&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&quot;Enter a common name or description for your Provisioning Profile using alphanumeric characters. The description you specify will be used throughout the Provisioning Portal to identify this Provisioning Profile.&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
Let&#39;s call &quot;JlptProfileForIphone&quot;.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;







&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;b&gt;&quot;Step 1: Download&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;







&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
Download the Provisioning Profile to your Mac.&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
Ok, it&#39;s in the download folder:&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;







&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;b&gt;&quot;Step 2: Install&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
Connect your device to your Mac and drag the downloaded Provisioning Profile into the ‘Organizer’ window within Xcode. This will automatically install the .mobileprovision file in the proper folder.&quot;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
Ok - should I clean out the provision profile entries from project file first? I think I will.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
Ok - new error. Problem with linking to flurry analytics. Delete all references and the library - and successful build!&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
Let&#39;s see if it runs on the device....&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
Took a couple of tries, but yes - finally the app on the iPhone. But - the mp3s aren&#39;t sounding. On to the next problem.&amp;nbsp;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gettingintomobile.blogspot.com/feeds/5071543653699115722/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gettingintomobile.blogspot.com/2013/01/provisioning-profiles-labor-of-love.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/5071543653699115722'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/5071543653699115722'/><link rel='alternate' type='text/html' href='http://gettingintomobile.blogspot.com/2013/01/provisioning-profiles-labor-of-love.html' title='Provisioning Profiles - a labor of love'/><author><name>Getting Into Mobile</name><uri>http://www.blogger.com/profile/10712519676082391096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5315596295108076178.post-7128104302643356327</id><published>2013-01-19T20:25:00.000-08:00</published><updated>2013-01-20T10:55:36.514-08:00</updated><title type='text'>Getting down with Provisioning Profiles</title><content type='html'>So, I&#39;m going to give an another crack at getting my programming to run on the 4s. So, last Jan 1, I ending up getting tangled up in a web of developer certificates, provisioning profiles, team certificate requests, organizer displays showing the wrong name and the right device, and so forth and so on until I was thoroughly lost. I&#39;m still lost, but have no choice but to try to hack my way out of this digital forest. Do other people have this kind of trouble?&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Oh, yeah, one thing I did do was download Xcode 4.5, which was the one thing I did figure out I needed. Let&#39;s bring that up and see what happens when I try to run the app. 

Ok, when I bring up the app, I get a much clearer message than last time (I think): 

&quot;Provisioning profile &#39;JLPT Vocabulary Quiz Development Profile&#39; has expired&quot;.&lt;br /&gt;
&lt;br /&gt;
So, I guess the provisioning profile is stored on my macbook, say on the keychain, or with the app, as opposed to on the device.The reason is that the phone is new, and therefore the provisioning profile couldn&#39;t be on my device.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Ok, I went to organizer, and all the profiles related to my app were expired.  I tried pressing the &quot;renew&quot; button for the profiles, but nothing. So, I&#39;m just going to delete them. How could they have been on my iPhone anyway?&lt;br /&gt;
&lt;br /&gt;
Ok, I just went to https://developer.apple.com/ios/manage/provisioningprofiles/index.action and deleted the profile there, but I still get the same error when I do a build on Xcode. What next? 

Wow. I think I might have screwed up with all my deleting. I saw an entry on SO that said you just have to right-click on your device in organizer and then just select &quot;add device to profile&quot;. But - the profile is gone. I just deleted it. Rats.&lt;br /&gt;
&lt;br /&gt;
So, now I think I have to recreate it. &amp;nbsp;Ok, in the provisioning portal, under provisioning, the developer tag, I selected &quot;new profile&#39;. I pasted the profile name in. For the app name, it gave me a list of app names to choose from. Three of them roughly match my app name, so I&#39;m picking the one that looks most final (these are names I would&#39;ve created before.&lt;br /&gt;
&lt;br /&gt;
Wow. It&#39;s put the expired profile names that I deleted back in the list! Amazing. And the one I just tried to recreate now has a &quot;pending&quot; status. Let&#39;s refresh it. Active!&lt;br /&gt;
&lt;br /&gt;
Ok, I think I need to download it now or something. 


Ok, when I download it, it hopped into the download folder, and I dragged to to the Xcode icon (btw, why don&#39;t they call it xCode? That spelling is so much more intuitive). Xcode automatically went to organizer after that, and now it says the profile is valid - let&#39;s try a build.&lt;br /&gt;
&lt;br /&gt;
Nope. Not yet. Let&#39;s try the &quot;add device to provisioning portal&quot; again, since the profile was created with only the old iPod as the device.&lt;br /&gt;
&lt;br /&gt;
Well, I tried doing the same thing with the other provision profile with my app name, and somehow the organizer was showing me the expired profiles again! (which I deleted). &lt;br /&gt;
&lt;br /&gt;
Btw, I also modified the settings in Xcode so to add the profile name for signing on the app store, debug and whatever the other one is.&lt;br /&gt;
&lt;br /&gt;
Ah, now at least I&#39;m getting a different error message:

&quot;Provisioning profile &#39;814FA14A-2A11-4447-BB5A-1CFE7AC042FC&#39; can&#39;t be found&quot;

No idea why it&#39;s looking for that crazy string.&lt;br /&gt;
&lt;br /&gt;
Ok, this SO entry looks *very* interesting (437 upvotes, never seen so many). &lt;br /&gt;
&lt;br /&gt;
&quot;Sometimes your xcode project file gets messed up, especially if you have an old project and first created it with an older version of xcode/iphone sdk. What you need to do is open up the project file in a text editor, search for the &#39;long string&#39; from your error and manually erase that line. In fact, you should just go ahead and erase any line that points to any provisioning profiles. Then reopen the project in xcode, go to the settings and reselect your new profile. This clears up issues like that most of the time.&lt;br /&gt;
&lt;br /&gt;
The lines that point to the provisioning profiles will look like this:&lt;br /&gt;
&amp;nbsp;PROVISIONING_PROFILE = &quot;487F3EAC-05FB-4A2A-9EA0-31F1F35760EB&quot;;
&quot;PROVISIONING_PROFILE[sdk=iphoneos*]&quot; = &quot;487F3EAC-05FB-4A2A-9EA0-31F1F35760EB&quot;;&lt;br /&gt;
&lt;br /&gt;
also in the same thread:&lt;br /&gt;
&lt;br /&gt;
&quot;The .xcodeproj file is actually a directory, like an application bundle, If you right click it in finder, you can select show package contents, and then you will see several files inside (or in terminal just cd into it). The actual project file is the one in there with a .pbxproj extension. Once you open it with a text editor the lines you are looking for should start with &#39;PROVISIONING_PROFILE = or&#39; &#39;&quot;PROVISIONING_PROFILE[sdk=iphoneos*]&quot; =&#39;. Delete all of those and then you should be good&quot;&lt;br /&gt;
&lt;br /&gt;
also:&lt;br /&gt;
&lt;br /&gt;
&quot;I found that, in addition to the above, I had to delete all of my profiles, re-download them from the provisioning portal, and reimport them into XCode. Then, in Build Settings / Code Signing, select the proper profile for all build configurations.&lt;br /&gt;
&lt;br /&gt;
However, in Xcode 4.2 and later, there is a much easier way to access this text and select and delete it. In the Project Navigator on the left, select your project (the topmost line of the Project Navigator). Now simply choose View &amp;gt; Version Editor &amp;gt; Show Version Editor. This displays your project as text, and you can search for PROVISIONING and delete the troublesome line, right there in the editor pane of Xcode.&quot;&lt;br /&gt;
&lt;br /&gt;
Phew. I think I&#39;ll tackle this tomorrow. Hopefully, I&#39;ve finally gotten to the bottom of this tangled web of yarn.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://gettingintomobile.blogspot.com/feeds/7128104302643356327/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gettingintomobile.blogspot.com/2013/01/so-im-going-to-give-another-crack-at.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/7128104302643356327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/7128104302643356327'/><link rel='alternate' type='text/html' href='http://gettingintomobile.blogspot.com/2013/01/so-im-going-to-give-another-crack-at.html' title='Getting down with Provisioning Profiles'/><author><name>Getting Into Mobile</name><uri>http://www.blogger.com/profile/10712519676082391096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5315596295108076178.post-6960704987839540991</id><published>2013-01-01T17:18:00.001-08:00</published><updated>2013-01-19T19:06:05.462-08:00</updated><title type='text'>iO6 6 needs a Xcode 5! </title><content type='html'>Well, I&#39;m getting back into iPhone development *a little bit*. I&#39;ve haven&#39;t been doing it for a while because of, well, other priorities, like locking down this new job I&#39;ve got. But I did some development on the app a while back, and since then I&#39;ve gotten an iPhone 4S (nice!). I strongly recommend for anyone Virgin Mobile&#39;s plan, which provides *unlimited data* for $30 bucks a month. The catch is you need to purchase the iPhone 4 or 4s model, with the 4s running at around $400 bucks as of late December.&lt;br /&gt;
&lt;br /&gt;
Anyway, so my first obstacle is getting the program to run on the 4s. It appears (the device) on the organizer, but when I try to run the app, it gives me an error message: 

&quot;Xcode cannot run using the selected device.&quot;

&quot;No provisioned iOS devices are available with a compatible iOS version. Connect an iOS device with a recent enough version of iOS to run your application or choose an iOS simulator as a destination&quot;.&lt;br /&gt;
&lt;br /&gt;
Well, that&#39;s a surprisingly wordy yet somewhat helpful message. I suspect that it&#39;s only checking for previously provisioned devices, which at this point is my iPod touch, which I haven&#39;t updated for a while and therefore probably is running the old version of the iOS?&lt;br /&gt;
&lt;br /&gt;
I&#39;m not sure, but I think I need to provision the new device (4s) for development. 

Ah, actually, I missed this message on the Organaizer: &quot;The version of iOS on “My Names’s iPod” does not match any of the versions of iOS supported for development with this installation of the iOS SDK. Please restore the device to a version of the OS listed below, or update to the latest version of the iOS SDK; which is available here.&quot; &lt;br /&gt;
&lt;br /&gt;
Hmmm, I get conflicting advice from Google. I know there&#39;s a yellow dot next to the device name on Organizer - it should be green. Also, it&#39;s called &quot;My Name&#39;s iPod Touch&quot; which is bad since I&#39;m connected to a 4s, yet its showing up, correctly, as an iPhone 4s as the device type.&lt;br /&gt;
&lt;br /&gt;
Also, I&#39;m pretty sure I never provisioned it for development or anything else yet.&lt;br /&gt;
&lt;br /&gt;
So...what does it want? 

I&#39;m thinking I need to provision this device, at least. If I right click on provisioning, and click help, I get a menu, which leads me to this:&lt;br /&gt;
&lt;br /&gt;
Obtaining Certificates and Provisioning Profiles&lt;br /&gt;
&amp;nbsp;1. In the Devices organizer, select Provisioning Profiles in the Library section.&lt;br /&gt;
&amp;nbsp;2. Click Refresh.&lt;br /&gt;
&lt;br /&gt;
What is a provisioning profile, exactly?&lt;br /&gt;
&amp;nbsp;&quot;A provisioning profile is a collection of digital entities that uniquely ties developers and devices to an authorized iPhone Development Team and enables a device to be used for testing.&quot;&lt;br /&gt;
&lt;br /&gt;
Great. Clear as mud.&lt;br /&gt;
&lt;br /&gt;
&quot;A Development Provisioning Profile must be installed on each device on which you wish to run your application code.&quot;&lt;br /&gt;
&lt;br /&gt;
Well, whatever this frikkin&#39; development provisioning profile is, it needs to be on the device. So I need to do this somehow. &lt;br /&gt;
&lt;br /&gt;
&quot;Each Development Provisioning Profile will contain a set of iPhone Development Certificates, Unique Device Identifiers and an App ID.&quot;&lt;br /&gt;
&lt;br /&gt;
Brilliant. It needs an &quot;iPhone Development Certificate&quot; - another mysterious piece of digital gobbledy-gook which this russian doll of a process throws at us.&lt;br /&gt;
&lt;br /&gt;
&quot;Devices specified within the provisioning profile can be used for testing only by those individuals whose iPhone Development Certificates are included in the profile.&quot;&lt;br /&gt;
&lt;br /&gt;
Ok, I will need a developer certificate - for inclusion in the developer provisioning profile - which must be installed on the device. Is there a PowerPoint that could make this clearer? With all their money, you think Apple could have better docs than this.&lt;br /&gt;
&lt;br /&gt;
&quot;A single device can contain multiple provisioning profiles.&quot;&lt;br /&gt;
&lt;br /&gt;
Confusing. So, you have the profile. It has a collection of development certificates, device ids, and an app id. It&#39;s easer to think of the development certificates as &quot;developer&quot; certificates, since they are tied to individual.&lt;br /&gt;
&lt;br /&gt;
Only one development provisioning profile per app, it looks like.&lt;br /&gt;
&lt;br /&gt;
So for me, I just have my app, my developer/ment certificate, and my iPhone (I don&#39;t care about the iTouch just now).&lt;br /&gt;
&lt;br /&gt;
Brilliant. more legalese from the help screen:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&quot;Obtain your code signing certificates and provisioning profiles to run apps in development on your development device.&quot;&lt;br /&gt;
&lt;br /&gt;
Now I need a code signing certificate. &amp;nbsp;There seems to be some implicit assumption that I actually know what a code signing certificate is. &amp;nbsp;I&#39;m assuming it is different than the developer certificate, I guess, and certainly different than the provisioning profile (which is for the developer/app/device combined, not just the developer).&lt;br /&gt;
&lt;br /&gt;
&quot;You must enter your development-team credentials so that Xcode can download the provisioning profiles containing your development certificate.&quot;&lt;br /&gt;
&lt;br /&gt;
Umm...wait - I&#39;m not on a development team. Is this something I need to contend with? And, where do I enter the credentials? Btw, what is a &quot;development team&quot; in this context and why do I need to know about it?&lt;br /&gt;
&lt;br /&gt;
&quot;If your development team does not have a development certificate for you, Xcode requests one.&quot;&lt;br /&gt;
&lt;br /&gt;
Highly unlikely that would be the case, since I&#39;m the only developer and have no idea who or what the &quot;development team&quot; is supposed to be. &amp;nbsp;Also, I resent some obscure scrap of data on some Apple server being referred as a &quot;Development Team&quot; as if it was some kind of, you know, actual flesh and blood entity.&lt;br /&gt;
&lt;br /&gt;
&quot;If your keychain does not contain your development certificate but your team has the certificate, Xcode downloads it from your team.&quot;&lt;br /&gt;
&lt;br /&gt;
Again, the team. How does Xcode know which &quot;team&quot; to request it from, anyway?&lt;br /&gt;
&lt;br /&gt;
&quot;If your role in the development team is Member, inform the appropriate person in the team that there’s a pending certificate request.&quot;&lt;br /&gt;
&lt;br /&gt;
Great. Now I&#39;m supposed to know what my &quot;role&quot; is on this heretofore unknown &quot;team&quot;. And what would this &quot;appropriate person&quot; do with this knowledge of my pending developer certificate request?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&quot;If necessary, after the request is approved, follow the steps again to download your development certificate.&quot;&lt;br /&gt;
&lt;br /&gt;
Some happy circumstance will have occurred where my cert is now created and available.&lt;br /&gt;
&lt;br /&gt;
&quot;If you are the team distributor, Xcode requests and downloads your team’s distribution certificate, in addition to downloading your development certificate.&quot;&lt;br /&gt;
&lt;br /&gt;
A &quot;team distribution certificate&quot;? I can&#39;t take much more of this.&lt;br /&gt;
&lt;br /&gt;
So, what is a certificate again? I think it&#39;s just a digital set of bits which can be encrypted by a public/private or private public key combination.&lt;br /&gt;
&lt;br /&gt;
Appears to be a file with some info about the certificate&#39;s owner, and has the owner&#39;s public key. There&#39;s this whole thing about the certificate is signed by the CA (issuing authority) by creating a &quot;hash&quot; of the file using some kind of algorithm, e.g. MD5, then encrypting it using their private key.&lt;br /&gt;
&lt;br /&gt;
Then, when your system receives the message, it checks if the certificate is from a a trusted issuer (which it keeps in a list) and if so, the system uses its public key (stored with the CA in the list) to decrypt the hash value (which means it came from them, if your system succeeds in the decrypt of the signature). Then, you run the decrypted signature (the contents of the cert) through the same hash algorithm, and it matches (the one that came with the message?), then you know it hasn&#39;t been tampered with. 

Whew.&lt;br /&gt;
&lt;br /&gt;
So, I guess you get a certificate issued to you by Apple. A Developer certificate. Now, how does that help us get this app running? It&#39;s got to be connected the provisioning profile for your device and app, so your app can run.&lt;br /&gt;
&lt;br /&gt;
So, that&#39;s what we&#39;re trying to accomplish.&lt;br /&gt;
&lt;br /&gt;
From the dreaded &quot;help&quot; file:&lt;br /&gt;
&lt;br /&gt;
&quot;In the Devices organizer, select Provisioning Profiles in the Library section.

Click Refresh.&quot; &lt;br /&gt;
&lt;br /&gt;
Well, that option isn&#39;t there, but there&#39;s an intriguing one called &quot;Add device to provisioning portal.&quot;&lt;br /&gt;
&lt;br /&gt;
What might a provisioning portal be? Is this addition simply a way for apple to keep track of apps you make?&lt;br /&gt;
&lt;br /&gt;
Anyway, let&#39;s see what happens. &amp;nbsp;Hmm... &quot;No iOS Development Certificate Found&quot; 

&quot;No iOS development certificate was found. Would you like Xcode to request one for you?&quot;&lt;br /&gt;
&lt;br /&gt;
Well, I thought I had one, otherwise how could I have tested an app on my iPod touch? Or do they mean on my iPhone?&lt;br /&gt;
&lt;br /&gt;
Well, I think I&#39;m going to go ahead and let Xcode request it. It should already be in my keychain, but, I don&#39;t remember off the top of my head how to get at it. I&#39;m just going to plunge ahead with this.&lt;br /&gt;
&lt;br /&gt;
Xcode says &quot;Submitting CSR&quot;, then &quot;waiting csr approval&quot;. then &quot;checking for pending csr&quot;. 

Now it says &quot;No iOS Distribution Certificate Found&quot; and &quot;would you like Xcode to request one on your behalf?&quot; Well, I mean, I had one of those too, but let&#39;s go with it. 

Xcode (again) says &quot;Submitting CSR&quot;, and I missed the rest, but now it says: 

&quot;Export Developer Profile?&quot;&lt;br /&gt;
&lt;br /&gt;
&quot;Xcode added a signing certificate to your keychain. To ensure you can export code signing on other macs, you can export a developer profile that contains a backup of all your certificates and profiles. Would you like to export your developer profile now?&quot;&lt;br /&gt;
&lt;br /&gt;
Well, I don&#39;t have another Mac, but my wife and daughter each have one. Anyway, &quot;Export&quot; is the default, so let&#39;s hop on that train.&lt;br /&gt;
&lt;br /&gt;
&quot;Save as: DeveloperProfileExport

and give a password. 

Hmm...well, now I have a valid &quot;iOS Team Provisioning Profile&quot; which shows up in my devices list, but IIRC, I had to create a profile specifically for this app.&quot;&lt;br /&gt;
&lt;br /&gt;
Let&#39;s try to run the app.&lt;br /&gt;
&lt;br /&gt;
Nope. Same problem.&lt;br /&gt;
&lt;br /&gt;
Well, I selected a base sdk, and now my .app is showing up as red in the product folder. One wasn&#39;t selected at all before that. 

I think that this is maybe an issue with the SDK as the original message stated.&lt;br /&gt;
&lt;br /&gt;
\Duh. I should&#39;ve seen this earlier. It&#39;s right there in organizer, after the &quot;develop&quot; prompt:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;OS Installed on My Name&#39;s i whatever:
6.0.1 (10A523)&lt;br /&gt;
&amp;nbsp;Xcode Supported iOS Versions
Latest
5.1 (9B176)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Clearly, I need to download the latest xCode, from here (according the original message): https://developer.apple.com/membercenter/index.action. &lt;br /&gt;
&lt;br /&gt;
Unhelpfully, just the generic developer&#39;s menu. 

This confirms I need to got 4.5:

To develop for iOS 6 you need xcode 4.5. Xcode 4.4.1 supports only 5.1 iOS version (Stack Overflow). 

Wow. Huge down, 1.8 Gig. That&#39;s a wrap for today.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://gettingintomobile.blogspot.com/feeds/6960704987839540991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gettingintomobile.blogspot.com/2013/01/well-im-getting-back-into-iphone.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/6960704987839540991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/6960704987839540991'/><link rel='alternate' type='text/html' href='http://gettingintomobile.blogspot.com/2013/01/well-im-getting-back-into-iphone.html' title='iO6 6 needs a Xcode 5! '/><author><name>Getting Into Mobile</name><uri>http://www.blogger.com/profile/10712519676082391096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5315596295108076178.post-334520063914108690</id><published>2012-02-11T17:47:00.000-08:00</published><updated>2012-02-11T19:14:28.197-08:00</updated><title type='text'>Running a spring 2.5 program using Spring STS templates.</title><content type='html'>As I mentioned, I&#39;m tackling the awkward task of learning Spring 3 via a spring 2.5 book, called Spring Recipes. I managed to get the first program mentioned in Chapter 2, a hello world, running, and I&#39;ld like to share it. &lt;br /&gt;&lt;br /&gt;The first thing I did was use Spring&#39;s STS templates to generate a utility project. That&#39;s file, new, spring template project, spring utility project.  I&#39;ll give it a name of SpringRecipesHello, and a package name of &quot;com.apress.springrecipes.hello&quot;, because that&#39;s what&#39;s in the book. &lt;br /&gt;&lt;br /&gt;Now, we can examine what exactly is generated. Under src/main, we have a couple of classes, ExampleService.java and Service.java.&lt;br /&gt;&lt;br /&gt;Service.java is just an interface:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;package com.apress.springrecipes.hello;&lt;br /&gt;&lt;br /&gt;public interface Service {&lt;br /&gt; &lt;br /&gt; String getMessage();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;ExampleService.java implements the Service:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;package com.apress.springrecipes.hello;&lt;br /&gt;&lt;br /&gt;import org.springframework.stereotype.Component;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * {@link Service} with hard-coded input data.&lt;br /&gt; */&lt;br /&gt;@Component&lt;br /&gt;public class ExampleService implements Service {&lt;br /&gt; &lt;br /&gt; /**&lt;br /&gt;  * Reads next record from input&lt;br /&gt;  */&lt;br /&gt; public String getMessage() {&lt;br /&gt;  return &quot;Hello world!&quot;; &lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You&#39;ll notice the &quot;Component&quot; annotation. I&#39;m pretty sure this is telling Spring that this is a java class to be instantiated, and a scan statement in the configuration file will pick it up. &lt;br /&gt;&lt;br /&gt;But, how do you run the project? &lt;br /&gt;&lt;br /&gt;Well, one way to do is is via the test classes that also get generated. Let&#39;s take a look at those. &lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;br /&gt;package com.apress.springrecipes.hello;&lt;br /&gt;&lt;br /&gt;import com.apress.springrecipes.hello.ExampleService;&lt;br /&gt;import junit.framework.TestCase;&lt;br /&gt;&lt;br /&gt;public class ExampleServiceTests extends TestCase {&lt;br /&gt;&lt;br /&gt; private ExampleService service = new ExampleService();&lt;br /&gt; &lt;br /&gt; public void testReadOnce() throws Exception {&lt;br /&gt;  assertEquals(&quot;Hello world!&quot;, service.getMessage());&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;If we right-click on this and run it as a jUnit test, we&#39;ll get a successful test. Disappointingly, it doesn&#39;t seem to leverage the spring framework at all - there&#39;s no dependency injection. &lt;br /&gt;&lt;br /&gt;Let&#39;s look at the other test class:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;package com.apress.springrecipes.hello;&lt;br /&gt;&lt;br /&gt;import static org.junit.Assert.assertNotNull;&lt;br /&gt;import static org.junit.Assert.assertEquals; &lt;br /&gt;import com.apress.springrecipes.hello.Service;&lt;br /&gt;&lt;br /&gt;import org.junit.Test;&lt;br /&gt;import org.junit.runner.RunWith;&lt;br /&gt;import org.springframework.beans.factory.annotation.Autowired;&lt;br /&gt;import org.springframework.test.context.ContextConfiguration;&lt;br /&gt;import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;&lt;br /&gt;&lt;br /&gt;@ContextConfiguration&lt;br /&gt;@RunWith(SpringJUnit4ClassRunner.class)&lt;br /&gt;public class ExampleConfigurationTests {&lt;br /&gt; &lt;br /&gt; @Autowired&lt;br /&gt; private Service service;&lt;br /&gt;&lt;br /&gt; @Test&lt;br /&gt; public void testSimpleProperties() throws Exception {&lt;br /&gt;  assertNotNull(service);&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; @Test&lt;br /&gt; public void testReadOnce() throws Exception {&lt;br /&gt;  assertEquals(&quot;Hello world!&quot;, service.getMessage());&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I actually added the second test. The @Autowired seems to indicate that the service should be automatically wired, i.e., instantiated and set, into the &quot;service&quot; member. Adding the second test, which succeeds, shows this to be the case.  I didn&#39;t have as much luck when I tried changing the other class to include @Autowired - some type of illegal state applicationcontext not loaded error, so - I&#39;ll leave it at this for now.</content><link rel='replies' type='application/atom+xml' href='http://gettingintomobile.blogspot.com/feeds/334520063914108690/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gettingintomobile.blogspot.com/2012/02/running-spring-25-program-using-spring.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/334520063914108690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/334520063914108690'/><link rel='alternate' type='text/html' href='http://gettingintomobile.blogspot.com/2012/02/running-spring-25-program-using-spring.html' title='Running a spring 2.5 program using Spring STS templates.'/><author><name>Getting Into Mobile</name><uri>http://www.blogger.com/profile/10712519676082391096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5315596295108076178.post-3175657272388104902</id><published>2012-02-03T11:39:00.000-08:00</published><updated>2012-02-03T13:44:12.605-08:00</updated><title type='text'>Spring Recipes, for Spring 2.5  - Chapter 1</title><content type='html'>So, I know this is a little out of date, but I think Spring Recipes for 2. 5 is the best Spring book out there. It doesn&#39;t cover 3.0, but you will definitely get the fundamentals down. Plus, I saw a review of the 3.0 book that said it was *huge*, and I really would rather keep things as streamlined a possible. I really want to nail down the fundamentals of Spring. &lt;br /&gt;&lt;br /&gt;I previously went through the first five chapters, but it was a while ago and I&#39;m going to do a quick review. &lt;br /&gt;&lt;br /&gt;Using a Container&lt;br /&gt;&lt;br /&gt;Chapter one talks about containers. You start out simply enough, with a &quot;ReportGenerator&quot; interface that has the method &quot;generate&quot;.  Generate accepts statistics and generates a report. There are a couple of implementing classes - PdfReportGenerate and HTMLReportGenerator. One of them will print a pdf report, the other will implement an HTML report.  All the report service has to do is instantiate whichever of the two it needs, and call &quot;generate&quot; and pass the statistics. &lt;br /&gt;&lt;br /&gt;The problem is that, say your product services a couple of different organizations, one likes pdf reports, the other HTML reports. That means you have to go in and muck with your report generator for each different organization. So, really for separation of concerns - you don&#39;t want your &quot;what is this organizations type of report&quot; logic mixed in with the &quot;how do I gather statistics&quot; logic, something needs to be done. &lt;br /&gt;&lt;br /&gt;You might initially think, well, let&#39;s just create a separate class that instantiates the report service, instantiates the concrete report generator class and sets the report generator class on the report service. But, possibly as a scalability issue, they suggest setting up a &quot;container&quot; with a map that holds an instance of the report service, an also an instance of the report generator. So, this generator will hang around with an instance of the report service and the report generator that any old class can grab and use. &lt;br /&gt;&lt;br /&gt;So, the report service grabs the report generator from the container whenever it needs it, confident that the correct version of it has been been put in place by the container.  Later on, too keep from mucking with the container, you can have the container read a configuration file for the correct report generator class. &lt;br /&gt;&lt;br /&gt;But what grabs the report service from the container?  Well, the way you would *initially* handle that (we&#39;re working our way through all this), is to create the container from a *main* class. The main class then grabs the report generator from the container, and calls something like &quot;createAnnualReport(2007)&quot;. The report service will have that method, and will scurry about putting together whatever data it needs to create the annual report. Then, as mentioned earlier, the report service will grab whatever report generator is provided by the container, and call &quot;generate(collected data) on it. &lt;br /&gt;&lt;br /&gt;One detail we skimmed over was that when container is created, it puts a static reference to itself (this) into a static variable. This allows the report service to grab the static instance of container from the Container class. Main doesn&#39;t need to bother with that when it gets the report service because it instantiated the container. &lt;br /&gt;&lt;br /&gt;Whew! That&#39;s actually fairly complicated. Just think of the Container as a cupboard full of goodies, which loads itself when instantiated. The main class- the user of the service -  happily grabs the reports service from the cupboard (Container) (after instantiating it), and then uses that service. &lt;br /&gt;&lt;br /&gt;The service just uses the cupboard (Container) to get *whatever* report generator is there. It gets the that, then calls the report generator method. &lt;br /&gt;&lt;br /&gt;Using a Service Locator.&lt;br /&gt;&lt;br /&gt;That&#39;s all well and good - but what if the cupbard/container varies by organization? Some use one server, some use another, perhaps. If you&#39;re writing this framework, do you want to have the code to get the Container (from the report service) vary, depending on how the container is created? According to the book, this could be &quot;complex, proprietary code.&quot; Actually, I wish they gave a better example of this problem. It probably has something to do with the fact that it wouldn&#39;t make sense for each use of the service to create it&#39;s own container - why have a bunch of cupboards (fleeting though they may be) when you can just have one? I&#39;m kind of guessing here, it&#39;s a working hypotheses. &lt;br /&gt;&lt;br /&gt;So, you&#39;ve got to look up the cupboard - find it somewhere on the system. Probably that varies depending on the system. And we don&#39;t want random services, such as the report service, to have to be responsible for this. It doesn&#39;t want to change every time it&#39;s on a new system. &lt;br /&gt;&lt;br /&gt;So, we separate out the container/cupboard lookup logic into a separate class - the service locator bunny class. This is all about separation of concerns, reducing dependencies, etc. So, instead of having the Report Service grab the report generator directly from the container, we have it do something like &quot;ServiceLocator.getReportGenerator();&quot;  And inside the ServiceLocator bunny, it will have method like:&lt;br /&gt;&lt;br /&gt;private static Container = Container.instance  &lt;br /&gt;&lt;br /&gt;and a method which returns the report generator after grabbing it from the cupboard. So, the Service Locator will handle all the work of figuring out where the container is. &lt;br /&gt;&lt;br /&gt;Inversion of Control / Dependency Injection&lt;br /&gt;&lt;br /&gt;Although we&#39;ve gotten rid of a specific dependency by providing a container for the Report Service to grab its ReportGenerator from, and even removed the need of the Report Service be concerned about how to implement lookup  by giving it a Resource Locater which handles that work - we can make Report Service even dumber. After all, all this was all about was getting the correct instance of the report generator to the report service. So, why not just give report service a setter method for the report generator? No lookup whatsoever in your Report Service! This is good stuff, right? &lt;br /&gt;&lt;br /&gt;So, now the container becomes more than just a cupboard. She becomes old Mother Hubbard, giving little Report Service the right instance of the Report Generator and sending her off to school.  Mother Hubbard / Container can also now reduce her exposure by no longer providing access to &quot;this&quot;. &lt;br /&gt;&lt;br /&gt;Note that there are several ways to do injection - setter (via a set method), construction (via - you guessed it - construction) and interface (not widely used).&lt;br /&gt;&lt;br /&gt;Adding a Configuration File.&lt;br /&gt;&lt;br /&gt;Ok, now that we&#39;ve set up all these principals, we really ought to make the whole thing configurable. So, what can we configure, and how? &lt;br /&gt;&lt;br /&gt;For sure, we can define the pdf or html instance of the report generator. We give it a name that the container can refer to it with, and also the actual class name:&lt;br /&gt;&lt;br /&gt;reportGenerator=com.apress.springrecipes.report.PdfReportGenerator&lt;br /&gt;&lt;br /&gt;Come to think of it, we can also specify the report service: &lt;br /&gt;&lt;br /&gt;reportService=com.apress.springrecipes.report.ReportService&lt;br /&gt;&lt;br /&gt;Anything else...hmmm,,,,&lt;br /&gt;&lt;br /&gt;Ah - what about which classes get injected where? We gotta let old mother Hubbard, our container/cupboard, know this: &lt;br /&gt;&lt;br /&gt;reportService.reportGenerator=reportGenerator&lt;br /&gt;&lt;br /&gt;Nice. &lt;br /&gt;&lt;br /&gt;Then, the book shows a slick implementation of the Container class. I *think* there might be typo on Dependency Injection part - it seems like &quot;value&quot; should be &quot;parts[1]&quot; on a certain line. I haven&#39;t tested it though.</content><link rel='replies' type='application/atom+xml' href='http://gettingintomobile.blogspot.com/feeds/3175657272388104902/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gettingintomobile.blogspot.com/2012/02/spring-recipes-for-spring-25-chapter-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/3175657272388104902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/3175657272388104902'/><link rel='alternate' type='text/html' href='http://gettingintomobile.blogspot.com/2012/02/spring-recipes-for-spring-25-chapter-1.html' title='Spring Recipes, for Spring 2.5  - Chapter 1'/><author><name>Getting Into Mobile</name><uri>http://www.blogger.com/profile/10712519676082391096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5315596295108076178.post-4529495882772758764</id><published>2012-01-17T08:12:00.001-08:00</published><updated>2012-01-17T08:25:02.394-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PHP stripslahes"/><title type='text'>Why do you need stripslashes?</title><content type='html'>I was recently called upon to do an example PHP program.  I took a course in it back in 2009, I think, and there are some things I&#39;m a bit fuzzy on. One is when you need to use stripslashes? This blog is an attempt to answer that question. &lt;br /&gt;&lt;br /&gt;From &lt;br /&gt;&lt;br /&gt;http://php.net/manual/en/function.stripslashes.php&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;Un-quotes a quoted string. &lt;br /&gt;&lt;br /&gt;An example use of stripslashes() is when the PHP directive magic_quotes_gpc is on (it&#39;s on by default), and you aren&#39;t inserting this data into a place (such as a database) that requires escaping. For example, if you&#39;re simply outputting data straight from an HTML form. &lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;This really doesn&#39;t clear things up. So, if you get a quotes string - for example &#39;foo&#39; - you want to end up with foo without the quotes. Then why do they call it stripslashes? Is it because the apostrophes are escaped like so: \&#39;, i.e., with a slash? So, does it get rid of the slash *and* the quote? &lt;br /&gt;&lt;br /&gt;Ok, here&#39;s example 1: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;$str = &amp;quot;Is your name O\&amp;#039;reilly?&amp;quot;;&lt;br /&gt;&lt;br /&gt;// Outputs: Is your name O&amp;#039;reilly?&lt;br /&gt;echo stripslashes($str);&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So, it gets rid of the slash, not the quote. Now the question is, where does the slash come from? I&#39;m assuming it&#39;s inserted by a browser, so whatever string it&#39;s processing doesn&#39;t get mangled. &lt;br /&gt;&lt;br /&gt;So, that just leaves the question of why only when your *not* inserting data to a database. And, presumably that&#39;s because the string would get mangled if you unescaped it. &lt;br /&gt;&lt;br /&gt;Ok, that&#39;s it for stripslashes.</content><link rel='replies' type='application/atom+xml' href='http://gettingintomobile.blogspot.com/feeds/4529495882772758764/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gettingintomobile.blogspot.com/2012/01/why-do-you-need-stripslashes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/4529495882772758764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/4529495882772758764'/><link rel='alternate' type='text/html' href='http://gettingintomobile.blogspot.com/2012/01/why-do-you-need-stripslashes.html' title='Why do you need stripslashes?'/><author><name>Getting Into Mobile</name><uri>http://www.blogger.com/profile/10712519676082391096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5315596295108076178.post-4656497015405562927</id><published>2012-01-04T14:16:00.000-08:00</published><updated>2012-02-03T18:31:42.316-08:00</updated><title type='text'>Good tutorial on maven, spring</title><content type='html'>Well, our hopes for a quick attack on Spring 3.0 have been somewhat dashed by an apparent bug in the template generation for an MVC app - although we did luckily manage to get one up and running, which I&#39;ve carefully preserved. &lt;br /&gt;&lt;br /&gt;The tutorial did give a pom.xml file at the end - and I&#39;m wondering if it&#39;s possible to use a war file generate from that successfully create multiple mvc apps.  &lt;br /&gt;&lt;br /&gt;Maven is something I&#39;ve never really had a chance to get into, so I took this as an opportunity to learn a *little* bit about it. &lt;br /&gt;&lt;br /&gt;This is a tutorial I landed upon:&lt;br /&gt;&lt;br /&gt;http://pookey.co.uk/wordpress/archives/50-getting-started-with-maven-and-spring&lt;br /&gt;&lt;br /&gt;I actually got the whole thing to work, start to finish. &lt;br /&gt;&lt;br /&gt;The first thing your supposed to do is this command:&lt;br /&gt;&lt;br /&gt; mvn archetype:generate --batch-mode \&lt;br /&gt;  -DarchetypeArtifactId=maven-archetype-quickstart \ &lt;br /&gt;  -DgroupId=uk.co.pookey.spring \&lt;br /&gt;  -DartifactId=spring-hello \&lt;br /&gt;  -Dversion=1.0-SNAPSHOT&lt;br /&gt;&lt;br /&gt;When you run it from the command line, get rid of the backslashes and put it all on the same line. It turns out when you run it, because you&#39;re specifying the archetype, it&#39;s based on some kind of super-pom that specifies a lot of files. &lt;br /&gt;&lt;br /&gt;It also creates a source and build file structure, and a program called App.java, which looks like this:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;package uk.co.pookey.spring;&lt;br /&gt; &lt;br /&gt;public class App&lt;br /&gt;{&lt;br /&gt;    public static void main( String[] args )&lt;br /&gt;    {&lt;br /&gt;        System.out.println( &quot;Hello World!&quot; );&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;My theory is that the &quot;hello world&quot; app is part of a the arch-type template.  So, you just get this nice vanilla directory structure with a hello world app built in. &lt;br /&gt;&lt;br /&gt;The directory created gets its name from DartifactId=spring-hello&lt;br /&gt;&lt;br /&gt;it also creates a file called pom.xml, as well as src and target directories. &lt;br /&gt;&lt;br /&gt;Here&#39;s the path of the App.java:  src/main/java/uk/co/pookey/spring/App.java&lt;br /&gt;&lt;br /&gt;In order to get the App.java to work, you need to add this to your pom.xml:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;build&amp;gt;&lt;br /&gt;    &amp;lt;plugins&amp;gt;&lt;br /&gt;      &amp;lt;plugin&amp;gt;&lt;br /&gt;        &amp;lt;groupId&amp;gt;org.codehaus.mojo&amp;lt;/groupId&amp;gt;&lt;br /&gt;        &amp;lt;artifactId&amp;gt;exec-maven-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;        &amp;lt;executions&amp;gt;&lt;br /&gt;          &amp;lt;execution&amp;gt;&lt;br /&gt;            &amp;lt;goals&amp;gt;&lt;br /&gt;              &amp;lt;goal&amp;gt;java&amp;lt;/goal&amp;gt;&lt;br /&gt;            &amp;lt;/goals&amp;gt;&lt;br /&gt;          &amp;lt;/execution&amp;gt;&lt;br /&gt;        &amp;lt;/executions&amp;gt;&lt;br /&gt; &lt;br /&gt;        &amp;lt;configuration&amp;gt;&lt;br /&gt;          &amp;lt;mainClass&amp;gt;uk.co.pookey.spring.App&amp;lt;/mainClass&amp;gt;&lt;br /&gt;        &amp;lt;/configuration&amp;gt;&lt;br /&gt;      &amp;lt;/plugin&amp;gt;&lt;br /&gt;    &amp;lt;/plugins&amp;gt;&lt;br /&gt;  &amp;lt;/build&amp;gt;&lt;br /&gt;&lt;br /&gt;This makes this command possible:&lt;br /&gt;&lt;br /&gt;mvn exec:java&lt;br /&gt;&lt;br /&gt;which will execute the java class.&lt;br /&gt;&lt;br /&gt;But first, you need to compile it:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;$ mvn compile&lt;br /&gt;&lt;br /&gt;Then run:&lt;br /&gt;&lt;br /&gt;$ mvn exec:java&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It you&#39;ll see the &quot;Hello&quot; message. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This is fine for creating a standard product structure, but we&#39;re trying to learn a little bit of spring too. &lt;br /&gt;&lt;br /&gt;Well, this fine example does that for us. First it specifies in pom.xml a dependency on the spring container:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;dependencies&amp;gt;&lt;br /&gt;    ...&lt;br /&gt;    &amp;lt;dependency&amp;gt;&lt;br /&gt;      &amp;lt;groupId&amp;gt;org.springframework&amp;lt;/groupId&amp;gt;&lt;br /&gt;      &amp;lt;artifactId&amp;gt;spring&amp;lt;/artifactId&amp;gt;&lt;br /&gt;      &amp;lt;version&amp;gt;2.5.5&amp;lt;/version&amp;gt;&lt;br /&gt;    &amp;lt;/dependency&amp;gt;&lt;br /&gt;  &amp;lt;/dependencies&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I turns out there&#39;s a huge, searchable archive of maven dependencies here:&lt;br /&gt;&lt;br /&gt;http://www.mvnrepository.com/ &lt;br /&gt;&lt;br /&gt;But, this is the one where we are getting our version from:  &lt;br /&gt;&lt;br /&gt;http://www.mvnrepository.com/artifact/org.springframework/spring &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This is the strengths of maven - it just knows what the version numbers of the jar files you need are, automatically - since you specified them in the first place. It also pulls down any spring dependencies. &lt;br /&gt;&lt;br /&gt;Next we create a new pojo in src/main/java/uk/co/pookey/SayHello.java:&lt;br /&gt;&lt;br /&gt;package uk.co.pookey;&lt;br /&gt; &lt;br /&gt;public class SayHello&lt;br /&gt;{&lt;br /&gt; &lt;br /&gt;  private String name;&lt;br /&gt; &lt;br /&gt;  public void setName(String name)&lt;br /&gt;  {&lt;br /&gt;    this.name = name;&lt;br /&gt;  }&lt;br /&gt; &lt;br /&gt;  public String getName()&lt;br /&gt;  {&lt;br /&gt;    return name;&lt;br /&gt;  }&lt;br /&gt; &lt;br /&gt;  public void greet()&lt;br /&gt;  {&lt;br /&gt;    System.out.println(&quot;Hello &quot; + getName());&lt;br /&gt;  }&lt;br /&gt; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This can accept a dependency injection of name, which is printed out later on. &lt;br /&gt;&lt;br /&gt;Next we create the famed bean configuration file:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE beans PUBLIC &amp;quot;-//SPRING//DTD BEAN//EN&amp;quot;&lt;br /&gt;   &amp;quot;http://www.springframework.org/dtd/spring-beans.dtd&amp;quot;&amp;gt;&lt;br /&gt; &lt;br /&gt;&amp;lt;beans&amp;gt;&lt;br /&gt;  &amp;lt;bean id=&amp;quot;hello&amp;quot; class=&amp;quot;uk.co.pookey.SayHello&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;property name=&amp;quot;name&amp;quot; value=&amp;quot;Pookey&amp;quot; /&amp;gt;&lt;br /&gt;  &amp;lt;/bean&amp;gt;&lt;br /&gt;&amp;lt;/beans&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This is going to be placed in src/main/resources/application-context.xml. You need to create the resources directory. &lt;br /&gt;&lt;br /&gt;Finally, we see an example of dependency injection:&lt;br /&gt;&lt;br /&gt;package uk.co.pookey.spring;&lt;br /&gt; &lt;br /&gt;import uk.co.pookey.SayHello;&lt;br /&gt; &lt;br /&gt;i&lt;blockquote&gt;mport org.springframework.core.io.ClassPathResource;&lt;br /&gt;import org.springframework.beans.factory.BeanFactory;&lt;br /&gt;import org.springframework.beans.factory.xml.XmlBeanFactory;&lt;br /&gt; &lt;br /&gt;public class App&lt;br /&gt;{&lt;br /&gt;    public static void main( String[] args )&lt;br /&gt;    {&lt;br /&gt;      BeanFactory factory = new XmlBeanFactory(&lt;br /&gt;          new ClassPathResource(&quot;application-context.xml&quot;));&lt;br /&gt; &lt;br /&gt;      SayHello hello = (SayHello) factory.getBean(&quot;hello&quot;);&lt;br /&gt;      hello.greet();&lt;br /&gt;    }&lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The app class pulls the the hello bean from the XMLBeanFactory and calls &quot;greet&quot; on it. The factory has already taken care of setting the name to &quot;Pookey&quot; based on the configuration.&lt;br /&gt;&lt;br /&gt;Just type &quot;mvn clean compile exec:java&quot; from the directory level of the pom.xml, and you see the &quot;hello, Pookey&quot; result. Nice.</content><link rel='replies' type='application/atom+xml' href='http://gettingintomobile.blogspot.com/feeds/4656497015405562927/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gettingintomobile.blogspot.com/2012/01/good-tutorial-on-maven-spring.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/4656497015405562927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/4656497015405562927'/><link rel='alternate' type='text/html' href='http://gettingintomobile.blogspot.com/2012/01/good-tutorial-on-maven-spring.html' title='Good tutorial on maven, spring'/><author><name>Getting Into Mobile</name><uri>http://www.blogger.com/profile/10712519676082391096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5315596295108076178.post-6206804127647101977</id><published>2012-01-03T09:57:00.000-08:00</published><updated>2012-02-11T16:27:37.453-08:00</updated><title type='text'>Spring 3.0 MVC tutorial  - a detailed breakdown - part 1.</title><content type='html'>I&#39;m having a bit of a problem getting off the blocks with Spring. I&#39;ve decided to get a simple Spring MVC web app running based on this tutorial:&lt;br /&gt;&lt;br /&gt;http://blog.springsource.org/2011/01/04/green-beans-getting-started-with-spring-mvc/&lt;br /&gt;&lt;br /&gt;And I got *one* working. But, when I add another, I get a not found and the server shows a mapping error.&lt;br /&gt;&lt;br /&gt;So, I&#39;m just going to review the tutorial to see if I can glean any hints from that:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Spring MVC, a part of the core Spring Framework, is a mature and capable action-response style web framework, with a wide range of capabilities and options aimed at handling a variety of UI-focused and non-UI-focused web tier use cases.&lt;br /&gt;&lt;br /&gt;All this can potentially be overwhelming to the Spring MVC neophyte. I think it&#39;s useful for this audience to show just how little work there is to get a bare Spring MVC application up and running (i.e. consider my example something akin to the world&#39;s simplest Spring MVC application), and that&#39;s what I&#39;ll spend the rest of this article demonstrating.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Off to a good start.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;I&#39;m assuming you are familiar with Java, Spring (basic dependency injection concepts), and the basic Servlet programming model, but do not know Spring MVC. After reading this blog entry, readers may continue learning about Spring MVC by looking at Keith Donald&#39;s Spring MVC 3 Showcase, or the variety of other online and print resources available that cover Spring and Spring MVC.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;I might check out the MVC showcase later on.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;A note on dependencies and build systems: this article does not assume that you are using a particular build system, e.g. Maven, Gradle or Ant. A fairly minimal sample Maven POM file is includes as an example at the end of the article.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;I badly want to use maven. I can use that on my resume as well.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Spring MVC includes most of the same basic concepts as other so-called web MVC frameworks.&lt;br /&gt;&lt;br /&gt;Incoming requests enter the framework via a Front Controller. I&lt;br /&gt;&lt;br /&gt;n the case of Spring MVC, this is an actual Java Servlet called DispatcherServlet.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Think of DispatcherServlet as the gatekeeper.&lt;br /&gt;&lt;br /&gt;It doesn&#39;t perform any real web or business logic, but rather delegates to POJOs called Controllers where the real work is done (either in whole or via the back-end).&lt;br /&gt;&lt;br /&gt;When the work has been done, it&#39;s the responsibility of Views to produce the output in the proper format (whether that&#39;s a JSP page, Velocity template, or JSON response).&lt;br /&gt;&lt;br /&gt;Strategies are used to decide which Controller (and which method(s) inside that Controller) handles the request, and which View renders the response.&lt;br /&gt;&lt;br /&gt;The Spring container is used to wire together all these pieces. It all looks something like this:&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0zMcEtE4_RSRjfew6qytGW8lDLraPrTfUWR1tp4Q_HUmT1DmaCwjh1nzqQx0NmlOWxldDhOFdcrrfjAs7QFAHjgcpSwpTDhMjmTq-HRofI8Yq_9VA_O1HRGKyua0EfcMF55cC0aXXzS0/s1600/mvc.png&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 205px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0zMcEtE4_RSRjfew6qytGW8lDLraPrTfUWR1tp4Q_HUmT1DmaCwjh1nzqQx0NmlOWxldDhOFdcrrfjAs7QFAHjgcpSwpTDhMjmTq-HRofI8Yq_9VA_O1HRGKyua0EfcMF55cC0aXXzS0/s320/mvc.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5693468652906472914&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Bootstrapping the DispatcherServlet and Spring Container&lt;br /&gt;As mentioned, all incoming requests flow through a DispatcherServlet.&lt;br /&gt;&lt;br /&gt;Like any other Servlet in a Java EE application, we tell the Java EE container to load this Servlet at web app startup time via an in the web app&#39;s WEB-INF/web.xml.&lt;br /&gt;&lt;br /&gt;The DispatcherServlet is also responsible for loading a Spring ApplicationContext that is used to perform wiring and dependency injection of managed component.&lt;br /&gt;&lt;br /&gt;On this basis, we specify some init parameters to the Servlet which configure the Application Context.&lt;br /&gt;&lt;br /&gt;Let&#39;s look at the config in web.xml:&lt;br /&gt;WEB-INF/web.xml&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;&lt;br /&gt;&amp;lt;web-app version=&quot;2.5&quot; xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot;&lt;br /&gt; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&lt;br /&gt; xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&quot;&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;!-- Processes application requests --&amp;gt;&lt;br /&gt; &amp;lt;servlet&amp;gt;&lt;br /&gt;     &amp;lt;servlet-name&amp;gt;appServlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;     &amp;lt;servlet-class&amp;gt;org.springframework.web.servlet.DispatcherServlet&amp;lt;/servlet-class&amp;gt;&lt;br /&gt;     &amp;lt;init-param&amp;gt;&lt;br /&gt;         &amp;lt;param-name&amp;gt;contextConfigLocation&amp;lt;/param-name&amp;gt;&lt;br /&gt;         &amp;lt;param-value&amp;gt;/WEB-INF/spring/appServlet/servlet-context.xml&amp;lt;/param-value&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;appServlet&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;br /&gt;&amp;lt;/web-app&amp;gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Ok, there were a couple of important points made. The dispatcher servlet is loaded when the web-app is loaded. This may imply that each app has it&#39;s own dispatcher servlet.&lt;br /&gt;&lt;br /&gt;This would make sense. each app should have its own front controller. When the request comes into the server, via port 8080, there should be something that lets whatever processes that request know which directory it needs to go to - like the get command parameter. Once it get&#39;s there, the DispatcherServlet takes over.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;A number of things are being done here:&lt;br /&gt;We register the DispatcherServlet as as a Servlet called appServlet&lt;br /&gt;&lt;br /&gt;We map this Servlet to handle incoming requests (relative to the app path) starting with &quot;/&quot;&lt;br /&gt;&lt;br /&gt;// the relative to the app path is key. This must be the directory.&lt;br /&gt;// It&#39;s actually saying &quot;start looking at the part after the &quot;/&quot;&lt;br /&gt;// It would be good to see an example.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We use the ContextConfigLocation init parameter to customize the location for the base configuration XML file for the Spring Application Context that is loaded by the DispatcherServlet, instead of relying on the default location of &lt;servletname&gt;-context.xml).&lt;br /&gt;&lt;br /&gt;&lt;/servletname&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;So, this is just telling the server where the spring application context configuration xml file is.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;Wait, What if Somebody Doesn&#39;t Want to Configure Spring via XML?&lt;br /&gt;The default type of Application Context loaded by the DispatcheServlet expects to load at least on XML file with Spring bean definitions. As you&#39;ll see, we&#39;ll also enable Spring to load Java-based config, alongside the XML.&lt;br /&gt;Everybody will have their own (sometimes very strong) opinion in this area, but while I generally prefer-Java based configuration, I do believe that smaller amounts of XML config for certain areas can sometimes still make more sense, for one of a number of reasons (e.g. ability to change config without recompilation, conciseness of XML namespaces, toolability, etc.). On this basis, this app will use the hybrid approach, supporting both Java and XML.&lt;br /&gt;Rest assured that if you prefer a pure-Java approach, with no Spring XML at all, it&#39;s pretty trivial to achieve, by setting one init param in web.xml to override the default Application Context type and use a variant called AnnotationConfigWebApplicationContext instead.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;All this is saying is you can use java-based configurations (how? through annotations?) instead of an xml based one by specifying a param in the web.xml saying the context type is annotation. Then you don&#39;t have to specify the path of the spring configuration file.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here&#39;s the controller:&lt;br /&gt;&lt;br /&gt;package xyz.sample.baremvc;&lt;br /&gt;&lt;br /&gt;import org.springframework.stereotype.Controller;&lt;br /&gt;import org.springframework.web.bind.annotation.RequestMapping;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;/**&lt;br /&gt;* Handles requests for the application home page.&lt;br /&gt;*/&lt;br /&gt;@Controller&lt;br /&gt;public class HomeController {&lt;br /&gt;&lt;br /&gt; @RequestMapping(value = &quot;/&quot;)&lt;br /&gt; public String home() {&lt;br /&gt;     System.out.println(&quot;HomeController: Passing through...&quot;);&lt;br /&gt;     return &quot;WEB-INF/views/home.jsp&quot;;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So, this is telling the controller what the view to return is. That&#39;s abundantly clear.&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;br /&gt;Let&#39;s walk through the key aspects of this class:&lt;br /&gt;The class has been annotated with the @Controller annotation, indicating that this is a Spring MVC Controller capable of handling web requests. Because @Controller is a specialization of Spring&#39;s @Component Stereotype annotation, the class will automatically be detected by the Spring container as part of the container&#39;s component scanning process, creating a bean definition and allowing instances to be dependency injected like any other Spring-managed component.&lt;br /&gt;&lt;br /&gt;// So, the @Controller annotation means it&#39;s going to be a spring-managed bean.&lt;br /&gt;&lt;br /&gt;The home method has been annotated with a @RequestMapping annotation, specifying that this method should handle web requests to the path &quot;/&quot;, i.e. the home path for the application.&lt;br /&gt;&lt;br /&gt;// I guess this means anything with &quot;/&quot; or after. In this case I think maybe&lt;br /&gt;// something like &quot;/baremvc&lt;br /&gt;&lt;br /&gt;The home method simply logs a message to system out, and then returns WEB-INF/views/home.jsp, indicating the view which should handle the response, in this case a JSP page. (If hardcoding the entire view path including WEB-INF prefix, and the fact that it&#39;s a JSP, seems wrong to you, you are right. We&#39;ll deal with this later)&lt;br /&gt;&lt;br /&gt;// Ok, that&#39;s maybe what I didn&#39;t change on the first try&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Now, we need to create the view. This JSP page will simply print a greeting.&lt;br /&gt;WEB-INF/views/home.jsp&lt;br /&gt;view sourceprint?&lt;br /&gt;&amp;lt;%@ taglib uri=&quot;http://java.sun.com/jsp/jstl/core&quot; prefix=&quot;c&quot; %&amp;gt;&lt;br /&gt;&amp;lt;%@ page session=&quot;false&quot; %&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;  &amp;lt;head&amp;gt;&lt;br /&gt;      &amp;lt;title&amp;gt;Home&amp;lt;/title&amp;gt;&lt;br /&gt;  &amp;lt;/head&amp;gt;&lt;br /&gt;  &amp;lt;body&amp;gt;&lt;br /&gt;      &amp;lt;h1&amp;gt;Hello world!&amp;lt;/h1&amp;gt;&lt;br /&gt;  &amp;lt;/body&amp;gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Ok. Next up:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Finally, as previously mentioned, we need to create a minimal Spring Application Context definition file.&lt;br /&gt;WEB-INF/spring/appServlet/servlet-context.xml&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;&lt;br /&gt;&amp;lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;&lt;br /&gt;   xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&lt;br /&gt;   xmlns:mvc=&quot;http://www.springframework.org/schema/mvc&quot;&lt;br /&gt;   xmlns:context=&quot;http://www.springframework.org/schema/context&quot;&lt;br /&gt;   xsi:schemaLocation=&quot;&lt;br /&gt;       http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd&lt;br /&gt;       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd&lt;br /&gt;       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd&quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;   &amp;lt;!-- DispatcherServlet Context: defines this servlet&#39;s request-processing infrastructure --&amp;gt;&lt;br /&gt;&lt;br /&gt;   &amp;lt;!-- Scans within the base package of the application for @Components to configure as beans --&amp;gt;&lt;br /&gt;   &amp;lt;!-- @Controller, @Service, @Configuration, etc. --&amp;gt;&lt;br /&gt;   &amp;lt;context:component-scan base-package=&quot;xyz.sample.baremvc&quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;   &amp;lt;!-- Enables the Spring MVC @Controller programming model --&amp;gt;&lt;br /&gt;   &amp;lt;mvc:annotation-driven /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/beans&amp;gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Let&#39;s examine the contents of this file:&lt;br /&gt;You&#39;ll note that a few different Spring XML namespaces are being used: context, mvc, and the default beans&lt;br /&gt;The &lt;context:component-scan&gt; declaration ensures the Spring container does component scanning, so that any code annotated with @Component subtypes such as @Controller is automatically discovered. You&#39;ll note that for efficiency, we limit (to xyz.sample.baremvc in this case) what part of the package space Spring should scan in the classpath&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The &lt;mvc:annotation-driven&gt; declaration sets up Spring MVC&#39;s support for routing requests to @Controllers, as well as how some things like conversion, formatting and validation are handled (with some sensible defaults based on what (libraries) is present in your classpath, and the ability to override if needed)&lt;/mvc:annotation-driven&gt;&lt;/context:component-scan&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ok, apparently annotation-driven means you can use controllers. Fair enough.&lt;br /&gt;&lt;br /&gt;The web app is now ready to run. Assuming the Servlet container (tc Server in my case) is set to listen on localhost:8080, starting the application and then hitting the URL http://localhost:8080/baremvc via our browser results in a display of the expected greeting:&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOG44h5hrnE27I23gEuBF3sWxpu9lO16Yj4D-GPoRCR993t-JQJPdROMQorvIHVICaofaN9R811HBgw3URBbJ0oYwqWaxoplxRVZmgpGOkgbC8K8W_IxdRRtc-66ATRKatrKLHOazvQOU/s1600/hello-world.png&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 200px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOG44h5hrnE27I23gEuBF3sWxpu9lO16Yj4D-GPoRCR993t-JQJPdROMQorvIHVICaofaN9R811HBgw3URBbJ0oYwqWaxoplxRVZmgpGOkgbC8K8W_IxdRRtc-66ATRKatrKLHOazvQOU/s320/hello-world.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5693480283240211138&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;As trivial as it is, running this application involves all the major pieces of a working Spring MVC application. Let&#39;s walk through the major sequences and component interactions:&lt;br /&gt;&lt;br /&gt;When the web app starts up, the DispatcherServlet is loaded and initialized because of the entry in web.xml.&lt;br /&gt;&lt;br /&gt;// right.&lt;br /&gt;&lt;br /&gt;The DispatcherServlet loads an annotation-based Application Context, which has been configured to scan for annotated components via a regular expression specifying the base package(s).&lt;br /&gt;&lt;br /&gt;// That would&#39;ve been the entry in the spring context file:&lt;br /&gt;&lt;br /&gt; &amp;lt;context:component-scan base-package=&quot;xyz.sample.baremvc&quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;Annotated components such as the HomeController are detected by the container.&lt;br /&gt;&lt;br /&gt;// because of the component-scan command.&lt;br /&gt;&lt;br /&gt;The HTTP request to http://localhost:8080/baremvc hits the servlet engine and is routed to our (baremvc) webapp.&lt;br /&gt;&lt;br /&gt;The servlet engine of the container. The servlet engine sees the &quot;baremvc&quot; and knows to route it to our web app. Question - which part of the web deployment identifies it as baremvc?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The implicit &quot;/&quot; path at the end of the URL matches the regex that has been registered for the DispatcherServlet, and the request is routed to it&lt;br /&gt;&lt;br /&gt;// That&#39;s what we saw in web.xml:&lt;br /&gt;&lt;br /&gt;   &amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;       &amp;lt;servlet-name&amp;gt;appServlet&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;br /&gt;&lt;br /&gt;&lt;br /&gt;The DispatcherServlet needs to decide what to do with the request. It uses a strategy called a HandlerAdapter to decide where to route the request. The specific HandlerAdapter type (or types, since they can be chained) to be used can be customized, but by default, an annotation-based strategy is used, which routes requests appropriately to specific methods in classes annotated as @Controller, based on matching criteria in @RequestMapping annotations found in those classes. In this case, the regex on the home method is matched, and it&#39;s called to handle the request.&lt;br /&gt;&lt;br /&gt;// So, the implicit &quot;/&quot; at the end of the url is mapped by:&lt;br /&gt;&lt;br /&gt;@Controller&lt;br /&gt;public class HomeController {&lt;br /&gt;&lt;br /&gt;   @RequestMapping(value = &quot;/&quot;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The home method does its work, in this case just printing something to system out. It then returns a string that&#39;s a hint (in this case, a very explicit one, WEB-INF/views/home.jsp) to help chose the View to render the response.&lt;br /&gt;The DispatcherServlet again relies on a strategy, called a ViewResolver to decide which View is responsible for rendering the response. This can be configured as needed for the application (in a simple or chained fashion), but by default, an InternalResourceViewResolver is used. This is a very simple view resolver that produces a JstlView which simply delegates to the Servlet engine&#39;s internal RequestDispatcher to render, and is thus suitable for use with JSP pages or HTML pages.&lt;br /&gt;The Servlet engine renders the response via the specified JSP&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Taking It to the Next Level&lt;br /&gt;At this point, we&#39;ve got an app which certainly qualifies as the world&#39;s simplest Spring MVC application, but frankly, doesn&#39;t really meet the spirit of that description. Let&#39;s evolve things to another level.&lt;br /&gt;As previously mentioned, it&#39;s not appropriate to hard-code a path to a view template into a controller, as our controller curretly does. A looser, more logical coupling between controllers and views, with controllers focused on executing some web or business logic, and generally agnostic to specific details like view paths or JSP vs. some other templating technology, is an example of separation of concerns. This allows much greater reuse of both controllers and views, and easier evolution of each in isolation from the other, with possibly different people working on each type of code.&lt;br /&gt;Essentially, the controller code ideally needs to be something like this variant, where a purely logical view name (whether simple or composite) is returned:&lt;br /&gt;&lt;br /&gt;//...&lt;br /&gt;@Controller&lt;br /&gt;public class HomeController {&lt;br /&gt;&lt;br /&gt;   @RequestMapping(value = &quot;/&quot;)&lt;br /&gt;   public String home() {&lt;br /&gt;       System.out.println(&quot;HomeController: Passing through...&quot;);&lt;br /&gt;       return &quot;home&quot;;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This is actually the default of the wizard that using the spring version I downloaded.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;Spring MVC&#39;s ViewResolver Strategy is actually the mechanism meant to be used to achieve this looser coupling between the controller and the view. As already mentioned, in the absence of the application configuring a specific ViewResolver, Spring MVC sets up a default minimally configured InternalResourceViewResolver, a very simple view resolver that produces a JstlView. &lt;br /&gt;&lt;br /&gt;There are potentially other view resolvers we could use, but to get a better level of decoupling, all we actually need to do is set up our own instance of InternalResourceViewResolver with slightly tweaked configuration. InternalResourceViewResolver employs a very simple strategy; it simply takes the view name returned by the controller, and prepends it with an optional prefix (empty by default), and appends it with an optional suffix (empty by default), then feeds that resultant path to a JstlView it creates. The JstlView then delegates to the Servlet engine&#39;s RequestDispatcher to do the real work, i.e. rendering the template. Therefore, to allow the controller to return logical view names like home instead of specific view template paths like WEB-INF/views/home.jsp, we simply need to configure this view resolver with the prefix WEB-INF/views and the suffix .jsp, so that it prepends and appends these, respectively, to the logical name returned by the controller.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;One easy way to configure the view resolver instance is to introduce the use of Spring&amp;#039;s Java-based container configuration, with the resolver as a bean definition:&lt;br /&gt;package xyz.sample.baremvc;&lt;br /&gt; &lt;br /&gt;import org.springframework.context.annotation.Bean;&lt;br /&gt;import org.springframework.context.annotation.Configuration;&lt;br /&gt;import org.springframework.web.servlet.ViewResolver;&lt;br /&gt;import org.springframework.web.servlet.view.InternalResourceViewResolver;&lt;br /&gt; &lt;br /&gt;@Configuration&lt;br /&gt;public class AppConfig {&lt;br /&gt; &lt;br /&gt;    // Resolve logical view names to .jsp resources in the /WEB-INF/views directory&lt;br /&gt;    @Bean&lt;br /&gt;    ViewResolver viewResolver() {&lt;br /&gt;        InternalResourceViewResolver resolver = new InternalResourceViewResolver();&lt;br /&gt;        resolver.setPrefix(&amp;quot;WEB-INF/views/&amp;quot;);&lt;br /&gt;        resolver.setSuffix(&amp;quot;.jsp&amp;quot;);&lt;br /&gt;        return resolver;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;I get it. He specified a scan in the spring context xml file for the package, the spring will find it and apply it to its configuration. The @Bean tells it to use this method to create a bean. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&amp;lt;!-- Resolve logical view names to .jsp resources in the /WEB-INF/views directory --&amp;gt;&lt;br /&gt;&amp;lt;bean class=&amp;quot;org.springframework.web.servlet.view.InternalResourceViewResolver&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;property name=&amp;quot;prefix&amp;quot; value=&amp;quot;/WEB-INF/views/&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;property name=&amp;quot;suffix&amp;quot; value=&amp;quot;.jsp&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;/bean&amp;gt;&lt;br /&gt;It&amp;#039;s hard to make a case for this object that one particular approach is much better than the other, so it&amp;#039;s really a matter of personal preference in this case (and we can actually see one of the strengths of Spring, its flexible nature).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Ok, this is a good cutoff point before getting into the next part. Btw, to fix the problem - just do a clean.</content><link rel='replies' type='application/atom+xml' href='http://gettingintomobile.blogspot.com/feeds/6206804127647101977/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gettingintomobile.blogspot.com/2012/01/spring-30-mvc-tutorial-detailed.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/6206804127647101977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/6206804127647101977'/><link rel='alternate' type='text/html' href='http://gettingintomobile.blogspot.com/2012/01/spring-30-mvc-tutorial-detailed.html' title='Spring 3.0 MVC tutorial  - a detailed breakdown - part 1.'/><author><name>Getting Into Mobile</name><uri>http://www.blogger.com/profile/10712519676082391096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0zMcEtE4_RSRjfew6qytGW8lDLraPrTfUWR1tp4Q_HUmT1DmaCwjh1nzqQx0NmlOWxldDhOFdcrrfjAs7QFAHjgcpSwpTDhMjmTq-HRofI8Yq_9VA_O1HRGKyua0EfcMF55cC0aXXzS0/s72-c/mvc.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5315596295108076178.post-9182998830055360644</id><published>2012-01-02T10:07:00.000-08:00</published><updated>2012-01-02T11:32:52.601-08:00</updated><title type='text'>Arggh! Code sign error - provisioning profile.</title><content type='html'>Ok, so, today I have to tackle something that cropped up today - a code sign error. I *hate* those. It just is something that is non-intuitive and un-fun. &lt;br /&gt;&lt;br /&gt;But, to go along with the new year, I&#39;m adopting a new approach. Slice it up into the tiniest slice of a task possible that will get me toward the solution.&lt;br /&gt;&lt;br /&gt;Task one: gather the facts. &lt;br /&gt;&lt;br /&gt;What is the problem? &lt;br /&gt;&lt;br /&gt;When I try to build my project for archive, I get this unkind error message: &lt;br /&gt;&lt;br /&gt;[BEROR]Code Sign error: Provisioning profile &#39;62740BD4-6754-4480-B983-0B85A8FC2D85&#39; can&#39;t be found&lt;br /&gt;&lt;br /&gt;What led to this? &lt;br /&gt;&lt;br /&gt;Well....I was getting an &quot;expiring profile&quot; warning on my project. There are two places in organizer where the profiles are listed. One is in a section called &quot;provisioning profiles&quot;. &lt;br /&gt;&lt;br /&gt;The other is under &quot;devices&quot;. &lt;br /&gt;&lt;br /&gt;The difference between them is that if you click on the one above, it will take you to the profiles actual location. The one below, which is apparently connected to the device, won&#39;t. It&#39;s just a label.&lt;br /&gt;&lt;br /&gt;The ones above are the following:&lt;br /&gt;&lt;br /&gt;App1 Application Distribution Profile&lt;br /&gt;App2  Development Profile&lt;br /&gt;App2x&lt;br /&gt;TeamProvisioningProfile&lt;br /&gt;&lt;br /&gt;The ones connected to my iPond (the provisioning profiles listed for the device) are:&lt;br /&gt;&lt;br /&gt;JLPT Vocabulary Quiz Development Profile&lt;br /&gt;JlptVocabQuiz&lt;br /&gt;TeamProvisioningProfile&lt;br /&gt;&lt;br /&gt;All of them have expiration dates will in the future. &lt;br /&gt;&lt;br /&gt;Now, the *original* problem was that I was getting a warning about an expiring profile. So, I deleted all the profiles which were already expired, or which had nothing to do with this project (I thought), and now I have this error message.&lt;br /&gt;&lt;br /&gt;So, my question at this point is - what happened to my friendly distribution profile? I&#39;m not very good about keeping track of where to put these things, all these generated profiles. So, maybe I should just generate another one and reattach it. But how to do that? &lt;br /&gt;&lt;br /&gt;So, the question I&#39;m dealing with now is - what&#39;s causing this error? It&#39;s looking for the provisioning profile, and not finding it, for some reason. I guess I must have deleted it? &lt;br /&gt;&lt;br /&gt;These profiles have names. But I&#39;d like to figure out what these names are. I&#39;d especially like to know the one I created. I think it&#39;s up on my developer account. Because there is this whole process to generate a certificate request - wait - that&#39;s a different thing. &lt;br /&gt;&lt;br /&gt;What is the definition of a provisioning profile? &lt;br /&gt;&lt;br /&gt;I think we want to get this:&lt;br /&gt;&lt;br /&gt;iOS Provisioning Portal&lt;br /&gt;&lt;br /&gt;Provision &amp; test your apps on your iPhone, iPad &amp; iPod touch.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Yup, it&#39;s the provisioning portal I&#39;m after. &lt;br /&gt;&lt;br /&gt;There&#39;s a section in there called &quot;provisioning&quot;. Inside that, there are lists of development and distribution profiles. Since the problem is happening when I build for archive, my suspicion is that it&#39;s the distribution profile. &lt;br /&gt;&lt;br /&gt;So, here&#39;s what I have for distribution profiles:&lt;br /&gt;&lt;br /&gt;JLPT Vocabulary Quiz App Profile  id string.com.blah.blah&lt;br /&gt;app id: JLPT Vocabulary Quiz App &lt;br /&gt;&lt;br /&gt;1 certificate &lt;br /&gt;1 device&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So, very clearly the first one is the distribution profile I use when I distribute the app - although I should have named it something with &quot;distribution&quot; in it. &lt;br /&gt;&lt;br /&gt;Now, actually, something to keep in mind is, is the error referring to this provisioning profile? Or is it referring to whatever certificate is being used to sign it?  Could this be a certificate issue? &lt;br /&gt;&lt;br /&gt;No - the problem is it can&#39;t find the provisioning profile. &lt;br /&gt;&lt;br /&gt;So, what is the solution? How do it give the provisioning profile? Or do I get rid of the reference in the project to the missing profile? &lt;br /&gt;&lt;br /&gt;There&#39;s actually a pretty good string of possible solutions here:&lt;br /&gt;&lt;br /&gt;http://stackoverflow.com/questions/1760518/codesign-error-provisioning-profile-cannot-be-found-after-deleting-expired-prof&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The main one seems to be to edit the project file and get rid of any references to any profiles. But my question is, how to attach the new file? &lt;br /&gt;&lt;br /&gt;Ok, when I get into Xcode4, and go into build settings, I can see (under &quot;Target&quot;, &quot;Code Signing&quot;) under &quot;release&quot;, with the confusing &quot;Don&#39;t Code Sign&quot; heading, it&#39;s listing &quot;iPhone Distribution&quot; which might be one of the ones I deleted, I dunno. &lt;br /&gt;&lt;br /&gt;Anyway, I need to figure how to connect my distribution certificate here. First, maybe I&#39;ll download it to make sure I&#39;m working with the right one. Then, I will need to figure out how to link it with the app. &lt;br /&gt;&lt;br /&gt;Ok, I&#39;m going to download it. The name is JLPT_Vocabulary_Quiz_App_Profile.mobileprovision. &lt;br /&gt;&lt;br /&gt;Ok, it just went to downloads. When I double-clicked it, it actually went straight into organizer, the available profiles. Now, let&#39;s see if I can specify it in the code signing section.&lt;br /&gt;&lt;br /&gt;Sweet! it worked. Nice, I expected to spend 5 or 6 hours on this, it&#39;s it&#39;s done in 2.5. We like.</content><link rel='replies' type='application/atom+xml' href='http://gettingintomobile.blogspot.com/feeds/9182998830055360644/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gettingintomobile.blogspot.com/2012/01/arggh-code-sign-error-provisioning.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/9182998830055360644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/9182998830055360644'/><link rel='alternate' type='text/html' href='http://gettingintomobile.blogspot.com/2012/01/arggh-code-sign-error-provisioning.html' title='Arggh! Code sign error - provisioning profile.'/><author><name>Getting Into Mobile</name><uri>http://www.blogger.com/profile/10712519676082391096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5315596295108076178.post-1212532488318664546</id><published>2011-12-30T10:27:00.000-08:00</published><updated>2011-12-30T11:13:56.099-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Spring"/><title type='text'>Hello World - Spring 3.0 STS</title><content type='html'>This is to lay out the very bare details needed to create a &quot;Hello Word&quot; application using Spring 3.0 STS. &lt;br /&gt;&lt;br /&gt;I actually had quite a bit of difficulty locating a tutorial on how to do it. Unfortunately, the flagship screencast at the site shows the source code for a project that exercises various aspects of - but doesn&#39;t show how to set up your own project. This leaves you struggling a bit for tutorials that tell you how to actually work the controls of this monster. &lt;br /&gt;&lt;br /&gt;Almost by accident, I stumbled across a couple of tutorials which were enough to get me started. The first one, which I&#39;ve unfortunately lost, basically showed how to run the server and what the default source code looked like. Unfortunately, it didn&#39;t work. But at least it got me started on the right track. &lt;br /&gt;&lt;br /&gt;A better tutorial was this: &lt;br /&gt;&lt;br /&gt;http://blog.springsource.org/2011/01/04/green-beans-getting-started-with-spring-mvc/&lt;br /&gt;&lt;br /&gt;I *almost* works out of the box - you just need to do a *little* bit of debugging. &lt;br /&gt;&lt;br /&gt;Anyway, without further ado, here are the steps to follow:&lt;br /&gt;&lt;br /&gt;1. From Eclipse STS, type file &gt; new Spring Template Project (then choose) SpringMVCProject&lt;br /&gt;&lt;br /&gt;2. If you follow the tutorial, you&#39;ll give the project a name like &quot;baremvc&quot; and a package name of &quot;xyz.sample.baremvc&quot;.&lt;br /&gt;&lt;br /&gt;NOTE: Watch out for caps on the project name - it appears to be the url name to call, and is case-sensitive. I need to test this. &lt;br /&gt;&lt;br /&gt;3. Because the blog is about a year old, there are slight variance in code he suggests and the code that is generated. In fact, you can leave the code as generated for home.jsp and HomeController.java. &lt;br /&gt;&lt;br /&gt;If you do use the code for &quot;HomeController&quot; as provided, make sure to make the return line &quot;return &quot;home&quot; and not &lt;br /&gt;&lt;br /&gt; return &quot;WEB-INF/views/home.jsp&quot;;&lt;br /&gt;&lt;br /&gt;4. Now, run it on the server. Right click on the project and select &quot;run on server&quot;. &lt;br /&gt;&lt;br /&gt;5. Enter http://localhost:8080/baremvc &lt;br /&gt;&lt;br /&gt;You *should* be ok.  One thing to watch out for is if you set up multiple project - I think only one of them can have a controller set up with a &quot;/&quot;. The rest of them must need something extra. I&#39;ll check that.</content><link rel='replies' type='application/atom+xml' href='http://gettingintomobile.blogspot.com/feeds/1212532488318664546/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gettingintomobile.blogspot.com/2011/12/hello-world-spring-30-sts.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/1212532488318664546'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/1212532488318664546'/><link rel='alternate' type='text/html' href='http://gettingintomobile.blogspot.com/2011/12/hello-world-spring-30-sts.html' title='Hello World - Spring 3.0 STS'/><author><name>Getting Into Mobile</name><uri>http://www.blogger.com/profile/10712519676082391096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5315596295108076178.post-1248314667682131245</id><published>2011-12-29T13:09:00.002-08:00</published><updated>2011-12-30T11:44:40.789-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Spring; Container pattern"/><title type='text'>Spring - the Container pattern</title><content type='html'>I&#39;ve started reading &quot;Spring Recipes&quot; by Gary Mak. It covers up to 2.5, and we&#39;re up to 3. But I&#39;ve read up to chapter 5 and I still think it&#39;s worth reading, because it conceptually explains the concept of spring, as well as providing a great overview of its functionality and lots of working code.&lt;br /&gt;&lt;br /&gt;The very first pattern the book discusses is the &quot;Container&quot; pattern. Essentially, instead of instantiating a concrete class into an interface, which introduces a dependency on the concrete class and kinds of defeats the purpose of the interfaces, you instead create a Container which instantiates the concrete class and makes it available via a &quot;get&quot; method which specifies an id. &lt;br /&gt;&lt;br /&gt;In the example shown, a &quot;report generator&quot; class is separated into two classes - a report generator class and a report service class. The report service class gets the report generator class from the container&#39;s &quot;getComponent&quot; method, specifying &quot;reportGenerator&quot; as the id. Then, when it needs to generate an annual report, monthly report etc., it just makes a call on the report generator object. &lt;br /&gt;&lt;br /&gt;The upshot of all this is that the the Report Service doesn&#39;t have a dependency on the specific Report Generator (unlike before, when they were combined).  &lt;br /&gt;&lt;br /&gt;Since the container class also instantiates the Report Service and stores it in the same object map as the report generator, it can be accessed in a main method. The main method instantiates the container, gets the report service from the container, and then calls the appropriate generate method on it. &lt;br /&gt;&lt;br /&gt;You could argue that you&#39;ve made the system more complex by introducing the container, and just kicked the dependency can down the road to the container class. On the other hand, you&#39;ve separated the dependency-type code (which type of report) from the reporting service code. Perhaps the real gain is that it represents a way to separate distinct functionality into separate classes,  in a way that keeps a class that uses an interface from also referring to the concrete class. That&#39;s got to be a win.</content><link rel='replies' type='application/atom+xml' href='http://gettingintomobile.blogspot.com/feeds/1248314667682131245/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gettingintomobile.blogspot.com/2011/12/spring-container-pattern.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/1248314667682131245'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/1248314667682131245'/><link rel='alternate' type='text/html' href='http://gettingintomobile.blogspot.com/2011/12/spring-container-pattern.html' title='Spring - the Container pattern'/><author><name>Getting Into Mobile</name><uri>http://www.blogger.com/profile/10712519676082391096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5315596295108076178.post-5417054654144286695</id><published>2011-12-27T12:58:00.000-08:00</published><updated>2011-12-27T18:18:32.492-08:00</updated><title type='text'>A sprinkling of Spring</title><content type='html'>Although this blog is about mobile development, I also would like to learn a bit about Spring technologies. This is mostly because pretty much any non-Android Java job out there has some element of Spring or Spring concepts in it. So, basically it&#39;s just good to know.&lt;br /&gt;&lt;br /&gt;The goal therefore of this post is to get a simple hello world up and running in Spring.  I&#39;ve downloaded the IDE about 7 times. But, now I&#39;m determined to get the hello world done. &lt;br /&gt;&lt;br /&gt;At this url: http://www.springsource.com/developer/sts&lt;br /&gt;&lt;br /&gt;we find the link for download the SpringSource Tool Suite. Note you can skip filling in the form on the right if you click on the link that says &quot;I&#39;d rather not fill in the form&quot;. &lt;br /&gt;&lt;br /&gt;On that download page - http://www.springsource.com/downloads/sts - we find that there the current Version is &quot;2.8.1.RELEASE&quot;, it&#39;s eclipse 3.7.1 and there&#39;s a dmg (mac install file) listed right at the top. 385 MB. &lt;br /&gt;&lt;br /&gt; springsource-tool-suite-2.8.1.RELEASE-e3.7.1-macosx-carbon-installer.dmg&lt;br /&gt;&lt;br /&gt;Ok, this will take a few minutes. I&#39;m at Panera, but it&#39;s 4:21 in the afternoon, so, no one&#39;s really around. While that&#39;s going on, let&#39;s look up how to do a hello world somewhere on the net. &lt;br /&gt;&lt;br /&gt;Actually, if I click on the &quot;Spring Framework&quot; link from the main page, it looks like there&#39;s some promising links in there. &quot;Get Started&quot; has links for get sts (I&#39;m doing that), tutorials, code samples, doc, forums. Let&#39;s go to tutorials. &lt;br /&gt;&lt;br /&gt;Ok, how about this screencast:&lt;br /&gt;&lt;br /&gt;http://www.youtube.com/watch?v=kSITVsOUvLU&lt;br /&gt;&lt;br /&gt;It&#39;s a 15 minute webinar. &lt;br /&gt;&lt;br /&gt;Ok, I&#39;ve just finished watching part 1. It&#39;s a nice overview of core spring, what it is conceptually. Let&#39;s move on to part 2. &lt;br /&gt;&lt;br /&gt;It&#39;s asking me to install Spring now. I&#39;m just double-clicking the .dmg, and then the install app. It installs into /Users/myname/springsource, and springsource has 4 directories.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;apache-maven-3.0.3&lt;br /&gt;spring-roo-1.1.5.RELEASE&lt;br /&gt;sts-2.8.1.RELEASE&lt;br /&gt;vfabric-tc-server-developer-2.6.1.RELEASE&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When you start sts, it creates this workspace:&lt;br /&gt;&lt;br /&gt;/Users/myname/Documents/workspace-sts&lt;br /&gt;&lt;br /&gt;Ok, now the IDE is up. I moved all the tabs to the left side, which is much nicer. There&#39;s a dashboard display with a lot of neat looking links, including tutorials, as well. There&#39;s an image below.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgJYuumeizIQL_Poii6oHElz8QQHIc2FUdsGCyRRKkimKXs6vOZ-BJStmNwgv91-sKDer911p5MbER3UFk897O1C1OBvSopUs6nymi2X6cBB4rp0nTIxYaSrr58ST3I3IGzYs9c4IFGgI/s1600/Screen+shot+2011-12-27+at+7.38.04+PM.png&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 218px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgJYuumeizIQL_Poii6oHElz8QQHIc2FUdsGCyRRKkimKXs6vOZ-BJStmNwgv91-sKDer911p5MbER3UFk897O1C1OBvSopUs6nymi2X6cBB4rp0nTIxYaSrr58ST3I3IGzYs9c4IFGgI/s320/Screen+shot+2011-12-27+at+7.38.04+PM.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5690975533448117970&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ok, he says just do file, new, spring template project. Then choose &quot;simple spring utility project&quot; or &quot;spring mvc project&quot; - unfortunately, he doesn&#39;t tell you which one right away because he&#39;s already created his projects. Let&#39;s go with the utility for now. It&#39;s kind of an overview...&lt;br /&gt;&lt;br /&gt;Actually, he kind of breezes over the code. it&#39;s more of a showing what you can do than a &quot;do this&quot; kind of presentation. And there are actually 5 videos altogether. I feel like I know a bit more, but I&#39;d really like to get that hello world going. We&#39;ll tackle that in the next post.</content><link rel='replies' type='application/atom+xml' href='http://gettingintomobile.blogspot.com/feeds/5417054654144286695/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gettingintomobile.blogspot.com/2011/12/sprinkling-of-spring.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/5417054654144286695'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/5417054654144286695'/><link rel='alternate' type='text/html' href='http://gettingintomobile.blogspot.com/2011/12/sprinkling-of-spring.html' title='A sprinkling of Spring'/><author><name>Getting Into Mobile</name><uri>http://www.blogger.com/profile/10712519676082391096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgJYuumeizIQL_Poii6oHElz8QQHIc2FUdsGCyRRKkimKXs6vOZ-BJStmNwgv91-sKDer911p5MbER3UFk897O1C1OBvSopUs6nymi2X6cBB4rp0nTIxYaSrr58ST3I3IGzYs9c4IFGgI/s72-c/Screen+shot+2011-12-27+at+7.38.04+PM.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5315596295108076178.post-2676297077663308458</id><published>2011-12-15T15:18:00.000-08:00</published><updated>2011-12-15T16:50:25.023-08:00</updated><title type='text'>Getting files from the iPhone/iTouch to the Mac</title><content type='html'>As I&#39;m implementing a new feature in my app which updates the database, I&#39;ve come to realize that I&#39;ll be needing to copy the database to my mac for checking purposes. I&#39;m going to follow a post in Stack Overflow that purports to do this. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;http://stackoverflow.com/questions/3456613/how-to-copy-log-file-from-iphone-to-desktop-pc&lt;br /&gt;&lt;br /&gt;If you write out your logs to a file inside the App&#39;s Documents directory, and you have access to the device, then you can download the Application Data directory. I&#39;ve done this before to copy off the logs and SQLite database from our application. You can follow the instructions here:&lt;br /&gt;&lt;br /&gt;Managing Application Data&lt;br /&gt;&lt;br /&gt;To make a copy of your application’s device–based file system to your Mac:&lt;br /&gt;&lt;br /&gt;In Xcode, choose Window &gt; Organizer.&lt;br /&gt;&lt;br /&gt;// done&lt;br /&gt;&lt;br /&gt;In the Organizer, select your device in the Devices list.&lt;br /&gt;&lt;br /&gt;// note - click on the devices icon on the top of the display&lt;br /&gt;// done&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In the Summary pane, click the disclosure triangle next to your application.&lt;br /&gt;Click the download button (the down-pointing arrow to the left of the Application Data package), as shown in (the figure below:) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg04qaTxit7BASoGe5gvV-5xViGRai9HE6J1ggpwrIirJDtPMPcEggIjl1lZ7lrOSkb-rhyphenhyphenqO71S6mGfrofMggW8PhH103TGMGuMB_igeiD6CWa79ZvxsoNE1ePVbA1U5aeHbZK6lmJqpI/s1600/stackoverflow-screenshot-of-organizer+%25281%2529.png&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 37px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg04qaTxit7BASoGe5gvV-5xViGRai9HE6J1ggpwrIirJDtPMPcEggIjl1lZ7lrOSkb-rhyphenhyphenqO71S6mGfrofMggW8PhH103TGMGuMB_igeiD6CWa79ZvxsoNE1ePVbA1U5aeHbZK6lmJqpI/s320/stackoverflow-screenshot-of-organizer+%25281%2529.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5686500280869197874&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;// Note - you need to choose &quot;applications&quot; on the left side in order to &lt;br /&gt;// get the list of applications. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In the dialog that appears, choose a location for the file-system copy.&lt;br /&gt;Note: I&#39;m not sure it show the triangle you need to click on, so I&#39;ve included my own screenshot of it. &lt;br /&gt;&lt;br /&gt;// Actually, in XCode 4 it&#39;s apparently a bit different. Look for the download &lt;br /&gt;// arrow at the bottom of the display:&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCDPGqZRfLPE6XUfgmbJuk3I6780n-Zoqlhng_h5872OPDz4AJQXldPU2-0tqMwD13AWN8RWuZ95aDJhh7a6yjNAwJU4qhowyZi4hs0tAjdyKhLr-JWRsSo4wtUC6WLr4mhYuWduHOzDQ/s1600/Screen+shot+2011-12-15+at+6.32.06+PM.png&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 36px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCDPGqZRfLPE6XUfgmbJuk3I6780n-Zoqlhng_h5872OPDz4AJQXldPU2-0tqMwD13AWN8RWuZ95aDJhh7a6yjNAwJU4qhowyZi4hs0tAjdyKhLr-JWRsSo4wtUC6WLr4mhYuWduHOzDQ/s320/Screen+shot+2011-12-15+at+6.32.06+PM.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5686502262419944434&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Download the file to a convenient directory. Note the file downloaded is an &quot;xcappdata&quot; file. Right click on select &quot;Show Package Contents&quot; on it. This gives you access to the files. &lt;br /&gt;&lt;br /&gt;Note that if you&#39;re dealing with a database, then it may or may not be in there, depending on if you left it in the resources directory (non-updatable) or copied it into  user documents. See http://tinyurl.com/cks54ay for info on how to do that.</content><link rel='replies' type='application/atom+xml' href='http://gettingintomobile.blogspot.com/feeds/2676297077663308458/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gettingintomobile.blogspot.com/2011/12/getting-files-from-iphoneitouch-to-mac.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/2676297077663308458'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/2676297077663308458'/><link rel='alternate' type='text/html' href='http://gettingintomobile.blogspot.com/2011/12/getting-files-from-iphoneitouch-to-mac.html' title='Getting files from the iPhone/iTouch to the Mac'/><author><name>Getting Into Mobile</name><uri>http://www.blogger.com/profile/10712519676082391096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg04qaTxit7BASoGe5gvV-5xViGRai9HE6J1ggpwrIirJDtPMPcEggIjl1lZ7lrOSkb-rhyphenhyphenqO71S6mGfrofMggW8PhH103TGMGuMB_igeiD6CWa79ZvxsoNE1ePVbA1U5aeHbZK6lmJqpI/s72-c/stackoverflow-screenshot-of-organizer+%25281%2529.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5315596295108076178.post-8875243437277450404</id><published>2011-12-14T12:53:00.001-08:00</published><updated>2011-12-14T13:28:08.887-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="objective c; constants;"/><title type='text'>Simple constants in Objective C</title><content type='html'>At this point, we just want to implement a bit of date manipulation logic. &lt;br /&gt;&lt;br /&gt;If the user had less than 5 seconds remaining before returning the question, then we want to use a shorter amount of days - call it &quot;SLOW_RESPONSE_INTERVAL_DAYS&quot;. Otherwise, we&#39;ll use &quot;FAST_RESPONSE_INTERVAL_DAYS;&lt;br /&gt;&lt;br /&gt;In the Android, it looks like this:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; static final int SLOW_RESPONSE_INTERVAL_DAYS = 3;&lt;br /&gt; static final int FAST_RESPONSE_INTERVAL_DAYS = 5;&lt;br /&gt;&lt;br /&gt;In iOS, pretty much is seems like defines are used...&lt;br /&gt;&lt;br /&gt; #define SLOW_RESPONSE_INTERVAL_DAYS 3&lt;br /&gt; #define FAST_RESPONSE_INTERVAL_DAYS 5&lt;br /&gt;&lt;br /&gt;We&#39;ll keep it inside the class where we&#39;re processing the spaced repetition logic, so that ought to be sufficient for our needs.</content><link rel='replies' type='application/atom+xml' href='http://gettingintomobile.blogspot.com/feeds/8875243437277450404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gettingintomobile.blogspot.com/2011/12/simple-constants-in-objective-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/8875243437277450404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/8875243437277450404'/><link rel='alternate' type='text/html' href='http://gettingintomobile.blogspot.com/2011/12/simple-constants-in-objective-c.html' title='Simple constants in Objective C'/><author><name>Getting Into Mobile</name><uri>http://www.blogger.com/profile/10712519676082391096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5315596295108076178.post-4215227232753031392</id><published>2011-12-14T12:04:00.000-08:00</published><updated>2011-12-14T12:50:43.760-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS; NSDate; increment"/><title type='text'>iOS - incrementing a date value from a string input</title><content type='html'>One of the enhancements I&#39;m making my iOS app is to add scheduling for a review of particular words. This review date is actually based on the amount of time it takes to answer a given question - the longer it takes, the quicker the review should be scheduled. Another consideration is the internal format in which dates are held by SQLLite, which is a string in yyyy-MM-dd format. This is helpful because now the input and output of the problem solution is limited to string manipulation. &lt;br /&gt;&lt;br /&gt;So the input to our method is effectively the number of seconds it took to answer the question. We&#39;ll add the input date for flexibility - we could assumed it&#39;s today, but this is a trade-off for re-usability.  &lt;br /&gt;&lt;br /&gt;So, the first thing we need to do is take the string input date and convert it to an iOS date. &lt;br /&gt;&lt;br /&gt;The key is the NSDateFormatter object, which has both the &quot;stringFromDate&quot; and the &quot;dateFromString&quot; methods. So, looking at an example from http://iphonedevelopertips.com/cocoa/date-formatters-examples-take-3.html, we adapt it a bit. &lt;br /&gt;&lt;br /&gt;Example: &lt;br /&gt;&lt;br /&gt;NSString *dateStr = @&quot;20081122&quot;;&lt;br /&gt; &lt;br /&gt;// Convert string to date object&lt;br /&gt;NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];&lt;br /&gt;[dateFormat setDateFormat:@&quot;yyyyMMdd&quot;];&lt;br /&gt;NSDate *date = [dateFormat dateFromString:dateStr];  &lt;br /&gt; &lt;br /&gt;// Convert date object to desired output format&lt;br /&gt;[dateFormat setDateFormat:@&quot;EEEE MMMM d, YYYY&quot;];&lt;br /&gt;dateStr = [dateFormat stringFromDate:date];  &lt;br /&gt;[dateFormat release];&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We want to turn this into a method in our Utils class, which will also take the number of days:&lt;br /&gt;&lt;br /&gt;+ (NSString *) addDaysToDate:(NSString *) inDate daysToAdd: (int) daysToAdd;&lt;br /&gt;&lt;br /&gt;So, the first thing to do is take the code above and adapt it to convert the &quot;yyyy-MM-dd&quot; input string to a date. &lt;br /&gt;&lt;br /&gt;// Convert string to date object&lt;br /&gt;NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];&lt;br /&gt;[dateFormat setDateFormat:@&quot;yyyy-MM-dd&quot;];&lt;br /&gt;NSDate *date = [dateFormat dateFromString:inDate];  &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Well tackle adding days to the date in a moment. For now, assume we&#39;ve done that and just want to convert it back to the same format it came in as:&lt;br /&gt;&lt;br /&gt;// Convert date object to desired output format&lt;br /&gt;// The date format is already the way we want it &lt;br /&gt;&lt;br /&gt;NSString *dateStr = [dateFormat stringFromDate:newDate];  &lt;br /&gt;[dateFormat release];&lt;br /&gt;return dateStr; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The only remaining question is how to increment an instance of NSDate in iOS. Reviewing the docs, it looks like this might be the one that we&#39;re looking for:&lt;br /&gt;&lt;br /&gt;dateByAddingTimeInterval:&lt;br /&gt;&lt;br /&gt;Returns a new NSDate object that is set to a given number of seconds relative to the receiver.&lt;br /&gt;- (id)dateByAddingTimeInterval:(NSTimeInterval)seconds&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;However, it&#39;s always worth a google check to make sure that&#39;s right. As it turns out, it isn&#39;t. It doesn&#39;t handle daylight savings time, for one thing. According to StackOverflow, the correct solution is this:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;+ (NSDate *)getForDays:(int)days fromDate:(NSDate *)date&lt;br /&gt;{&lt;br /&gt;    NSDateComponents *components= [[NSDateComponents alloc] init];&lt;br /&gt;    [components setDay:days];&lt;br /&gt;&lt;br /&gt;    NSCalendar *calendar = [NSCalendar currentCalendar];&lt;br /&gt;    return [calendar dateByAddingComponents:components toDate:date options:0];&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So, once we add this to our Utils class, the call should look like something like this:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    NSDate *newDate = [Utils getForDays: daysToAdd fromDate: date];&lt;br /&gt;&lt;br /&gt;Here&#39;s the final (hopefully) product:&lt;br /&gt;&lt;br /&gt;+ (NSString *) addDaysToDate:(NSString *) inDate daysToAdd: (int) daysToAdd &lt;br /&gt;{&lt;br /&gt;    &lt;br /&gt;    // Convert string to date object&lt;br /&gt;    NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];&lt;br /&gt;    [dateFormat setDateFormat:@&quot;yyyy-MM-dd&quot;];&lt;br /&gt;    NSDate *date = [dateFormat dateFromString:inDate];  &lt;br /&gt;        &lt;br /&gt;&lt;br /&gt;    NSDate *newDate = [Utils getForDays: daysToAdd fromDate: date];&lt;br /&gt;    &lt;br /&gt;    // Convert date object to desired output format&lt;br /&gt;    // The date format is already the way we want it &lt;br /&gt;    &lt;br /&gt;    NSString *dateStr = [dateFormat stringFromDate:newDate];  &lt;br /&gt;    [dateFormat release];&lt;br /&gt;    return dateStr;    &lt;br /&gt;}</content><link rel='replies' type='application/atom+xml' href='http://gettingintomobile.blogspot.com/feeds/4215227232753031392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gettingintomobile.blogspot.com/2011/12/ios-incrementing-date-value-from-string.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/4215227232753031392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/4215227232753031392'/><link rel='alternate' type='text/html' href='http://gettingintomobile.blogspot.com/2011/12/ios-incrementing-date-value-from-string.html' title='iOS - incrementing a date value from a string input'/><author><name>Getting Into Mobile</name><uri>http://www.blogger.com/profile/10712519676082391096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5315596295108076178.post-4597999138345802845</id><published>2011-12-08T10:04:00.000-08:00</published><updated>2011-12-09T06:12:31.991-08:00</updated><title type='text'>Android - regaining root access</title><content type='html'>Loyal readers of my blog, followed by millions (Joe Millions), may recall that I went to some lengths a few months ago to gain root access to my Android device - something that ought to be there by default, btw, since I paid a princely sum for the fun. &lt;br /&gt;&lt;br /&gt;Now, it turns out that I&#39;ve somehow lost root again. Arggh! The gods be cursed! &lt;br /&gt;&lt;br /&gt;So, why did this happen? More importantly, how to get it back again? Let&#39;s see if we can reconstruct events from my previous posts. &lt;br /&gt;&lt;br /&gt;Ah, good - in this blog post, I actually *summarized* what I did:&lt;br /&gt;&lt;br /&gt;http://gettingintomobile.blogspot.com/2011/07/nexus-one-rooted-at-last.html&lt;br /&gt;&lt;br /&gt;Long story short, it looks like I got through the tough part - unlocking the phone (had to be done from a Windows system), and now all I have to do is follow the instructions from this url:&lt;br /&gt;&lt;br /&gt;http://chensun.net/android-development/root-nexus-one-with-android-2-3-3-gingerbread/8/&lt;br /&gt;&lt;br /&gt;Ok, somebody noticed why they/I lost root:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Today the OTA Update to Android version 2.3.6 (Build GRK39F) was pushed to my Nexus One. And as i expected (from my experience of previous system updates), also with this android update you will loose your root access.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Ok, when I go to chensun.net, it confirms I can get root on 2.3.6:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Root Nexus One with Android 2.3.3 Gingerbread&lt;br /&gt;Posted on March 26, 2011 by Chen&lt;br /&gt;&lt;br /&gt;Update: September 24, 2011.&lt;br /&gt;Also works for Android 2.3.6 on Nexus One! &lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;There still might be a problem - I&quot;m thinking the fastboot could have been a problem&lt;br /&gt;&lt;br /&gt;Hmm...it looks like the fastboot needs to be flashed from XP, and not a virtual version either. It&#39;ll have to wait till I get home and can use my wife&#39;s pc.&lt;br /&gt;&lt;br /&gt;Ok - I&#39;m home. Once I got into her pc, it was very simple. In fact, it was just a question of following the tutorial steps, replicated below for you viewing:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;1. Download su.zip, and put it on your phone’s SD card.&lt;br /&gt;&lt;br /&gt;2. Download fastboot.zip, unzip it to C:\. Now you have a folder C:\fastboot\&lt;br /&gt;&lt;br /&gt;3. Download recovery-RA-passion-v2.2.1.img, put it in C:\fastboot\&lt;br /&gt;&lt;br /&gt;4. Shut down your phone. Then start your Nexus One in Fastboot mode by holding down the Trackball and press the Power button.&lt;br /&gt;&lt;br /&gt;5. Connect your phone to your computer. Open a Command Prompt (Start -&gt; All Programs -&gt; Accessories -&gt; Command Prompt), and run the following commands:&lt;br /&gt;&lt;br /&gt;cd C:\fastboot&lt;br /&gt;fastboot devices&lt;br /&gt;fastboot flash recovery recovery-RA-passion-v2.2.1.img&lt;br /&gt;&lt;br /&gt;6. Use Volume +/- keys to choose ‘Bootloader’ and hit the Power button.&lt;br /&gt;&lt;br /&gt;7. Use Volume +/- keys to select ‘Recovery’ and hit the Power button.&lt;br /&gt;&lt;br /&gt;8. From the menu, scroll the Trackball to select ‘Flash zip from sdcard’ and hit the Trackball.&lt;br /&gt;&lt;br /&gt;9. Select the su.zip file you previously copied to your SD card and hit the Trackball. Hit it one more time.&lt;br /&gt;&lt;br /&gt;10. When done, restart your Nexus One and you should be all set.&lt;br /&gt;&lt;br /&gt;There you go. Enjoy your rooted Nexus One :) &lt;br /&gt;&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://gettingintomobile.blogspot.com/feeds/4597999138345802845/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gettingintomobile.blogspot.com/2011/12/android-regaining-root-access.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/4597999138345802845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/4597999138345802845'/><link rel='alternate' type='text/html' href='http://gettingintomobile.blogspot.com/2011/12/android-regaining-root-access.html' title='Android - regaining root access'/><author><name>Getting Into Mobile</name><uri>http://www.blogger.com/profile/10712519676082391096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5315596295108076178.post-3365679405880663956</id><published>2011-12-05T11:05:00.000-08:00</published><updated>2011-12-05T13:00:32.080-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS;in app purchase; testing;"/><title type='text'>Backdoor for testing the purchased app on your iPhone</title><content type='html'>I ran into a bit of an inconvenience when using my recently released application on my iPod Touch. It&#39;s a Japanese vocabulary quiz, and it&#39;s limited to the first 100 words until you make an in-app purchase.  The problem is, I don&#39;t want to purchase my app, because I also want to be able test it as the free download as well. It might seem like a small thing, but I would prefer to work in the sort of &quot;default&#39; setting for my app, generally speaking. It&#39;s the first version people will see.&lt;br /&gt;&lt;br /&gt;The problem was that, after I had submitted my app, I ran into the in-app-purchase limitation on my own device. To get around this, I commented out the check for purchase code in my app. Then I got busy with life and completely forgot about it. So, when I went to make an enhancement to the app, I was happily coding away when I quite accidentally got into the same section of code which checks for the purchase. I was completely taken aback when I saw the code completely skipping the check for the app purchase.  Would Apple have caught the problem had I submitted it? I doubt it - they wouldn&#39;t go up to 100. Once released, there would be no reason to purchase the app - I would have been giving out the whole thing for free. With a 1% fill rate for the iAd advertising, I&#39;m not going to be making money on ads, that&#39;s for sure. Who knows when I would have finally realized I was giving it away? Note to self - don&#39;t *do* stuff like that.&lt;br /&gt;&lt;br /&gt;So, as soon as I got over my shock, I immediately set about fixing up the problem. The solution clearly lends itself to some type of checking of the unique id of the device. Surprisingly, this turned out to be very easy to code - just one line, and no permissions required. It can be retrieved and logged as follows: &lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;br /&gt;   NSString * uniqueId = [[UIDevice currentDevice] uniqueIdentifier];&lt;br /&gt;    &lt;br /&gt;    NSLog(@&quot;uniqueIdentifier: %@&quot;, uniqueId); &lt;br /&gt; &lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;There is one important caveat - this method has been deprecated in iOS 5. However, until some future date, it&#39;s going to be my solution. Once that method is gone, my app won&#39;t compile - there&#39;s no danger of giving it away for free. &lt;br /&gt;&lt;br /&gt;This method works on the simulators too. It turns out that they all have the same id (amongst themselves, not the iPod Touch). With that information in hand, I quickly created this code:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;+ (BOOL) isFreeVersion {&lt;br /&gt;&lt;br /&gt;    NSString *productIdentifer = @&quot;com.mycompany.myapp.myinapppurchase&quot;;&lt;br /&gt;    &lt;br /&gt;    if &lt;br /&gt;    (&lt;br /&gt;        ([uniqueId isEqualToString:@&quot;xxxyyyzzz&quot;]) ||  // my device&#39;s id        &lt;br /&gt;        ([uniqueId isEqualToString:@&quot;zzzyyyxxx&quot;])     // my simulator&#39;s id &lt;br /&gt;    )&lt;br /&gt;    &lt;br /&gt;    {&lt;br /&gt;        return NO; // it&#39;s been purchased&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    BOOL productPurchased = [[NSUserDefaults standardUserDefaults] boolForKey:productIdentifer];&lt;br /&gt;    &lt;br /&gt;    return !productPurchased; &lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Nice and quick. Let&#39;s hope Apple doesn&#39;t get around to deprecating this one for a while.</content><link rel='replies' type='application/atom+xml' href='http://gettingintomobile.blogspot.com/feeds/3365679405880663956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gettingintomobile.blogspot.com/2011/12/backdoor-for-testing-purchased-app-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/3365679405880663956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/3365679405880663956'/><link rel='alternate' type='text/html' href='http://gettingintomobile.blogspot.com/2011/12/backdoor-for-testing-purchased-app-on.html' title='Backdoor for testing the purchased app on your iPhone'/><author><name>Getting Into Mobile</name><uri>http://www.blogger.com/profile/10712519676082391096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5315596295108076178.post-4385507753535577165</id><published>2011-11-30T09:53:00.000-08:00</published><updated>2011-11-30T17:04:08.885-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="jquery mobile; phone gap"/><title type='text'>Getting Phone Gap to work with JQuery Mobile</title><content type='html'>This is just a quick summary of how to get a simple kind of Hello World app that uses both PhoneGap and JQuery Mobile up and running. Note that I&#39;m going to be doing this on a Mac, using Xcode4. You should be able to do this using, for example, Eclipse on a PC, but the details will vary slightly. &lt;br /&gt;&lt;br /&gt;The first thing to do is go ahead and download the latest version of PhoneGap from their site, and install it.  Once you do that, you can follow the instructions at the Phone Gap site on how to run their hello world app (http://phonegap.com/start).  &lt;br /&gt;&lt;br /&gt;To paraphrase, you basically, open XCode, and there&#39;s a Phone Gap project icon available. You can go ahead and create a new project. (Important - don&#39;t turn on arc for starters, that messes something up, I think it was something to to with jQuery Mobile)&lt;br /&gt;&lt;br /&gt;Once that&#39;s done, *run the project*. This creates a www folder in the project folder you just created. &lt;br /&gt;&lt;br /&gt;Copy the www folder from finder, without copy and as as a reference into the project folder.  &lt;br /&gt;&lt;br /&gt;When you run the project again, you might have an issue with the default device being incorrect. Change it to the one you usually use by selecting it on the scheme in the upper left. In my case, with Xcode 4.2, it&#39;s usually iPhone 4.2&lt;br /&gt;&lt;br /&gt;The successful result looks like this:&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0cTlJ4ibXvAKFtZw1LgeJli5kvBGnpbC_Z78Dtfdvw9olW8FAQ4Uy04AujvbpPIf95KqPTyM23XrP8jAO7gbv1r-qUzl87-OKTFY2B5WCkj-pjFk-1_WttqyPCqFLF6u-T0xLz7NUE-0/s1600/Screen+shot+2011-11-30+at+1.32.24+PM.png&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 164px; height: 320px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0cTlJ4ibXvAKFtZw1LgeJli5kvBGnpbC_Z78Dtfdvw9olW8FAQ4Uy04AujvbpPIf95KqPTyM23XrP8jAO7gbv1r-qUzl87-OKTFY2B5WCkj-pjFk-1_WttqyPCqFLF6u-T0xLz7NUE-0/s320/Screen+shot+2011-11-30+at+1.32.24+PM.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5680859217186087618&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Ok, that&#39;s phone gap. But we wanted to see a combination of jQueryMobile and Phone Gap. That&#39;s where this blog post comes in:&lt;br /&gt;&lt;br /&gt;http://wiki.phonegap.com/w/page/36868306/UI%20Development%20using%20jQueryMobile&lt;br /&gt;&lt;br /&gt;You can read up on it, then download the demo source from here:&lt;br /&gt;&lt;br /&gt;http://wiki.phonegap.com/w/page/36868306/UI%20Development%20using%20jQueryMobile#DownloadDemoSource&lt;br /&gt;&lt;br /&gt;Once you have downloaded and unzipped that app - *don&#39;t try opening the project*. It contains assumptions about the locations of javascript files that keep it from completing. &lt;br /&gt;&lt;br /&gt;Instead, delete the &quot;www&quot; folder including files from your previously created PhoneGap project. Then copy the &quot;www&quot; file from the jQuery downloaded folder into your project from finder. I think it&#39;s better to copy and reference additional folders. &lt;br /&gt;&lt;br /&gt;Then, run the app. You should see something like this:&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhI_iMl6-CR_VyJAuuY15ANWSVirf0gvoWF78qM4mMKhgPVdQcnXJKXwujCAMKaiE6ibLlme8Swi6M_2KJlDEVwfBkvmnG2OT7Xx8D6Tkm4-BUY7REYvNDxyc8jGzZ7xCBD1ZxNKlRdDzQ/s1600/Screen+shot+2011-11-30+at+1.52.57+PM.png&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 164px; height: 320px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhI_iMl6-CR_VyJAuuY15ANWSVirf0gvoWF78qM4mMKhgPVdQcnXJKXwujCAMKaiE6ibLlme8Swi6M_2KJlDEVwfBkvmnG2OT7Xx8D6Tkm4-BUY7REYvNDxyc8jGzZ7xCBD1ZxNKlRdDzQ/s320/Screen+shot+2011-11-30+at+1.52.57+PM.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5680863990447441634&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;But - there are a couple of &quot;gotchas&quot;. It turns out that a security feature has been added to Phone Gap which requires that you provide a list of urls your app will be accessing in &quot;PhoneGap.plist&quot;. For example, if accessing google, you&#39;d want to specify &quot;*.google.com&quot;.   Any other form I tried didn&#39;t work. &lt;br /&gt;&lt;br /&gt;In the case of the what text to enter, for the search, I think the only one that works is &quot;firefox&quot;. But, if you enter that, you get a nice, long list of alternate browsers:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQdc4uNWmnKMRRCVY3WAeZlrZEdWiYIbluSxR1BjnvmUDamoH0dCIKHohYmh3cWHtpr499erOs1uivWGUirR9JZ6D3soCMOZZWmpw_weJIdUsu14CzS9LCVfCWu1MERojDMx38N3YspUg/s1600/Screen+shot+2011-11-30+at+8.01.48+PM.png&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 163px; height: 320px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQdc4uNWmnKMRRCVY3WAeZlrZEdWiYIbluSxR1BjnvmUDamoH0dCIKHohYmh3cWHtpr499erOs1uivWGUirR9JZ6D3soCMOZZWmpw_weJIdUsu14CzS9LCVfCWu1MERojDMx38N3YspUg/s320/Screen+shot+2011-11-30+at+8.01.48+PM.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5680959051860560706&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I&#39;ll leave getting the second button to say something more than &quot;This app rocks&quot; up to you ;)</content><link rel='replies' type='application/atom+xml' href='http://gettingintomobile.blogspot.com/feeds/4385507753535577165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gettingintomobile.blogspot.com/2011/11/getting-phone-gap-to-work-with-jquery.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/4385507753535577165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/4385507753535577165'/><link rel='alternate' type='text/html' href='http://gettingintomobile.blogspot.com/2011/11/getting-phone-gap-to-work-with-jquery.html' title='Getting Phone Gap to work with JQuery Mobile'/><author><name>Getting Into Mobile</name><uri>http://www.blogger.com/profile/10712519676082391096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0cTlJ4ibXvAKFtZw1LgeJli5kvBGnpbC_Z78Dtfdvw9olW8FAQ4Uy04AujvbpPIf95KqPTyM23XrP8jAO7gbv1r-qUzl87-OKTFY2B5WCkj-pjFk-1_WttqyPCqFLF6u-T0xLz7NUE-0/s72-c/Screen+shot+2011-11-30+at+1.32.24+PM.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5315596295108076178.post-4381975984147456959</id><published>2011-11-21T11:41:00.000-08:00</published><updated>2011-11-21T13:36:37.586-08:00</updated><title type='text'>jQuery Mobile - first steps</title><content type='html'>Having just finished chapter 3 of Jonathan&#39;s Stark&#39;s excellent tutorial on building iPhone apps without objective C, &lt;br /&gt;&lt;br /&gt;(http://ofps.oreilly.com/titles/9780596805784/ch03_id35816678.html)&lt;br /&gt;&lt;br /&gt;I then started in on Chapter 4. However, it works with jQTouch. jQtouch seems great, but apparently it&#39;s no longer being actively developed and seem to have been more or less supersceded by jQuery Mobile. There are also a number of other platforms out there, but I&#39;m going to focus on jQuery mobile for a couple of reasons:&lt;br /&gt;&lt;br /&gt;1) It seems to be quick to learn&lt;br /&gt;2) I want to get more familiar with javascript in general.&lt;br /&gt;&lt;br /&gt;There&#39;s a nice little summary that gives a clear, quick overview of its features here:&lt;br /&gt;http://qpants.wordpress.com/2010/10/19/jquerymobile-review/&lt;br /&gt;&lt;br /&gt;So, going to the jQuery mobile page, let&#39;s walk through the intro tutorial. It&#39;s at http://jquerymobile.com/demos/1.0/docs/about/getting-started.html&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;Getting Started with jQuery Mobile&lt;br /&gt;&lt;br /&gt;jQuery Mobile provides a set of touch-friendly UI widgets and an AJAX-powered navigation system to support animated page transitions. Building your first jQuery Mobile page is easy, here&#39;s how:&lt;br /&gt;&lt;br /&gt;Create a basic page template&lt;br /&gt;Pop open your favorite text editor, paste in the page template below, save and open in a browser. You are now a mobile developer!&lt;br /&gt;&lt;br /&gt;Here&#39;s what&#39;s in the template. In the head, a meta viewport tag sets the screen width to the pixel width of the device and references to jQuery, jQuery Mobile and the mobile theme stylesheet from the CDN add all the styles and scripts.&lt;br /&gt;&lt;br /&gt;In the body, a div with a data-role of page is the wrapper used to delineate a page, and the header bar (data-role=&quot;header&quot;) and content region (data-role=&quot;content&quot;) are added inside to create a basic page (these are both optional). These data- attributes are HTML5 attributes are used throughout jQuery Mobile to transform basic markup into an enhanced and styled widget.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt; &lt;br /&gt;Here&#39;s the template:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&amp;lt;!DOCTYPE html&amp;gt; &lt;br /&gt;&amp;lt;html&amp;gt; &lt;br /&gt; &amp;lt;head&amp;gt; &lt;br /&gt; &amp;lt;title&amp;gt;My Page&amp;lt;/title&amp;gt; &lt;br /&gt; &amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;width=device-width, initial-scale=1&amp;quot;&amp;gt; &lt;br /&gt; &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css&amp;quot; /&amp;gt;&lt;br /&gt; &amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;http://code.jquery.com/jquery-1.6.4.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt; &amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt; &lt;br /&gt;&amp;lt;body&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;div data-role=&amp;quot;page&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;div data-role=&amp;quot;header&amp;quot;&amp;gt;&lt;br /&gt;  &amp;lt;h1&amp;gt;My Title&amp;lt;/h1&amp;gt;&lt;br /&gt; &amp;lt;/div&amp;gt;&amp;lt;!-- /header --&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;div data-role=&amp;quot;content&amp;quot;&amp;gt; &lt;br /&gt;  &amp;lt;p&amp;gt;Hello world&amp;lt;/p&amp;gt;  &lt;br /&gt; &amp;lt;/div&amp;gt;&amp;lt;!-- /content --&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&amp;lt;!-- /page --&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;A couple of key points - the whole app is in a single page. Html5&#39;s &quot;data-role&quot; is used in &quot;div&quot; declarations to distinguish between pages, headers, content etc.&lt;br /&gt;&lt;br /&gt;So, let&#39;s bring this up in safari and see how it looks. Btw, I just learned a nice trick for displaying static html files in the iOS simulator safari browser - just drag and drop in into the simulator. There&#39;s no need even to start safari!&lt;br /&gt;&lt;br /&gt;I wanted to show how it looks, but I&#39;m having trouble pasting the image, I&#39;ll try to add it later. &lt;br /&gt;&lt;br /&gt;Continuing:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Add your content&lt;br /&gt;Inside your content container, you can add all any standard HTML elements - headings, lists, paragraphs, etc. You can write your own custom styles to create custom layouts by adding an additional stylesheet to the head after the jQuery Mobile stylesheet.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Make a listview&lt;br /&gt;jQuery Mobile includes a diverse set of common listviews that are coded as lists with a data-role=&amp;quot;listview&amp;quot; added. Here is a simple linked list that has a role of listview. We&amp;#039;re going to make this look like an inset module by adding a data-inset=&amp;quot;true&amp;quot; and add a dynamic search filter with the data-filter=&amp;quot;true&amp;quot; attributes.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;ul data-role=&amp;quot;listview&amp;quot; data-inset=&amp;quot;true&amp;quot; data-filter=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt; &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#&amp;quot;&amp;gt;Acura&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt; &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#&amp;quot;&amp;gt;Audi&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt; &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#&amp;quot;&amp;gt;BMW&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt; &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#&amp;quot;&amp;gt;Cadillac&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt; &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#&amp;quot;&amp;gt;Ferrari&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ok, so let&#39;s add this to the html just created under the div with the &quot;content&quot; role. &lt;br /&gt;&lt;br /&gt;Very nice - a cool, iPhone-ish looking listview which includes a search. The search works out of box, although not quite as you&#39;d expect - it finds any items that contain the string entered, as opposed to starting with it.&lt;br /&gt;&lt;br /&gt;Continuing on:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Add a slider&lt;br /&gt;The framework contains a full set of form elements that automatically are enhanced into touch-friendly styled widgets. Here&#39;s a slider made with the new HTML5 input type of range, no data-role needed. Be sure to wrap these in a form element and always properly associate a label to every form element.&lt;br /&gt;&lt;br /&gt;&amp;lt;form&amp;gt;&lt;br /&gt;   &amp;lt;label for=&amp;quot;slider-0&amp;quot;&amp;gt;Input slider:&amp;lt;/label&amp;gt;&lt;br /&gt;   &amp;lt;input type=&amp;quot;range&amp;quot; name=&amp;quot;slider&amp;quot; id=&amp;quot;slider-0&amp;quot; value=&amp;quot;25&amp;quot; min=&amp;quot;0&amp;quot; max=&amp;quot;100&amp;quot;  /&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Nice - you get a pretty little slider with a label whose text changes as you move the slider. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Next:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Make a button&lt;br /&gt;&lt;br /&gt;There are a few ways to make buttons, but lets turn a link into a button so it&#39;s easy to click. Just start with a link and add a data-role=&quot;button&quot; attribute to it. You can add an icon with the data-icon attribute and optionally set its position with the data-iconpos attribute.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;a href=&amp;quot;#&amp;quot; data-role=&amp;quot;button&amp;quot; data-icon=&amp;quot;star&amp;quot;&amp;gt;Star button&amp;lt;/a&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Nice - a button that take you to the specified link. In this case, it&#39;s just the same page, but you could paste an address for anywhere. &lt;br /&gt;&lt;br /&gt;Next - themes!&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Play with theme swatches&lt;br /&gt;&lt;br /&gt;jQuery Mobile has a robust theme framework that supports up to 26 sets of toolbar, content and button colors, called a &amp;quot;swatch&amp;quot;. Just add a data-theme=&amp;quot;e&amp;quot; attribute to any of the widgets on this page: page, header, list, input for the slider, or button to turn it yellow. Try different swatch letters in default theme from a-e to mix and match swatches.&lt;br /&gt;&lt;br /&gt;Cool party trick: add the theme swatch to the page and see how all the widgets inside the content will automatically inherit the theme (headers don&amp;#039;t inherit, they default to swatch A).&lt;br /&gt;&lt;br /&gt;&amp;lt;a href=&amp;quot;#&amp;quot; data-role=&amp;quot;button&amp;quot; data-icon=&amp;quot;star&amp;quot; data-theme=&amp;quot;a&amp;quot;&amp;gt;Button&amp;lt;/a&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Very nice. Different colored buttons, and themes. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So, this was a nice little tutorial on some of the basics of jQuery Mobile. I&#39;m going to try do a static page on it first. Later on, I&#39;ll check it for database access.</content><link rel='replies' type='application/atom+xml' href='http://gettingintomobile.blogspot.com/feeds/4381975984147456959/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gettingintomobile.blogspot.com/2011/11/jquery-mobile-first-steps.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/4381975984147456959'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/4381975984147456959'/><link rel='alternate' type='text/html' href='http://gettingintomobile.blogspot.com/2011/11/jquery-mobile-first-steps.html' title='jQuery Mobile - first steps'/><author><name>Getting Into Mobile</name><uri>http://www.blogger.com/profile/10712519676082391096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5315596295108076178.post-6243182392611771419</id><published>2011-11-19T11:40:00.000-08:00</published><updated>2011-11-20T15:39:42.613-08:00</updated><title type='text'></title><content type='html'>Welcome to my blog! If you&#39;ve stumbled across this in your travels on the internet, please take a moment click on an ad - or two! You might see something you like, *and* it helps finance the blogosphere. Think of the children! &lt;br /&gt;&lt;br /&gt;Ok, after a couple of days hiatus, we&#39;re ready to tackle Jonathan Stark&#39;s phone-gap tutorial again. We were about 2/3 of the way through the murderous part 3 when we left off. &lt;br /&gt;&lt;br /&gt;The next step is &quot;Adding an Icon to the Home Screen&quot;. Let&#39;s see what this does. It&#39;s essentially just adding a 57 x 57 file named &quot;apple-touch-icon.png&quot; to your public_html directory. It lets the user put an app for your mobile web app onto his icons along with the regular app from the safari browser (by hitting the middle icon on the bottom of the browser and selecting &quot;add to home screen&quot;. Pretty nifty. &lt;br /&gt;&lt;br /&gt;Next up is &quot;Full Screen Mode&quot;. All you need to do for this is add this line: &lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&amp;lt;meta name=&amp;quot;apple-mobile-web-app-capable&amp;quot; content=&amp;quot;yes&amp;quot; /&amp;gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;to the head section of &quot;iphone.html&quot;. It gives you extra space on the web display on the hijacked links. &lt;br /&gt;&lt;br /&gt;Note, you need to delete and re-add the icon you just added to your home screen to make it work. It should look something like this:&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRA4I6Abr7NufIVjPGOfO3YKuYYGY9VVZlLFsnf44DR-U41f_V_rM_6cF05lEWb-pK7tCCFPbFuRYf2fSvw7HhcqwHSj2xK4wuaJdFU-7PCua-CDhOdELnEvzN3c0YME7zoegT_O69_jU/s1600/Screen+shot+2011-11-20+at+6.27.47+PM.png&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 164px; height: 320px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRA4I6Abr7NufIVjPGOfO3YKuYYGY9VVZlLFsnf44DR-U41f_V_rM_6cF05lEWb-pK7tCCFPbFuRYf2fSvw7HhcqwHSj2xK4wuaJdFU-7PCua-CDhOdELnEvzN3c0YME7zoegT_O69_jU/s320/Screen+shot+2011-11-20+at+6.27.47+PM.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5677224308984860754&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Ok, the next step is to change the color of the status bar:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;meta name=&amp;quot;apple-mobile-web-app-status-bar-style&amp;quot; content=&amp;quot;black&amp;quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;non-escaped html:&lt;br /&gt;&lt;br /&gt;&lt;meta name=&quot;apple-mobile-web-app-status-bar-style&quot; content=&quot;black&quot; /&gt;&lt;br /&gt;&lt;br /&gt;Finally, we can add a startup graphic with this:&lt;br /&gt;&lt;br /&gt;&amp;lt;link rel=&amp;quot;apple-touch-startup-image&amp;quot; href=&amp;quot;myCustomStartupGraphic.png&amp;quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;non-escaped html:&lt;br /&gt;&lt;br /&gt;&lt;link rel=&quot;apple-touch-startup-image&quot; href=&quot;myCustomStartupGraphic.png&quot; /&gt;&lt;br /&gt;&lt;br /&gt;And you get the loading graphic...and we&#39;re done!</content><link rel='replies' type='application/atom+xml' href='http://gettingintomobile.blogspot.com/feeds/6243182392611771419/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gettingintomobile.blogspot.com/2011/11/welcome-to-my-blog-if-youve-stumbled.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/6243182392611771419'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/6243182392611771419'/><link rel='alternate' type='text/html' href='http://gettingintomobile.blogspot.com/2011/11/welcome-to-my-blog-if-youve-stumbled.html' title=''/><author><name>Getting Into Mobile</name><uri>http://www.blogger.com/profile/10712519676082391096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRA4I6Abr7NufIVjPGOfO3YKuYYGY9VVZlLFsnf44DR-U41f_V_rM_6cF05lEWb-pK7tCCFPbFuRYf2fSvw7HhcqwHSj2xK4wuaJdFU-7PCua-CDhOdELnEvzN3c0YME7zoegT_O69_jU/s72-c/Screen+shot+2011-11-20+at+6.27.47+PM.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5315596295108076178.post-9099587513144560422</id><published>2011-11-18T13:20:00.000-08:00</published><updated>2011-11-18T15:39:36.714-08:00</updated><title type='text'>Solving XCode4.2 upgrade warnings; importing flurry analytics; etc.</title><content type='html'>Welcome to my blog! If you&#39;ve stumbled across this (or any blog) in your travels on the internet, place take a moment click on an ad -or two! You might see something you like, *and* it helps finance the blogosphere. Think of the children.  &lt;br /&gt;&lt;br /&gt;Ok, well, today, I&#39;ve just released my first free version of my app. It give the first 100 for free, but you need to pay for the rest.  But, I need to make it clearer when you run out, like an alert. As it stands now, you just have to keep repeating, trying to figure out why you&#39;re stuck. I went through 3 of the same quiz before I finally got it, and I wrote the program. &lt;br /&gt;&lt;br /&gt;So, the goal of today is to put in an alert. I also want to put in some metrics. &lt;br /&gt;&lt;br /&gt;Woah - thank God. A gang of like 20 high school girls just decided *not* to sit right next to me. That was a close call.&lt;br /&gt;&lt;br /&gt;Oh, yeah, I almost forgot. Since I upgraded to Xcode 4.2, I&#39;ve been getting warnings from the Reachability class:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;declaration of &#39;…&#39; will not be visible outside of this function warning&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Stackoverflow as usual has the solution:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;br /&gt;Add #import &amp;lt;netinet/in.h&amp;gt; in Reachability.h to get away with this&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Ok, there are still a couple of other warnings. &lt;br /&gt;&lt;br /&gt;I&#39;m getting an incompatible pointer warning on this:&lt;br /&gt;&lt;br /&gt;    UIScrollView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];&lt;br /&gt;&lt;br /&gt;If I click on the warning, it takes me to the class itself, which returns a UIView. So casting it to a UIScrollView eliminates the problem:&lt;br /&gt;&lt;br /&gt;     UIScrollView *view = (UIScrollView *) [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ok, good. Now, the last warning is &lt;br /&gt;&lt;br /&gt;&quot;initwithframe reuseidentifier is deprecated&quot; from this statement: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;        cell = [ [[UITableViewCell alloc]&lt;br /&gt;      initWithFrame:CGRectZero reuseIdentifier:@&quot;cell&quot;] autorelease];&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;The fix, again from stackoverflow, is this:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;        &lt;br /&gt;cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@&quot;cell&quot;] autorelease];&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Whew! That was pain. &lt;br /&gt;&lt;br /&gt;Ok, where was I? Ok, first, let&#39;s throw in the alert. &lt;br /&gt;&lt;br /&gt;Here&#39;s where I want to throw it in: &lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;  &lt;br /&gt;if (reachedEndOfFreeWords) {&lt;br /&gt;        if ([Utils isFreeVersion]) {&lt;br /&gt;            self.upperCongratsMessage.text = @&quot;Free vocabualary completed!&quot;;&lt;br /&gt;            self.congratsMessage.text = @&quot;Click the buy button below for the rest!&quot;;&lt;br /&gt;&lt;br /&gt;           =========&gt; create the alert here! &lt;=====================&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;        else {&lt;br /&gt;            self.congratsMessage.text = @&quot;You have completed *all* the words!&quot;;            &lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Ok, let&#39;s get some alert code. Where do we have it? Hmm...right - there&#39;s an alert if you don&#39;t get all the question right. &lt;br /&gt;&lt;br /&gt;Ah, here it is:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;        &lt;br /&gt;            &lt;br /&gt;            // construct a message letting the user know how many were wrong&lt;br /&gt;            NSString *title = [NSString stringWithFormat:@&quot;You answered %d out %d correctly&quot;,appState.correctAnswers, [appState.shuffledQuestionDictKeyList count]];&lt;br /&gt;            &lt;br /&gt;            UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title &lt;br /&gt;                                                            message:@&quot;To advance, all answers must be correct&quot; &lt;br /&gt;                                                           delegate:nil &lt;br /&gt;                                                  cancelButtonTitle:@&quot;OK&quot;&lt;br /&gt;                                                  otherButtonTitles:nil];&lt;br /&gt;            &lt;br /&gt;            [alert show];&lt;br /&gt;            [alert release];&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt; &lt;br /&gt;So, let&#39;s make this look like this:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;            &lt;br /&gt;           &lt;br /&gt;            // construct a message to the user&lt;br /&gt;            NSString *title = [NSString stringWithFormat:@&quot;Press the &lt;br /&gt;\&quot;Buy\&quot; button below for the rest of the questions!&quot;;&lt;br /&gt;            &lt;br /&gt;            UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title &lt;br /&gt;                                                            message:@&quot;Congratulations - free questions completed.&quot; &lt;br /&gt;                                                           delegate:nil &lt;br /&gt;                                                  cancelButtonTitle:@&quot;OK&quot;&lt;br /&gt;                                                  otherButtonTitles:nil];&lt;br /&gt;            &lt;br /&gt;            [alert show];&lt;br /&gt;            [alert release];&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ok, with that taken care of, let&#39;s set up the metrics. &lt;br /&gt;&lt;br /&gt;Pretty easy - copy the libFlurryAnalytics.a into the project, copy the FlurryAnalytics.h into the app delegate implementation file, and the start session in the &quot;application:didFinishLaunchingWithOptions method:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;    &lt;br /&gt;[FlurryAnalytics startSession:@&quot;YOUR_KEY_GOES_HERE&quot;];&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Ok, that&#39;s a wrap. Check out the ads!</content><link rel='replies' type='application/atom+xml' href='http://gettingintomobile.blogspot.com/feeds/9099587513144560422/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gettingintomobile.blogspot.com/2011/11/solving-xcode42-upgrade-warnings.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/9099587513144560422'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5315596295108076178/posts/default/9099587513144560422'/><link rel='alternate' type='text/html' href='http://gettingintomobile.blogspot.com/2011/11/solving-xcode42-upgrade-warnings.html' title='Solving XCode4.2 upgrade warnings; importing flurry analytics; etc.'/><author><name>Getting Into Mobile</name><uri>http://www.blogger.com/profile/10712519676082391096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>