<?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>tmro &#187; programming languages</title>
	<atom:link href="http://www.tmro.net/category/software/languages/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tmro.net</link>
	<description>Mobilise your business</description>
	<lastBuildDate>Sun, 21 Aug 2011 01:38:09 +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>Mac OS and Java Me SDK 3.0</title>
		<link>http://www.tmro.net/2009/11/mac-os-and-java-me-sdk-3-0/</link>
		<comments>http://www.tmro.net/2009/11/mac-os-and-java-me-sdk-3-0/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 01:38:21 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[feedback]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[javame]]></category>

		<guid isPermaLink="false">http://www.tmro.net/?p=213</guid>
		<description><![CDATA[Sun have released not too long ago a Java ME SDK 3.0 that finally brings an official Wireless Toolkit Emulator to the Mac platform. I have been dealing with SUN software for a while now and I was not expecting &#8230; <a href="http://www.tmro.net/2009/11/mac-os-and-java-me-sdk-3-0/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Sun have released not too long ago a Java ME SDK 3.0 that finally brings an official Wireless Toolkit Emulator to the Mac platform.</p>
<p>I have been dealing with SUN software for a while now and I was not expecting this to be a smooth ride. Those who&#8217;d dealt with the WTK on Windows/Linux platform are well aware of the limitations of these emulators. What I was not prepared for was to get so much clutter that would just not work more than a couple of times.</p>
<p>First impression: this wtk looks like the most polished emulator ever released by Sun.</p>
<p>Sadly, after using the thing for a few days I discovered that the old habits had not changed:</p>
<ul>
<li>there is no menu entry to run an existing jad/jar pair. You have to right click on an emulator instance and then run it&#8230;</li>
<li>you cannot set-up a project starting from a jad/jar pair. There used to be an option to do this back in wtk 2.2&#8230;</li>
<li>after running a couple of apps the whole thing crashes an burns</li>
<li>when closing down the wtk a process is left lingering. Run this in a terminal:  <em>ps aux | grep device-manager.app</em></li>
<li>switching the verbose mode when launching the emulator kills the whole thing dead!</li>
<li>they bundled ant 1.7.1 with the distro although ant is built in Mac OS</li>
<li>Permgen errors are thrown if you try to launch the app too often. LOL</li>
</ul>
<p>Here&#8217;s what happened when I created a new project and tried to run it:</p>
<p><span style="color: #ff0000;">*** Error ***</span></p>
<p><span style="color: #ff0000;">Failed to connect to device 0!</span></p>
<p><span style="color: #ff0000;">Reason:</span></p>
<p><span style="color: #ff0000;">Emulator 0 terminated while waiting for it to register!</span></p>
<p>The same thing happens with Emulator 1 and 2 and 3 and 4 and 5 and 6 and &#8230; you get the picture.</p>
<p>Googling did return lots of forum posts, but hardly any answers&#8230;</p>
<p>So after wasting more than 2 hours on this issue I did the unthinkable: rebooted my mac! To my surprise the miracle happened during the reboot: I was finally able to run the project again.</p>
<p>Needless to say I am very disappointed but not surprised by the quality of this, early access, Java ME SDK.</p>
<p>Cheers&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tmro.net/2009/11/mac-os-and-java-me-sdk-3-0/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Updating the UISearchBar programmatically</title>
		<link>http://www.tmro.net/2009/10/updating-the-uisearchbar-programmatically/</link>
		<comments>http://www.tmro.net/2009/10/updating-the-uisearchbar-programmatically/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 03:28:27 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[objective c]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[how to]]></category>

		<guid isPermaLink="false">http://www.tmro.net/?p=208</guid>
		<description><![CDATA[Today I had to update WelliBUS&#8217;s search bar programmatically because I needed to use the street picked up via GPS as my street name. Until this point implementing the search bar seemed easy: adopt a couple of protocols: UISearchDisplayDelegate and &#8230; <a href="http://www.tmro.net/2009/10/updating-the-uisearchbar-programmatically/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today I had to update WelliBUS&#8217;s search bar programmatically because I needed to use the street picked up via GPS as my street name.</p>
<p>Until this point implementing the search bar seemed easy:</p>
<ul>
<li>adopt a couple of protocols: UISearchDisplayDelegate and UISearchBarDelegate</li>
<li>implement a few callback methods (from the delegates listed above)</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="obj-c" style="font-family:monospace;">- (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString;
- (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchScope:(NSInteger)searchOption;
- (void)searchDisplayControllerDidBeginSearch:(UISearchDisplayController *)controller;
- (void)searchDisplayControllerDidEndSearch:(UISearchDisplayController *)controller;</pre></div></div>

<ul>
<li>and implement my own filtering function</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="obj-c" style="font-family:monospace;">- (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope;</pre></div></div>

<p>The problem I had on my hands was how to programmatically update the text in the UISearchBar and force the UISearchDisplayDelegate to call the appropriate callback methods.</p>
<p>Turns out it was simpler than expected (despite not being able to find a solution by googling). All that was needed was:</p>

<div class="wp_syntax"><div class="code"><pre class="obj-c" style="font-family:monospace;">[self.searchDisplayController.searchBar becomeFirstResponder];
self.searchDisplayController.searchBar.text = returnString;</pre></div></div>

<p>Cheers&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tmro.net/2009/10/updating-the-uisearchbar-programmatically/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Urban Airship &#8211; Push Notifications</title>
		<link>http://www.tmro.net/2009/10/urban-airship-push-notifications/</link>
		<comments>http://www.tmro.net/2009/10/urban-airship-push-notifications/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 22:50:31 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[objective c]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[json]]></category>

		<guid isPermaLink="false">http://www.tmro.net/?p=198</guid>
		<description><![CDATA[Today I have finally added Push Notifications to Parcel Trackr. I decided not to waste time and I went for Urban Airship. I registered, uploaded my push certificate, downloaded the sample and integrated the two systems. Not everything went smoothly &#8230; <a href="http://www.tmro.net/2009/10/urban-airship-push-notifications/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="letter-spacing: 0.0px;">Today I have finally added Push Notifications to Parcel Trackr.</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;"><span style="letter-spacing: 0.0px;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="letter-spacing: 0.0px;">I decided not to waste time and I went for Urban Airship. I registered, uploaded my push certificate, downloaded the sample and integrated the two systems.</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;"><span style="letter-spacing: 0.0px;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="letter-spacing: 0.0px;">Not everything went smoothly though because when I first ran the application I got a</span></p>
<p style="margin: 0.0px 0.0px 0.0px 28.0px; text-indent: -28.0px; font: 11.0px Menlo;"><span style="letter-spacing: 0.0px;"><strong>Failed to register with error: Error Domain=NSCocoaErrorDomain Code=3000 UserInfo=0&#215;120610 &#8220;no valid &#8216;aps-environment&#8217; entitlement string found for application&#8221;</strong></span></p>
<p style="margin: 0.0px 0.0px 0.0px 28.0px; text-indent: -28.0px; font: 11.0px Menlo; min-height: 13.0px;"><span style="letter-spacing: 0.0px;"><strong> </strong></span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="letter-spacing: 0.0px;">I thought my provisioning profile did not include the right entitlement&#8230; so I re-downloaded it and tried again. Turns out I was using the wrong provisioning profile.</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;"><span style="letter-spacing: 0.0px;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="letter-spacing: 0.0px;">So if you want to avoid my mistake just make sure that after you’ve configured push services in the iPhone Dev Center you download the updated provisioning profile and then you install it via XCode.</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;"><span style="letter-spacing: 0.0px;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="letter-spacing: 0.0px;">Other things worth checking include: the product name in your build configuration matches the app id and of course, the ultimate solution, clean all targets before building!</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;"><span style="letter-spacing: 0.0px;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="letter-spacing: 0.0px;">Cheers&#8230;</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tmro.net/2009/10/urban-airship-push-notifications/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

