<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Official Joroto Blog &#187; programming</title>
	<atom:link href="http://www.joroto.com/blog/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.joroto.com/blog</link>
	<description>From the people at Joroto, Inc.</description>
	<lastBuildDate>Thu, 20 Oct 2011 21:10:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to find your resources and how to generally find the directory layout</title>
		<link>http://www.joroto.com/blog/2011/08/14/how-to-find-your-resources-and-how-to-generally-find-the-directory-layout/</link>
		<comments>http://www.joroto.com/blog/2011/08/14/how-to-find-your-resources-and-how-to-generally-find-the-directory-layout/#comments</comments>
		<pubDate>Mon, 15 Aug 2011 03:24:41 +0000</pubDate>
		<dc:creator>Tom CTO</dc:creator>
				<category><![CDATA[iPod and Apple Platform]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[bundle]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[compiled]]></category>
		<category><![CDATA[compiling]]></category>
		<category><![CDATA[directory]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[iPlatform]]></category>
		<category><![CDATA[ipod]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[resource]]></category>
		<category><![CDATA[SDK]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.joroto.com/blog/?p=612</guid>
		<description><![CDATA[To find the main download directory for when you are receiving files, put this snippet of code in a test project or your main project at the point of opening: NSArray *pathsForDownloadedFiles = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *pathMain = [pathsForDownloadedFiles &#8230; <a href="http://www.joroto.com/blog/2011/08/14/how-to-find-your-resources-and-how-to-generally-find-the-directory-layout/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>To find the main download directory for when you are receiving files, put this snippet of code in a test project or your main project at the point of opening:</p>
<pre> NSArray *pathsForDownloadedFiles = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
 NSString *pathMain = [pathsForDownloadedFiles objectAtIndex:0];
 NSLog(@"main download directory is [%s]", [pathMain UTF8String]);</pre>
<p>The first line lets you allow Apple to put the application download directory anywhere it likes. It will also be able to change it at will, without breaking your program.<br />
The second line means that there is only one directory you need to access and its the first one. Remember in C arrays are zero based which means the first element of the array is at index number zero not at index number one.<br />
NSLog will let you run the app in the simulator OR on your device and send logging information back to the debug console in XCode. Nice and integrated.</p>
<p>An alternative method:</p>
<pre> NSString *mainPath = [self getDataPath];</pre>
<p>Uhhhhh yeah a bit shorter. Its not deprecated from what I see so one can use this method also.</p>
<p>Finally lets see where our resource is. Again, if you use this method, then XCode will be able to re-layout the resource directory structure anyway it wants without breaking your program. You KNOW they&#8217;re going to do this someday and they won&#8217;t tell you until its been done. So lets Program Defensively. Just like you drive defensively.<br />
To find a specific resource that was compiled into your application:</p>
<pre> NSString *resourcePath = [[NSBundle mainBundle] pathForResource:@"mission1" ofType:@"jmf"];
 NSLog(@"Path for mission file is [%s]", [resourcePath UTF8String]);</pre>
<p>The AT (@) sign is the NSString constructor without declaring an NSString. In case you&#8217;re wondering.</p>
<p>Good Luck and God&#8217;s Speed to ya mates.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.joroto.com%2Fblog%2F2011%2F08%2F14%2Fhow-to-find-your-resources-and-how-to-generally-find-the-directory-layout%2F&amp;title=How%20to%20find%20your%20resources%20and%20how%20to%20generally%20find%20the%20directory%20layout" id="wpa2a_2"><img src="http://www.joroto.com/blog/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.joroto.com/blog/2011/08/14/how-to-find-your-resources-and-how-to-generally-find-the-directory-layout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPad Universal App</title>
		<link>http://www.joroto.com/blog/2010/08/14/ipad-universal-app/</link>
		<comments>http://www.joroto.com/blog/2010/08/14/ipad-universal-app/#comments</comments>
		<pubDate>Sun, 15 Aug 2010 03:29:02 +0000</pubDate>
		<dc:creator>Tom CTO</dc:creator>
				<category><![CDATA[iPod and Apple Platform]]></category>
		<category><![CDATA[icon]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[launch image]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[splash]]></category>
		<category><![CDATA[Universal]]></category>

		<guid isPermaLink="false">http://www.joroto.com/blog/?p=517</guid>
		<description><![CDATA[This is for the uninitiated and for posterity. Running XCode 3.2.3. Please NOTE: I had forgotten this. If you update the OS of your iPlatform device (pod/phone/pad) then you MUST update the XCode SDK. Now this makes sense in a &#8230; <a href="http://www.joroto.com/blog/2010/08/14/ipad-universal-app/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is for the uninitiated and for posterity.<br />
Running XCode 3.2.3.<br />
Please NOTE: I had forgotten this. If you update the OS of your iPlatform device (pod/phone/pad) then you MUST update the XCode SDK. Now this makes sense in a way, however last night&#8217;s (8/13/10) update of the device was NOT matched by and Upgrade notification of the XCode SDK platform. I had to go a lookin.  Bottom line is, unless you NEED something from that update, don&#8217;t do it in the middle of a project. It waste Humungo time. That means ALOT for you marketing weasels.</p>
<p>1) Create a View Based app<br />
2) Name it of course.<br />
3) Drop down the targets folder in the project explorer. Its where it drops you after project creation.<br />
4) Select your named project as the target.<br />
5) Go to the top menu drop down the Project menu.<br />
6) Choose  &#8220;Upgrade Current Target for iPad&#8230;&#8221; selection.<br />
7) Choose One Universal Application. It is already selected.<br />
YAH MULE. Head thumping music going now. Very loud is better.<br />
 <img src='http://www.joroto.com/blog/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> Click OK . Umm duh<br />
9) Holy smokes Batman it auto-created the MainWindow~iPad.xib for you. Waycool.<br />
As my speakers blow. Joroto will buy me another set right? Part of the &#8220;support you local programmer&#8221; program. Right!?<br />
It also created a Resources-iPad Group folder for you. It is in your BEST interest to keep your assets separated. Ya know the graphics, etc.<br />
10) It is autoset for a device. Use the drop down on the left under the window control buttons to change to Simulator, and then choose iPad.<br />
11) Build and Run. Everything is ok.<br />
12) Close it and choose the iPhone simulator. Build and run. Everything is ok.<br />
13) You have an icon for your app right? RIGHT!? Double tap the (your project name).plist.<br />
This is the file that tells the app store and the iPlatform OS where to start when running you app and showing things when the app isn&#8217;t running.<br />
14) Fifth line down it says &#8220;Icon file&#8221;. Double tap the blank line on the right and enter the name of your icon. You don&#8217;t need the extension, it assumes png. No path is necessary.<br />
So how does it know where the graphic is?<br />
15) Right two-finger tap the Resources Group line. The context menu comes up. Move the cursor over Add, then choose existing file. Now find your file and choose Add (lower right hand corner of the Finder window). A Dialog pops up. I always choose the ALSO COPY the file into the project. This is so all my projects are self contained.<br />
16) Now we want a splash screen, because your bloated code (unless you grew up on CP/M and embedded systems like I did, or had an excellent mentor) will load too slowly.<br />
In the editing of the (your project name).plist where you placed the icon information:<br />
Double finger tap and choose Add Row.<br />
From the list choose &#8220;Launch Image (iPad)&#8221; selection.<br />
Tap the blank box to the right and enter the name of your splash screen graphic.<br />
Import that graphic into the project using the technique in step 15.<br />
You&#8217;ll need a splash images sized for the iPad and then ANOTHER for the iPhone. Graphic Artists are loving this.</p>
<p>Ok you&#8217;re cooking with gasoline. Build and run on each simulator.  You should see your splash screen, then hit the round button at the bottom of the simulator and you&#8217;ll see your icon on the simulator home screen.</p>
<p>Naming convention, although I have yet to fully test this.<br />
(Image name)-(orientation)~(device)@(size).png<br />
For ours its:<br />
Splash-Portrait~iPad.png<br />
Splash-Portrait~iPhone.png<br />
Splash-Portrait~iPhone@2X.png</p>
<p>&#8220;Remember, No matter where you go, there you are&#8221;<br />
Buckaroo Bonsai</p>
<p>Peace. Unless war is necessary.<br />
-T-</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.joroto.com%2Fblog%2F2010%2F08%2F14%2Fipad-universal-app%2F&amp;title=iPad%20Universal%20App" id="wpa2a_4"><img src="http://www.joroto.com/blog/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.joroto.com/blog/2010/08/14/ipad-universal-app/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Appfuse &#8211; the next step</title>
		<link>http://www.joroto.com/blog/2010/02/14/appfuse-the-next-step/</link>
		<comments>http://www.joroto.com/blog/2010/02/14/appfuse-the-next-step/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 04:18:55 +0000</pubDate>
		<dc:creator>Tom CTO</dc:creator>
				<category><![CDATA[Miscellaneous Apps and Services]]></category>
		<category><![CDATA[appfuse]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[freemarker]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.joroto.com/blog/?p=376</guid>
		<description><![CDATA[Appfuse &#8211; personalizing the app 2/13/2010 Purpose: Which files to edit in order to personalize the existing app for my company. Remember: App name is: tree Company is: joroto.com Source is in: ./tree/src/ ./tree/src/main/resources/mail.properties Change to be your email and &#8230; <a href="http://www.joroto.com/blog/2010/02/14/appfuse-the-next-step/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Appfuse &#8211; personalizing the app<br />
2/13/2010</p>
<p>Purpose:<br />
Which files to edit in order to personalize the existing app for my company.</p>
<p>Remember:<br />
App name is: tree<br />
Company is: joroto.com<br />
Source is in: ./tree/src/</p>
<p>./tree/src/main/resources/mail.properties<br />
Change to be your email and the login properties for your smtp server.</p>
<p>./tree/src/main/resources/ApplicationResources.properties<br />
Search for appfuse and change all to your product or company name. Depends on context.<br />
I added on line 7 the following line<br />
webapp.image=wr_logo3_230x100.jpg<br />
This is our site logo. I can see it being translated into different languages. We can offer one per locale. Also the colors may be offensive in some cultures, and the picture might have cultural significance as well.<br />
This file holds all of the localization (meaning strings to be translated) strings. You&#8217;ll see different file names each of which represent a language for a specific country code.</p>
<p>./tree/src/main/webapp/common/header.jsp<br />
I&#8217;m putting an image (webapp.img) into the headers instead of the text I entered in the ApplicationResources.properties. First I copied my jpg to the ./tree/src/main/webapp/images directory.<br />
Editing this file, I am interested in commenting out lines 8 and 9. Never delete until release. You never know when you might return to the text version of the page.<br />
Now my header.jsp looks like this:<br />
&lt;%@ include file=&#8221;/common/taglibs.jsp&#8221;%&gt;<br />
&lt;c:if test=&#8221;${pageContext.request.locale.language ne &#8216;en&#8217;}&#8221;&gt;<br />
&lt;div id=&#8221;switchLocale&#8221;&gt;&lt;a href=&#8221;&lt;c:url value=&#8217;/?locale=en&#8217;/&gt;&#8221;&gt;&lt;fmt:message key=&#8221;webapp.name&#8221;/&gt; in English&lt;/a&gt;&lt;/div&gt;<br />
&lt;/c:if&gt;<br />
&lt;div id=&#8221;branding&#8221;&gt;<br />
&lt;!&#8211; TAH 2/13/10<br />
&lt;h1&gt;&lt;a href=&#8221;&lt;c:url value=&#8217;/'/&gt;&#8221;&gt;&lt;fmt:message key=&#8221;webapp.name&#8221;/&gt;&lt;/a&gt;&lt;/h1&gt;<br />
&lt;p&gt;&lt;fmt:message key=&#8221;webapp.tagline&#8221;/&gt;&lt;/p&gt;<br />
&#8211;&gt;<br />
&lt;a href=&#8221;<a href="../../">http://www.joroto.com</a>&#8221; title=&#8221;Logo&#8221;&gt;<br />
&lt;img src=&#8221;&lt;fmt:message key=&#8221;webapp.img&#8221; /&gt;&#8221;<br />
alt=&#8221;&lt;fmt:message key=&#8221;webapp.name&#8221; /&gt;&#8221; /&gt;<br />
&lt;/a&gt;<br />
&lt;/div&gt;<br />
&lt;hr /&gt;<br />
&lt;%&#8211; Put constants into request scope &#8211;%&gt;<br />
&lt;appfuse:constants scope=&#8221;request&#8221;/&gt;</p>
<p>Note: I wanted to use the &lt;c:url construct but this would need freemarker to produce a two pass per line mode. Not sure if it can do this, but maybe I&#8217;ll have time later to see.<br />
My image is 100 pixels tall so I needed to change the CSS for the header.</p>
<p>Edit   ./tree/src/main/webapp/styles/simplicity/layout.css<br />
I commented out line 22 and added a new line that looks like this:<br />
height: 100px; /* TAH 2/13/10 */</p>
<p>Rerun the jetty:run-war and you&#8217;ll see the changes.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.joroto.com%2Fblog%2F2010%2F02%2F14%2Fappfuse-the-next-step%2F&amp;title=Appfuse%20%26%238211%3B%20the%20next%20step" id="wpa2a_6"><img src="http://www.joroto.com/blog/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.joroto.com/blog/2010/02/14/appfuse-the-next-step/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

