<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>BEHIND THE BOX</title>
	<atom:link href="https://whatpaulhaslearnt.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://whatpaulhaslearnt.wordpress.com</link>
	<description>Paul Kolozsvari&#039;s blog on software development and useful applications/tools he comes across while behind the box.</description>
	<lastBuildDate>Sat, 12 May 2012 08:42:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='whatpaulhaslearnt.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>https://s2-ssl.wordpress.com/i/buttonw-com.png</url>
		<title>BEHIND THE BOX</title>
		<link>https://whatpaulhaslearnt.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="https://whatpaulhaslearnt.wordpress.com/osd.xml" title="BEHIND THE BOX" />
	<atom:link rel='hub' href='https://whatpaulhaslearnt.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Psion Cabster &#8211; build, wrap, deploy and install CAB files to devices.</title>
		<link>https://whatpaulhaslearnt.wordpress.com/2012/05/12/psion-cabster-build-wrap-deploy-and-install-cab-files-to-devices/</link>
		<comments>https://whatpaulhaslearnt.wordpress.com/2012/05/12/psion-cabster-build-wrap-deploy-and-install-cab-files-to-devices/#comments</comments>
		<pubDate>Sat, 12 May 2012 08:21:37 +0000</pubDate>
		<dc:creator>Paul Kolozsvari</dc:creator>
				<category><![CDATA[computing]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://whatpaulhaslearnt.wordpress.com/?p=603</guid>
		<description><![CDATA[Just finished a utility for Psion customers and technicians to build their own CAB files, wrap multiple CAB files into one, deploy/install them via Active Sync and create an auto run drive for installing CAB files upon insertion of the drive into the device. Overview documentation: Psion Cabster Overview 1.0.0.pdf Download Psion Cabster: Psion Cabster 2012-05-12.zip Once &#8230; <a href="https://whatpaulhaslearnt.wordpress.com/2012/05/12/psion-cabster-build-wrap-deploy-and-install-cab-files-to-devices/">Continue reading <span class="meta-nav">&#187;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=whatpaulhaslearnt.wordpress.com&#038;blog=8255770&#038;post=603&#038;subd=whatpaulhaslearnt&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Just finished a utility for Psion customers and technicians to build their own CAB files, wrap multiple CAB files into one, deploy/install them via Active Sync and create an auto run drive for installing CAB files upon insertion of the drive into the device.</p>
<p>Overview documentation: <a href="http://www.psionafrica.co.za/community/SharedFiles/Download.aspx?pageid=9&amp;mid=24&amp;fileid=22">Psion Cabster Overview 1.0.0.pdf</a></p>
<p>Download Psion Cabster: <a href="http://www.psionafrica.co.za/community/SharedFiles/Download.aspx?pageid=9&amp;mid=24&amp;fileid=21">Psion Cabster 2012-05-12.zip</a></p>
<p>Once downloaded the application needs to be registered. After executing Cabster for the first time it will register itself on Psion&#8217;s server, after which the license will need to be approved. Once approved the application will no longer need an internet connection. For license approval please contact me at: paul.kolozsvari@psion.com or paulkolo@gmail.com.</p>
<div id="attachment_604" class="wp-caption alignleft" style="width: 486px"><a href="https://whatpaulhaslearnt.files.wordpress.com/2012/05/screen-shot-2012-05-02-at-6-17-44-pm.png"><img class="size-full wp-image-604" title="Psion Cabster" src="https://whatpaulhaslearnt.files.wordpress.com/2012/05/screen-shot-2012-05-02-at-6-17-44-pm.png?w=750" alt="Psion Cabster"   /></a><p class="wp-caption-text">Psion Cabster</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/whatpaulhaslearnt.wordpress.com/603/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/whatpaulhaslearnt.wordpress.com/603/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/whatpaulhaslearnt.wordpress.com/603/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/whatpaulhaslearnt.wordpress.com/603/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/whatpaulhaslearnt.wordpress.com/603/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/whatpaulhaslearnt.wordpress.com/603/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/whatpaulhaslearnt.wordpress.com/603/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/whatpaulhaslearnt.wordpress.com/603/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/whatpaulhaslearnt.wordpress.com/603/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/whatpaulhaslearnt.wordpress.com/603/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/whatpaulhaslearnt.wordpress.com/603/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/whatpaulhaslearnt.wordpress.com/603/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/whatpaulhaslearnt.wordpress.com/603/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/whatpaulhaslearnt.wordpress.com/603/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=whatpaulhaslearnt.wordpress.com&#038;blog=8255770&#038;post=603&#038;subd=whatpaulhaslearnt&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://whatpaulhaslearnt.wordpress.com/2012/05/12/psion-cabster-build-wrap-deploy-and-install-cab-files-to-devices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="https://whatpaulhaslearnt.files.wordpress.com/2012/05/screen-shot-2012-05-02-at-6-17-44-pm.png?w=102" />
		<media:content url="https://whatpaulhaslearnt.files.wordpress.com/2012/05/screen-shot-2012-05-02-at-6-17-44-pm.png?w=102" medium="image">
			<media:title type="html">Psion Cabster</media:title>
		</media:content>

		<media:content url="https://secure.gravatar.com/avatar/735c480b7d591c311bb406bb6fe80920?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Paul</media:title>
		</media:content>

		<media:content url="https://whatpaulhaslearnt.files.wordpress.com/2012/05/screen-shot-2012-05-02-at-6-17-44-pm.png" medium="image">
			<media:title type="html">Psion Cabster</media:title>
		</media:content>
	</item>
		<item>
		<title>Maximize Windows on Mac OS X</title>
		<link>https://whatpaulhaslearnt.wordpress.com/2011/12/04/maximize-windows-on-mac-os-x/</link>
		<comments>https://whatpaulhaslearnt.wordpress.com/2011/12/04/maximize-windows-on-mac-os-x/#comments</comments>
		<pubDate>Sun, 04 Dec 2011 15:14:02 +0000</pubDate>
		<dc:creator>Paul Kolozsvari</dc:creator>
				<category><![CDATA[uncategorized]]></category>

		<guid isPermaLink="false">http://whatpaulhaslearnt.wordpress.com/?p=598</guid>
		<description><![CDATA[Coming from a Microsoft Windows background, I found it quite annoying to not be able to maximize a window on a Mac. Found this cool app, Right Zoom with which you can though. So when you hit the + button on a window it completely maximizes the window instead of resizing it randomly. You can &#8230; <a href="https://whatpaulhaslearnt.wordpress.com/2011/12/04/maximize-windows-on-mac-os-x/">Continue reading <span class="meta-nav">&#187;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=whatpaulhaslearnt.wordpress.com&#038;blog=8255770&#038;post=598&#038;subd=whatpaulhaslearnt&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Coming from a Microsoft Windows background, I found it quite annoying to not be able to maximize a window on a Mac. Found this cool app, <a title="Right Zoom" href="http://www.blazingtools.com/downloads.html#RightZoom" target="_blank">Right Zoom</a> with which you can though. So when you hit the + button on a window it completely maximizes the window instead of resizing it randomly. You can also assign a keyboard shortcut key.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/whatpaulhaslearnt.wordpress.com/598/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/whatpaulhaslearnt.wordpress.com/598/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/whatpaulhaslearnt.wordpress.com/598/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/whatpaulhaslearnt.wordpress.com/598/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/whatpaulhaslearnt.wordpress.com/598/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/whatpaulhaslearnt.wordpress.com/598/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/whatpaulhaslearnt.wordpress.com/598/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/whatpaulhaslearnt.wordpress.com/598/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/whatpaulhaslearnt.wordpress.com/598/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/whatpaulhaslearnt.wordpress.com/598/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/whatpaulhaslearnt.wordpress.com/598/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/whatpaulhaslearnt.wordpress.com/598/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/whatpaulhaslearnt.wordpress.com/598/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/whatpaulhaslearnt.wordpress.com/598/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=whatpaulhaslearnt.wordpress.com&#038;blog=8255770&#038;post=598&#038;subd=whatpaulhaslearnt&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://whatpaulhaslearnt.wordpress.com/2011/12/04/maximize-windows-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="https://secure.gravatar.com/avatar/735c480b7d591c311bb406bb6fe80920?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Paul</media:title>
		</media:content>
	</item>
		<item>
		<title>Spawned sub-processes on Windows fail to start due to desktop heap</title>
		<link>https://whatpaulhaslearnt.wordpress.com/2011/11/21/spawned-sub-processes-on-windows-fail-to-start-due-to-desktop-heap/</link>
		<comments>https://whatpaulhaslearnt.wordpress.com/2011/11/21/spawned-sub-processes-on-windows-fail-to-start-due-to-desktop-heap/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 08:12:05 +0000</pubDate>
		<dc:creator>Paul Kolozsvari</dc:creator>
				<category><![CDATA[computing]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://whatpaulhaslearnt.wordpress.com/?p=593</guid>
		<description><![CDATA[Psion has a software package called TekRF which essentially takes SAP screens and transactions to run on our devices, thereby allowing warehouse employees to interact with the SAP WMS via their terminals. We recently had an issue where only a certain number of terminals could connect to TekRF. TekRF spawns a new process (GUILIBSession.exe ) for &#8230; <a href="https://whatpaulhaslearnt.wordpress.com/2011/11/21/spawned-sub-processes-on-windows-fail-to-start-due-to-desktop-heap/">Continue reading <span class="meta-nav">&#187;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=whatpaulhaslearnt.wordpress.com&#038;blog=8255770&#038;post=593&#038;subd=whatpaulhaslearnt&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Psion has a software package called TekRF which essentially takes SAP screens and transactions to run on our devices, thereby allowing warehouse employees to interact with the SAP WMS via their terminals. We recently had an issue where only a certain number of terminals could connect to TekRF. TekRF spawns a new process (GUILIBSession.exe ) for each session that a terminal initiates. This process is responsible for establishing and handling the connection to SAP. If the process cannot start, it fails to connect to SAP and TekRF has no way of receiving error messages from the processes since it dies due to memory issues before it can log any errors.</p>
<p>After some troubleshooting we discovered the issue to be Windows related. Microsoft Windows has what they call a desktop memory heap that manages objects (windows, menus etc.). According to Microsoft it sometimes happens that a process is not allocated enough memory in which case the process has insufficient memory to start up. There are three different types of desktop heaps which include the heaps for interactive (desktop applications) and non-interactive (windows services) heaps. The size of the heaps can be configured in the registry as described in this Microsoft article: <a href="http://blogs.msdn.com/b/ntdebugging/archive/2007/01/04/desktop-heap-overview.aspx">http://blogs.msdn.com/b/ntdebugging/archive/2007/01/04/desktop-heap-overview.aspx</a></p>
<p>There’s a total accumulated number of bytes for all the desktop heaps running per user session. This total memory address is called the “Session View Space” and you can actually set this value in the registry too. On my machine it’s set to 30MB. So if a large number of processes get spawned each gets allocated a desktop heap, with a specific size. For example it could be 1024KB for each terminal that connects. So if the number of heap sizes exceeds the Session View Space (in my case 30MB) than any other new processes will fail to start, which is the problem we were facing. That is why in our case decreasing the size of desktop heaps fixed the issue. So chances are that if were to and  try connect even more terminals in the future we might face the same problem again. To fix that the size of the Session View Space can be increased as described in the above article. According to Microsoft:</p>
<p>“<strong>Where things go wrong</strong></p>
<p>Normally this “just works”, and neither the user nor the application developer need to worry about desktop heap usage.  However, there are two primary scenarios in which failures related to desktop heap can occur:</p>
<ol>
<li>Session view space for a given session can become fully utilized, so it is impossible for a new desktop heap to be created.</li>
<li>An existing desktop heap allocation can become fully utilized, so it is impossible for threads that use that desktop to use more desktop heap.”</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/whatpaulhaslearnt.wordpress.com/593/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/whatpaulhaslearnt.wordpress.com/593/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/whatpaulhaslearnt.wordpress.com/593/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/whatpaulhaslearnt.wordpress.com/593/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/whatpaulhaslearnt.wordpress.com/593/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/whatpaulhaslearnt.wordpress.com/593/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/whatpaulhaslearnt.wordpress.com/593/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/whatpaulhaslearnt.wordpress.com/593/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/whatpaulhaslearnt.wordpress.com/593/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/whatpaulhaslearnt.wordpress.com/593/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/whatpaulhaslearnt.wordpress.com/593/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/whatpaulhaslearnt.wordpress.com/593/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/whatpaulhaslearnt.wordpress.com/593/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/whatpaulhaslearnt.wordpress.com/593/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=whatpaulhaslearnt.wordpress.com&#038;blog=8255770&#038;post=593&#038;subd=whatpaulhaslearnt&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://whatpaulhaslearnt.wordpress.com/2011/11/21/spawned-sub-processes-on-windows-fail-to-start-due-to-desktop-heap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="https://secure.gravatar.com/avatar/735c480b7d591c311bb406bb6fe80920?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Paul</media:title>
		</media:content>
	</item>
		<item>
		<title>Command prompt on Windows Mobile</title>
		<link>https://whatpaulhaslearnt.wordpress.com/2011/10/20/command-prompt-on-windows-mobile/</link>
		<comments>https://whatpaulhaslearnt.wordpress.com/2011/10/20/command-prompt-on-windows-mobile/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 09:32:46 +0000</pubDate>
		<dc:creator>Paul Kolozsvari</dc:creator>
				<category><![CDATA[computing]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://whatpaulhaslearnt.wordpress.com/?p=586</guid>
		<description><![CDATA[If you ever need to use command prompt on Windows Mobile to run a script or command here&#8217;s how to do it: Download and install the Windows Mobile Developer Power Toys On your PC navigate to C:\Program Files\Windows Mobile Developer Power Toys\PPC_Command_Shell\arm Copy console.dll to the device&#8217;s Windows folder. Copy cmd.exe and shell.exe to anywhere on &#8230; <a href="https://whatpaulhaslearnt.wordpress.com/2011/10/20/command-prompt-on-windows-mobile/">Continue reading <span class="meta-nav">&#187;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=whatpaulhaslearnt.wordpress.com&#038;blog=8255770&#038;post=586&#038;subd=whatpaulhaslearnt&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you ever need to use command prompt on Windows Mobile to run a script or command here&#8217;s how to do it:</p>
<ul>
<li>Download and install the <a title="Windows Mobile Developer Power Toys" href="http://www.microsoft.com/download/en/details.aspx?id=10601" target="_blank">Windows Mobile Developer Power Toys</a></li>
<li>On your PC navigate to C:\Program Files\Windows Mobile Developer Power Toys\PPC_Command_Shell\arm</li>
<li>Copy console.dll to the device&#8217;s Windows folder.</li>
<li>Copy cmd.exe and shell.exe to anywhere on the device e.g. \My Documents.</li>
<li>Edit the following registry key value on the device to be 0 : HKEY_LOCAL_MACHINE\Drivers\Console\OutputTo</li>
<li>From the device&#8217;s File Explorer, just run cmd.exe and the command prompt should start up.</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/whatpaulhaslearnt.wordpress.com/586/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/whatpaulhaslearnt.wordpress.com/586/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/whatpaulhaslearnt.wordpress.com/586/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/whatpaulhaslearnt.wordpress.com/586/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/whatpaulhaslearnt.wordpress.com/586/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/whatpaulhaslearnt.wordpress.com/586/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/whatpaulhaslearnt.wordpress.com/586/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/whatpaulhaslearnt.wordpress.com/586/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/whatpaulhaslearnt.wordpress.com/586/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/whatpaulhaslearnt.wordpress.com/586/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/whatpaulhaslearnt.wordpress.com/586/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/whatpaulhaslearnt.wordpress.com/586/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/whatpaulhaslearnt.wordpress.com/586/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/whatpaulhaslearnt.wordpress.com/586/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=whatpaulhaslearnt.wordpress.com&#038;blog=8255770&#038;post=586&#038;subd=whatpaulhaslearnt&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://whatpaulhaslearnt.wordpress.com/2011/10/20/command-prompt-on-windows-mobile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="https://secure.gravatar.com/avatar/735c480b7d591c311bb406bb6fe80920?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Paul</media:title>
		</media:content>
	</item>
		<item>
		<title>Psion Kiosk for Windows Mobile 6</title>
		<link>https://whatpaulhaslearnt.wordpress.com/2011/10/04/psion-kiosk-for-windows-mobile-6/</link>
		<comments>https://whatpaulhaslearnt.wordpress.com/2011/10/04/psion-kiosk-for-windows-mobile-6/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 12:07:37 +0000</pubDate>
		<dc:creator>Paul Kolozsvari</dc:creator>
				<category><![CDATA[computing]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://whatpaulhaslearnt.wordpress.com/?p=568</guid>
		<description><![CDATA[If you&#8217;re looking for a Windows Mobile 6 Kiosk for your Psion device you can try out the this little Kiosk application I&#8217;ve put together. It allows you to: Lock the device to user in order to restrict the user on the application and web sites he/she can access. Manage which applications the user can &#8230; <a href="https://whatpaulhaslearnt.wordpress.com/2011/10/04/psion-kiosk-for-windows-mobile-6/">Continue reading <span class="meta-nav">&#187;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=whatpaulhaslearnt.wordpress.com&#038;blog=8255770&#038;post=568&#038;subd=whatpaulhaslearnt&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re looking for a Windows Mobile 6 Kiosk for your Psion device you can try out the this little Kiosk application I&#8217;ve put together. It allows you to:</p>
<ul>
<li>Lock the device to user in order to restrict the user on the application and web sites he/she can access.</li>
<li>Manage which applications the user can launch.</li>
<li>Manage which web sites the user can launch. The application has a built in browser through which web sites are launched.</li>
<li>Exiting the Kiosk, managing web sites and applications can only be done after having provided a password.</li>
<li>The user scan view the battery status, display the on screen keyboard and disable/enable the scanner.</li>
</ul>
<div><span style="font-size:small;"><span class="Apple-style-span" style="line-height:24px;">You can download the application from <a title="here" href="http://www.psionafrica.co.za/community/SharedFiles/Download.aspx?pageid=9&amp;mid=24&amp;fileid=18" target="_blank">here</a>. To obtain a license please <a title="contact us" href="http://www.psionafrica.co.za/community/contact.aspx" target="_blank">contact us</a> at Psion Africa.</span></span></div>
<div><span style="font-size:small;"><span class="Apple-style-span" style="line-height:24px;"><br />
</span></span></div>
<div><span style="font-size:small;"><span class="Apple-style-span" style="line-height:24px;"><a href="http://whatpaulhaslearnt.files.wordpress.com/2011/10/01-mainmenu.jpg"><img class="alignleft size-medium wp-image-569" title="01-MainMenu" src="http://whatpaulhaslearnt.files.wordpress.com/2011/10/01-mainmenu.jpg?w=225&h=300" alt="" width="225" height="300" /></a><a href="http://whatpaulhaslearnt.files.wordpress.com/2011/10/02-mainmenuwithkeyboard.jpg"><img class="alignleft size-medium wp-image-570" title="02-MainMenuWithKeyboard" src="http://whatpaulhaslearnt.files.wordpress.com/2011/10/02-mainmenuwithkeyboard.jpg?w=225&h=300" alt="" width="225" height="300" /></a><a href="http://whatpaulhaslearnt.files.wordpress.com/2011/10/03-passwordcapture.jpg"><img class="alignleft size-medium wp-image-571" title="03--PasswordCapture" src="http://whatpaulhaslearnt.files.wordpress.com/2011/10/03-passwordcapture.jpg?w=225&h=300" alt="" width="225" height="300" /></a><a href="http://whatpaulhaslearnt.files.wordpress.com/2011/10/04-managewebsites.jpg"><img class="alignleft size-medium wp-image-572" title="04-ManageWebSites" src="http://whatpaulhaslearnt.files.wordpress.com/2011/10/04-managewebsites.jpg?w=225&h=300" alt="" width="225" height="300" /></a><a href="http://whatpaulhaslearnt.files.wordpress.com/2011/10/05-manageapplications.jpg"><img class="alignleft size-medium wp-image-573" title="05-ManageApplications" src="http://whatpaulhaslearnt.files.wordpress.com/2011/10/05-manageapplications.jpg?w=225&h=300" alt="" width="225" height="300" /></a><a href="http://whatpaulhaslearnt.files.wordpress.com/2011/10/06-browserselectwebsite.jpg"><img class="alignleft size-medium wp-image-574" title="06-BrowserSelectWebSite" src="http://whatpaulhaslearnt.files.wordpress.com/2011/10/06-browserselectwebsite.jpg?w=225&h=300" alt="" width="225" height="300" /></a><a href="http://whatpaulhaslearnt.files.wordpress.com/2011/10/07-browser.jpg"><img class="alignleft size-medium wp-image-575" title="07-Browser" src="http://whatpaulhaslearnt.files.wordpress.com/2011/10/07-browser.jpg?w=225&h=300" alt="" width="225" height="300" /></a><a href="http://whatpaulhaslearnt.files.wordpress.com/2011/10/08-browserfullscreen.jpg"><img class="alignleft size-medium wp-image-576" title="08-BrowserFullScreen" src="http://whatpaulhaslearnt.files.wordpress.com/2011/10/08-browserfullscreen.jpg?w=225&h=300" alt="" width="225" height="300" /></a><a href="http://whatpaulhaslearnt.files.wordpress.com/2011/10/09-app-launcher.jpg"><img class="alignleft size-medium wp-image-577" title="09-App Launcher" src="http://whatpaulhaslearnt.files.wordpress.com/2011/10/09-app-launcher.jpg?w=225&h=300" alt="" width="225" height="300" /></a><a href="http://whatpaulhaslearnt.files.wordpress.com/2011/10/10-status.jpg"><img class="alignleft size-medium wp-image-578" title="10-Status" src="http://whatpaulhaslearnt.files.wordpress.com/2011/10/10-status.jpg?w=225&h=300" alt="" width="225" height="300" /></a><br />
</span></span></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/whatpaulhaslearnt.wordpress.com/568/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/whatpaulhaslearnt.wordpress.com/568/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/whatpaulhaslearnt.wordpress.com/568/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/whatpaulhaslearnt.wordpress.com/568/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/whatpaulhaslearnt.wordpress.com/568/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/whatpaulhaslearnt.wordpress.com/568/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/whatpaulhaslearnt.wordpress.com/568/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/whatpaulhaslearnt.wordpress.com/568/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/whatpaulhaslearnt.wordpress.com/568/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/whatpaulhaslearnt.wordpress.com/568/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/whatpaulhaslearnt.wordpress.com/568/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/whatpaulhaslearnt.wordpress.com/568/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/whatpaulhaslearnt.wordpress.com/568/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/whatpaulhaslearnt.wordpress.com/568/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=whatpaulhaslearnt.wordpress.com&#038;blog=8255770&#038;post=568&#038;subd=whatpaulhaslearnt&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://whatpaulhaslearnt.wordpress.com/2011/10/04/psion-kiosk-for-windows-mobile-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://whatpaulhaslearnt.files.wordpress.com/2011/10/01-mainmenu.jpg?w=112" />
		<media:content url="http://whatpaulhaslearnt.files.wordpress.com/2011/10/01-mainmenu.jpg?w=112" medium="image">
			<media:title type="html">01-MainMenu</media:title>
		</media:content>

		<media:content url="https://secure.gravatar.com/avatar/735c480b7d591c311bb406bb6fe80920?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Paul</media:title>
		</media:content>

		<media:content url="http://whatpaulhaslearnt.files.wordpress.com/2011/10/01-mainmenu.jpg?w=225" medium="image">
			<media:title type="html">01-MainMenu</media:title>
		</media:content>

		<media:content url="http://whatpaulhaslearnt.files.wordpress.com/2011/10/02-mainmenuwithkeyboard.jpg?w=225" medium="image">
			<media:title type="html">02-MainMenuWithKeyboard</media:title>
		</media:content>

		<media:content url="http://whatpaulhaslearnt.files.wordpress.com/2011/10/03-passwordcapture.jpg?w=225" medium="image">
			<media:title type="html">03--PasswordCapture</media:title>
		</media:content>

		<media:content url="http://whatpaulhaslearnt.files.wordpress.com/2011/10/04-managewebsites.jpg?w=225" medium="image">
			<media:title type="html">04-ManageWebSites</media:title>
		</media:content>

		<media:content url="http://whatpaulhaslearnt.files.wordpress.com/2011/10/05-manageapplications.jpg?w=225" medium="image">
			<media:title type="html">05-ManageApplications</media:title>
		</media:content>

		<media:content url="http://whatpaulhaslearnt.files.wordpress.com/2011/10/06-browserselectwebsite.jpg?w=225" medium="image">
			<media:title type="html">06-BrowserSelectWebSite</media:title>
		</media:content>

		<media:content url="http://whatpaulhaslearnt.files.wordpress.com/2011/10/07-browser.jpg?w=225" medium="image">
			<media:title type="html">07-Browser</media:title>
		</media:content>

		<media:content url="http://whatpaulhaslearnt.files.wordpress.com/2011/10/08-browserfullscreen.jpg?w=225" medium="image">
			<media:title type="html">08-BrowserFullScreen</media:title>
		</media:content>

		<media:content url="http://whatpaulhaslearnt.files.wordpress.com/2011/10/09-app-launcher.jpg?w=225" medium="image">
			<media:title type="html">09-App Launcher</media:title>
		</media:content>

		<media:content url="http://whatpaulhaslearnt.files.wordpress.com/2011/10/10-status.jpg?w=225" medium="image">
			<media:title type="html">10-Status</media:title>
		</media:content>
	</item>
		<item>
		<title>Prevent saving Remote Desktop password on Windows CE 6.0</title>
		<link>https://whatpaulhaslearnt.wordpress.com/2011/07/28/prevent-saving-remote-desktop-password-on-windows-ce-6-0/</link>
		<comments>https://whatpaulhaslearnt.wordpress.com/2011/07/28/prevent-saving-remote-desktop-password-on-windows-ce-6-0/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 15:03:55 +0000</pubDate>
		<dc:creator>Paul Kolozsvari</dc:creator>
				<category><![CDATA[computing]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://whatpaulhaslearnt.wordpress.com/?p=564</guid>
		<description><![CDATA[Remote Desktop on Windows CE 6.0 normally provides the user with a checkbox &#8220;Remember my password&#8221;. Since this is a security risk, you can add modify a registry key to disable this option. In the device&#8217;s registry navigate to the followingregistry key and change the value to 1: HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Terminal Services\DisablePasswordSaving ​N.B. This setting only &#8230; <a href="https://whatpaulhaslearnt.wordpress.com/2011/07/28/prevent-saving-remote-desktop-password-on-windows-ce-6-0/">Continue reading <span class="meta-nav">&#187;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=whatpaulhaslearnt.wordpress.com&#038;blog=8255770&#038;post=564&#038;subd=whatpaulhaslearnt&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Remote Desktop on Windows CE 6.0 normally provides the user with a checkbox &#8220;Remember my password&#8221;. Since this is a security risk, you can add modify a registry key to disable this option. In the device&#8217;s registry navigate to the followingregistry key and change the value to 1:</p>
<blockquote><p>HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Terminal Services\DisablePasswordSaving</p></blockquote>
<p>​N.B. This setting only works in Windows CE 6.0 i.e. not any previous versions of Windows CE.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/whatpaulhaslearnt.wordpress.com/564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/whatpaulhaslearnt.wordpress.com/564/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/whatpaulhaslearnt.wordpress.com/564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/whatpaulhaslearnt.wordpress.com/564/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/whatpaulhaslearnt.wordpress.com/564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/whatpaulhaslearnt.wordpress.com/564/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/whatpaulhaslearnt.wordpress.com/564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/whatpaulhaslearnt.wordpress.com/564/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/whatpaulhaslearnt.wordpress.com/564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/whatpaulhaslearnt.wordpress.com/564/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/whatpaulhaslearnt.wordpress.com/564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/whatpaulhaslearnt.wordpress.com/564/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/whatpaulhaslearnt.wordpress.com/564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/whatpaulhaslearnt.wordpress.com/564/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=whatpaulhaslearnt.wordpress.com&#038;blog=8255770&#038;post=564&#038;subd=whatpaulhaslearnt&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://whatpaulhaslearnt.wordpress.com/2011/07/28/prevent-saving-remote-desktop-password-on-windows-ce-6-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="https://secure.gravatar.com/avatar/735c480b7d591c311bb406bb6fe80920?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Paul</media:title>
		</media:content>
	</item>
		<item>
		<title>Using code snippets in Visual Studio</title>
		<link>https://whatpaulhaslearnt.wordpress.com/2011/05/01/using-code-snippets-in-visual-studio/</link>
		<comments>https://whatpaulhaslearnt.wordpress.com/2011/05/01/using-code-snippets-in-visual-studio/#comments</comments>
		<pubDate>Sun, 01 May 2011 12:52:33 +0000</pubDate>
		<dc:creator>Paul Kolozsvari</dc:creator>
				<category><![CDATA[computing]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://whatpaulhaslearnt.wordpress.com/?p=543</guid>
		<description><![CDATA[I&#8217;ve always been a bit of a sucker for punishment when it comes to writing repetitive code. So I finally decided to look at using code snippets in Visual Studio. One common repetitive task I always go through is surrounding my code in regions e.g. using directive, methods, event handlers, properties etc. Using code snippets &#8230; <a href="https://whatpaulhaslearnt.wordpress.com/2011/05/01/using-code-snippets-in-visual-studio/">Continue reading <span class="meta-nav">&#187;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=whatpaulhaslearnt.wordpress.com&#038;blog=8255770&#038;post=543&#038;subd=whatpaulhaslearnt&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve always been a bit of a sucker for punishment when it comes to writing repetitive code. So I finally decided to look at using code snippets in Visual Studio. One common repetitive task I always go through is surrounding my code in regions e.g. using directive, methods, event handlers, properties etc. Using code snippets Intellisense and shortcuts I can insert regions effortlessly.</p>
<p>Basic steps:</p>
<ul>
<li>Download and install the <a title="http://snippetdesigner.codeplex.com/" href="Snippet Designer" target="_blank">Snippet Designer</a> to make your life easier.</li>
<li>Create snippet files either manually or using the Snippet Designer. These are simply XML files with the .snippet extension.</li>
<li>Import them into the Code Snippets Manager in Visual Studio or simply point it to a folder containing the snippet files.</li>
<li>Use the snippets in your code.</li>
</ul>
<p>Suppose you a snippet of code for creating a region to surround your methods. Something like this:</p>
<p><pre class="brush: csharp;">
#region Methods        


#endregion //Methods
</pre></p>
<p>The easiest way is to just modify the existing region snippet that comes with Visual Studio:</p>
<ul>
<li>Open the Code Snippets Manager from the Tools menu in Visual Studio.</li>
<li>I&#8217;m using C#, I would select C# from the language drop-down.</li>
<li>Expand the C# node and look and select &#8220;#region&#8221;.</li>
<li>Navigate to the path displayed in the &#8220;Location&#8221; text box.</li>
<li>Create another folder on your machine and copy and paste the pp_region.snippet file into it.</li>
<li>Rename the file to something like region_methods.snippet.</li>
<li>Open it in Visual Studio. If you&#8217;ve installed Snippet Designer. It will open the designer for the snippet. otherwise it will open it in the XML editor.</li>
<li>Using the Snippet Designer change the name of the snippet at the top of the designer window to &#8220;methods region&#8221;.</li>
<li>Using the Snippet designer change the snippet code to:</li>
</ul>
<p><pre class="brush: csharp;">
#region $name$

$selected$ $end$

#endregion //$name$
</pre></p>
<ul>
<li>I always like to add the region name as a comment after the #endregion directive so that when I&#8217;m browsing through code and see the end of a region I know exactly which region it is without having to scroll to the top of if. If you look at the above snippet, any variable is enclosed in $ signs. At the bottom of the designer you can set the &#8220;Defaults to&#8221; value to &#8220;Methods&#8221;. This ensures that $name$ is replaced with the default value. When you insert the snippet in your you&#8217;ll also notice that as you&#8217;re typing the name of the region, the comment after #endregion also changes to match the name at the same time.</li>
<li>If you look under the Properties Window you&#8217;ll notice the Snippet Type property. It should be set to &#8220;SurroundsWith&#8221;. This ensures that if you select code in an editor and right click the selection and click &#8220;Surround With&#8221; and then a specific snippet like the we&#8217;re creating it will actually insert the selection within the snippet i.e. this is also achieved using the $selected$ variable you see in the snippet code.</li>
<li>Also in the Properties Window change the &#8220;Author&#8221; and &#8220;Description&#8221;. In the description will be shown in the IntelliSense.</li>
<li>Should you also want specific references to added to your project upon insertion of the snippet, you can add these references on the &#8220;References&#8221; property.</li>
<li>Lastly change the &#8220;Shortcut&#8221; property to &#8220;regm&#8221;. This shortcut name will appear when scrolling through the IntelliSense.</li>
</ul>
<div>Also note that any of the above modifications can also be done by editing the .snippet file in a text or XML editor. Now that you have created your snippet you simply need to point the Visual Studio Code Snippet Manager to it:</div>
<div>
</br></p>
<ul>
<li>Open the Code Snippet Manager from the Tools menu.</li>
<li>Select the C# language.</li>
<li>Select &#8220;Add&#8221; and browse to the folder containing your new snippet.</li>
<li>Alternatively you could click &#8220;Import&#8221; browse to and select your .snippet files and then select which node you&#8217;d like to import them to.</li>
</ul>
<div>The last thing to do now is simply use the snippet in your code. In the code editor type &#8220;remg&#8221; and in you&#8217;ll notice that it appears in the IntelliSense allong with the description. To use it just hit the twice. The name of the namespace is highlighted because it maps to the $name$ variable we used. As you change the name you can see that the comment after the @endregion directive also changes. Once you hit enter, the highlighting goes away. What you could also do is select a few methods or any code for that and then right click and click &#8220;Surround With &#8230;&#8221; and then navigate through the IntelliSense to the code snippet and hit enter. The selected code will then be surrounded by the region snippet. If you&#8217;re like me and hate the mouse, then instead of right clicking the selection you could also use the Ctrl+K, Ctrl+S shortcut to cause the snippet IntelliSense to popup.</div>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/whatpaulhaslearnt.wordpress.com/543/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/whatpaulhaslearnt.wordpress.com/543/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/whatpaulhaslearnt.wordpress.com/543/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/whatpaulhaslearnt.wordpress.com/543/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/whatpaulhaslearnt.wordpress.com/543/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/whatpaulhaslearnt.wordpress.com/543/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/whatpaulhaslearnt.wordpress.com/543/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/whatpaulhaslearnt.wordpress.com/543/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/whatpaulhaslearnt.wordpress.com/543/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/whatpaulhaslearnt.wordpress.com/543/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/whatpaulhaslearnt.wordpress.com/543/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/whatpaulhaslearnt.wordpress.com/543/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/whatpaulhaslearnt.wordpress.com/543/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/whatpaulhaslearnt.wordpress.com/543/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=whatpaulhaslearnt.wordpress.com&#038;blog=8255770&#038;post=543&#038;subd=whatpaulhaslearnt&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://whatpaulhaslearnt.wordpress.com/2011/05/01/using-code-snippets-in-visual-studio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="https://secure.gravatar.com/avatar/735c480b7d591c311bb406bb6fe80920?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Paul</media:title>
		</media:content>
	</item>
		<item>
		<title>NUnit Sequencer tool to sequence (run ordered) NUnit tests and fixtures by setting attributes</title>
		<link>https://whatpaulhaslearnt.wordpress.com/2011/04/28/nunit-sequencer-tool-to-sequenceorder-nunit-tests-and-fixtures-by-setting-attributes/</link>
		<comments>https://whatpaulhaslearnt.wordpress.com/2011/04/28/nunit-sequencer-tool-to-sequenceorder-nunit-tests-and-fixtures-by-setting-attributes/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 21:31:35 +0000</pubDate>
		<dc:creator>Paul Kolozsvari</dc:creator>
				<category><![CDATA[computing]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://whatpaulhaslearnt.wordpress.com/?p=528</guid>
		<description><![CDATA[I&#8217;ve been using the unit testing framework part of Visual Studio for a while and well &#8230; it&#8217;s not bad. I decided though to change over to NUnit. I find it a whole lot easier to use and setup. Not to mention the green and red bubbles, I love that, it looks pretty cool. However &#8230; <a href="https://whatpaulhaslearnt.wordpress.com/2011/04/28/nunit-sequencer-tool-to-sequenceorder-nunit-tests-and-fixtures-by-setting-attributes/">Continue reading <span class="meta-nav">&#187;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=whatpaulhaslearnt.wordpress.com&#038;blog=8255770&#038;post=528&#038;subd=whatpaulhaslearnt&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using the unit testing framework part of Visual Studio for a while and well &#8230; it&#8217;s not bad. I decided though to change over to NUnit. I find it a whole lot easier to use and setup. Not to mention the green and red bubbles, I love that, it looks pretty cool. However using the VS unit testing framework, I got used to being able to order/sequence my tests. Now, I know many people will say that in theory your tests should actually be able to to run independently i.e. if one fails it shouldn&#8217;t cause another to fail. Fair enough, but that means allot more work in certain cases.</p>
<p>Call me a bad programmer, shoot me if you want, but I decided to look at ways of being able to set the sequence/order in which my text fixtures and tests run. Initially I thought of downloading the <a title="NUnit source code" href="http://www.nunit.org/?p=download" target="_blank">NUnit source code</a> and modifying it to use some sort of config file through which I set the sequence. The problem with this approach is twofold in my opinion. Firstly if a new release of NUnit comes out and they still decide not to include functionality for ordering of tests, but they do include some worthwhile new features, I&#8217;ll then have to reimplement the sequencing code, or at least copy and paste some code. Secondly, I don&#8217;t want some config file to set the sequence. That would mean I&#8217;d have to modify it every time I added another test, hitting alt-tab a million times etc. In short I basically wanted a way of simply setting the sequence in the source code, while I was coding.</p>
<p>NUnit actually runs tests in alphabetical order. So if you prefix every test with a number, such as _01_, _02_ etc., then you could effectively set a sequence to your tests. That&#8217;s allot of manual editing though. Not to mention that if you decide to add a test somewhere in the middle of the sequence, you&#8217;d have rename half your tests/fixtures. So what I&#8217;ve developed is a small library that just includes two attributes that can used to decorate your assembly and test fixtures, where you specify the sequence of your tests. I then built a small console app that can be called by setting a post-build event command on your test suite&#8217;s project. Once it runs it loads your built assembly and using Reflection it searches for the above attributes. Using <a title="Mono.Cecil" href="http://www.mono-project.com/Cecil" target="_blank">Mono.Cecil</a> the app then modifies the test fixture and test method names by prefixing them according to the specified sequence and then simply writes the new assembly to file. You then load it into NUnit and you&#8217;ll see the tests appear in the sequence you set through the attributes. Alright, so let me take you through it.</p>
<p>Firstly download the NUnit.Sequence assemblies from here: <a title="http://www.mediafire.com/?359rqn16f5lzx84" href="http://www.mediafire.com/?359rqn16f5lzx84" target="_blank">http://www.mediafire.com/?359rqn16f5lzx84</a></p>
<p>Suppose you have a library containing four methods performing basic arithmetic calculations:</p>
<p><pre class="brush: csharp;">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SampleLibrary
{
    public class Arithmetic
    {
        public double Add(double x, double y)
        {
            return x + y;
        }

        public double Subtract(double x, double y)
        {
            return x - y;
        }

        public double Multiply(double x, double y)
        {
            return x * y;
        }

        public double Divide(double x, double y)
        {
            return x / y;
        }
    }
}
</pre></p>
<p>You then write two text fixtures (for argument&#8217;s sake) to test the above methods:</p>
<ul>
<li>ArithmeticTests1 : containing test methods : SubtractTest &amp; AddTest</li>
<li>ArithmeticTests2 : containing test methods : MultiplyTest &amp; DivideTest</li>
</ul>
<div>
<p>If you run these tests, NUnit will run test fixture ArithmeticTests1 first and then ArithmeticTests 2. In the first it will run AddTest first and then SubtractTest. On the second test fixture it will run DivideTest followed by MultiplyTest. Suppose you want to change the sequence:</p>
<div>
<ul>
<li>Start by adding a reference to the NUnit.Sequencer.Coding.dll in your test suite project.</li>
<li>To set ArithmeticTests2 to run first followed by ArithmeticTests1, expand the Properties folder in the Solution Explorer and open AssemblyInfo.cs. In this file add a SequencedTestAssembly attribute by specifying in its constructor the test fixture types&#8217; full names (namespace included) according to the order in which you&#8217;d like them to run. The attribute&#8217;s constructor takes the names using the params keyword i.e. an array of strings.</li>
</ul>
</div>
<p><pre class="brush: csharp;">
[assembly: SequencedTestAssembly(&quot;NUnit.TestSuite.ArithmeticTests2&quot;, &quot;NUnit.TestSuite.ArithmeticTests1&quot;)]
</pre></p>
<ul>
<li>Now in each of your text fixtures, add a SequencedTestFixture attribute to the class declaration by specifying in the attribute&#8217;s constructor the test method names which you&#8217;d like to sequence in the order in which you want them to run. Here&#8217;s the source code for the two text fixtures:</li>
</ul>
<p><pre class="brush: csharp;">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using SampleLibrary;
using NUnit.Sequencer.Coding;

namespace NUnit.TestSuite
{
    [TestFixture]
    [SequencedTestFixture(&quot;DivideTest&quot;, &quot;MultiplyTest&quot;)]
    public class ArithmeticTests2
    {
        private double _x;
        private double _y;
        private double _expected;
        private Arithmetic _arithmetic;

        [TestFixtureSetUp]
        public void Setup()
        {
            _x = 10;
            _y = 2;
            _arithmetic = new Arithmetic();
        }

        [Test]
        public void MultiplyTest()
        {
            _expected = _x * _y;
            Assert.IsTrue(_arithmetic.Multiply(_x, _y) == _expected);
        }

        [Test]
        public void DivideTest()
        {
            _expected = _x / _y;
            Assert.IsTrue(_arithmetic.Divide(_x, _y) == _expected);
        }
    }
}
</pre></p>
<p><pre class="brush: csharp;">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using SampleLibrary;
using NUnit.Sequencer.Coding;

namespace NUnit.TestSuite
{
    [TestFixture]
    [SequencedTestFixture(&quot;SubtractTest&quot;, &quot;AddTest&quot;)]
    public class ArithmeticTests1
    {
        private double _x;
        private double _y;
        private double _expected;
        private Arithmetic _arithmetic;

        [TestFixtureSetUp]
        public void Setup()
        {
            _x = 10;
            _y = 2;
            _arithmetic = new Arithmetic();
        }

        [Test]
        public void SubtractTest()
        {
            _expected = _x - _y;
            Assert.IsTrue(_arithmetic.Subtract(_x, _y) == _expected);
        }

        [Test]
        public void AddTest()
        {
            _expected = _x + _y;
            Assert.IsTrue(_arithmetic.Add(_x, _y) == _expected);
        }
    }
}
</pre></p>
<ul>
<li>You can also download the source code for this example here: <a title="http://www.mediafire.com/?e66ddg87kjbjs5x" href="http://www.mediafire.com/?e66ddg87kjbjs5x" target="_blank">http://www.mediafire.com/?e66ddg87kjbjs5x</a></li>
<li>Copy the NUnit.Sequencer.exe (console app) and Mono.Cecil.dll files to the bin directory of the test suite&#8217;s project. You could also just add them to your project and set the &#8220;Copy to Output Directory&#8221; property of the files to &#8220;Copy if newer&#8221;. This will copy them automatically to the bin directory upon building the project.</li>
<li>To get NUnit.Sequencer.exe to run after a build, right click the test suite project and then click &#8220;Properties&#8221; On the &#8220;Build Events&#8221; tab, copy and paste the following command:</li>
</ul>
<blockquote>
<div><span style="font-size:small;"><span class="Apple-style-span" style="line-height:24px;">NUnit.Sequencer.exe $(TargetPath)</span></span></div>
</blockquote>
<div>
<ul>
<li>Build the project.</li>
<li>Once built, you should find a newly created assembly in your bin directory with the name of your original test suite dll&#8217;s name with a .SEQUENCE suffix appended to it e.g. {assembly name}.SEQUENCE.dll</li>
<li>Lastly, open the new assembly in NUnit and the test suite should look as follows:</li>
</ul>
<div><span style="font-size:small;"><span class="Apple-style-span" style="line-height:24px;"><a href="http://whatpaulhaslearnt.files.wordpress.com/2011/04/nunit-sequencer-example-screen.jpg"><img class="alignleft size-full wp-image-533" title="NUnit.Sequencer.Example.Screen" src="http://whatpaulhaslearnt.files.wordpress.com/2011/04/nunit-sequencer-example-screen.jpg?w=750" alt=""   /></a></span></span></div>
<div><span style="font-size:small;"><span class="Apple-style-span" style="line-height:24px;"><br />
</span></span></div>
</div>
</div>
<p>In case for whatever reason NUnit.Sequencer.exe doesn&#8217;t execute correctly you could also run it from the command prompt to see where its execution stops e.g. you may have mistyped a test fixture type or method name.</p>
<p><a href="http://whatpaulhaslearnt.files.wordpress.com/2011/04/nunit-sequencer-example-console-screen.jpg"><img class="alignleft size-full wp-image-532" title="NUnit.Sequencer.Example.Console.Screen" src="http://whatpaulhaslearnt.files.wordpress.com/2011/04/nunit-sequencer-example-console-screen.jpg?w=750&h=346" alt="" width="750" height="346" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/whatpaulhaslearnt.wordpress.com/528/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/whatpaulhaslearnt.wordpress.com/528/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/whatpaulhaslearnt.wordpress.com/528/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/whatpaulhaslearnt.wordpress.com/528/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/whatpaulhaslearnt.wordpress.com/528/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/whatpaulhaslearnt.wordpress.com/528/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/whatpaulhaslearnt.wordpress.com/528/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/whatpaulhaslearnt.wordpress.com/528/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/whatpaulhaslearnt.wordpress.com/528/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/whatpaulhaslearnt.wordpress.com/528/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/whatpaulhaslearnt.wordpress.com/528/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/whatpaulhaslearnt.wordpress.com/528/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/whatpaulhaslearnt.wordpress.com/528/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/whatpaulhaslearnt.wordpress.com/528/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=whatpaulhaslearnt.wordpress.com&#038;blog=8255770&#038;post=528&#038;subd=whatpaulhaslearnt&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://whatpaulhaslearnt.wordpress.com/2011/04/28/nunit-sequencer-tool-to-sequenceorder-nunit-tests-and-fixtures-by-setting-attributes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="https://secure.gravatar.com/avatar/735c480b7d591c311bb406bb6fe80920?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Paul</media:title>
		</media:content>

		<media:content url="http://whatpaulhaslearnt.files.wordpress.com/2011/04/nunit-sequencer-example-screen.jpg" medium="image">
			<media:title type="html">NUnit.Sequencer.Example.Screen</media:title>
		</media:content>

		<media:content url="http://whatpaulhaslearnt.files.wordpress.com/2011/04/nunit-sequencer-example-console-screen.jpg" medium="image">
			<media:title type="html">NUnit.Sequencer.Example.Console.Screen</media:title>
		</media:content>
	</item>
		<item>
		<title>Consuming a .NET web service from a BlackBerry native application using the Java ME Platform SDK 3.0</title>
		<link>https://whatpaulhaslearnt.wordpress.com/2011/04/19/consuming-a-net-web-service-from-a-blackberry-native-application-using-the-java-me-platform-sdk-3/</link>
		<comments>https://whatpaulhaslearnt.wordpress.com/2011/04/19/consuming-a-net-web-service-from-a-blackberry-native-application-using-the-java-me-platform-sdk-3/#comments</comments>
		<pubDate>Tue, 19 Apr 2011 08:16:08 +0000</pubDate>
		<dc:creator>Paul Kolozsvari</dc:creator>
				<category><![CDATA[computing]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://whatpaulhaslearnt.wordpress.com/?p=508</guid>
		<description><![CDATA[One of the first things I wanted to get right once I got my BlackBerry development environment setup using the BlackBerry JDE, was to be able consume a .NET web service or any other web service for that matter. Unfortunately there doesn&#8217;t seem to be any support for web services in the BlackBerry APIs. I &#8230; <a href="https://whatpaulhaslearnt.wordpress.com/2011/04/19/consuming-a-net-web-service-from-a-blackberry-native-application-using-the-java-me-platform-sdk-3/">Continue reading <span class="meta-nav">&#187;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=whatpaulhaslearnt.wordpress.com&#038;blog=8255770&#038;post=508&#038;subd=whatpaulhaslearnt&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One of the first things I wanted to get right once I got my BlackBerry development environment setup using the BlackBerry JDE, was to be able consume a .NET web service or any other web service for that matter. Unfortunately there doesn&#8217;t seem to be any support for web services in the BlackBerry APIs. I found a couple of different methods of consuming web services, but they either seem too difficult to implement or a steep price tag was attached. So I ended up doing it by using the Java ME Platform SDK 3.0. Anyway let&#8217;s get started.</p>
<p>Firstly you&#8217;ll need to build a simple .NET (SOAP) web service that has two methods. One to retrieve the server&#8217;s hostname and the other returns the current date and time on the server. I won&#8217;t go into detail on the steps required to develop this service as it&#8217;s pretty basic if you&#8217;re familiar with .NET. This is what the service code looks like:</p>
<p><pre class="brush: csharp;">&lt;br /&gt;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Diagnostics;

namespace SampleNetService
{
    /// &lt;summary&gt;
    /// Summary description for Service1
    /// &lt;/summary&gt;
    [WebService(Namespace = &quot;http://tempuri.org/&quot;)]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class Service : System.Web.Services.WebService
    {
        [WebMethod]
        public string GetHostname()
        {
            return Environment.MachineName;
        }

        [WebMethod]
        public string GetServerDateTime()
        {
            return string.Format(&quot;Server Time: {0}&quot;, DateTime.Now.ToString());
        }
    }
}
</pre></p>
<p>The URL to the service on my machine is http://localhost/SampleNetService/Service.asmx.</p>
<p>I you&#8217;ve ever consumed a web service using a .NET client application, you&#8217;ll know that you normally just add a web reference on the project and Visual Studio automatically generates the stub classes which you can use on the client application i.e. the web service proxy. The first approach I came across is to use the KSoap libraries, but the implementation code looks incredibly verbose and it doesn&#8217;t look like there is anyway to generate the classes. Instead you pretty much have to code everything yourself (specifying the parameters, URL, method names etc.) and the libraries just handle the communication for you. If you&#8217;re interested in this approach you can have a look this tutorial on the subject:</p>
<ul>
<li><a title="BlackBerry and .NET Web Service Tutorial - Part 1" href="http://craigagreen.com/index.php?/Blog/blackberry-and-net-webservice-tutorial-part-1.html" target="_blank">BlackBerry and .NET Web Service Tutorial &#8211; Part 1</a></li>
<li><a title="BlackBerry and .NET Web Service Tutorial - Part 2" href="http://craigagreen.com/index.php?/Blog/blackberry-and-net-web-service-tutorial-part-2.html" target="_blank">BlackBerry and .NET Web Service Tutorial &#8211; Part 2</a></li>
<li><a title="BlackBerry and .NET Web Service Tutorial - Part 3" href="http://www.craigagreen.com/index.php?/Blog/blackberry-and-net-webservice-tutorial-it-works-part-3.html" target="_blank">BlackBerry and .NET Web Service Tutorial &#8211; Part 3</a></li>
</ul>
<p>I did find what seems to be a great API for generating stubs and consuming web services called WSClient++, which you can download from <a title="http://wsclient.neurospeech.com/" href="http://wsclient.neurospeech.com/" target="_blank">http://wsclient.neurospeech.com/</a>. Unfortunately it&#8217;s a little too expensive for my liking. They have a demo version, but they limit you on accessing only two web services per project and being able to call (generate stubs for) only two web service methods.</p>
<p>So instead I opted for using the Java ME Platform SDK 3.0 to generate the stubs. It&#8217;s surprisingly easy and it just works. Firstly, download and install it from <a title="http://www.oracle.com/technetwork/java/javame/downloads/sdk30-jsp-139759.html" href="http://www.oracle.com/technetwork/java/javame/downloads/sdk30-jsp-139759.html" target="_blank">http://www.oracle.com/technetwork/java/javame/downloads/sdk30-jsp-139759.html</a>. You can of course achieve the same result using the the Java Wireless Toolkit 2.5.2 which is the predecessor to the Java ME Platform SDK, which can be downloaded from <a title="http://www.oracle.com/technetwork/java/download-135801.html" href="http://www.oracle.com/technetwork/java/download-135801.html" target="_blank">http://www.oracle.com/technetwork/java/download-135801.html</a>. If you&#8217;re interested in the nitty-gritty behind J2ME web services and consuming them, then have a look at this article <a title="http://developers.sun.com/mobility/apis/articles/wsa/" href="http://developers.sun.com/mobility/apis/articles/wsa/" target="_blank">http://developers.sun.com/mobility/apis/articles/wsa/</a>.</p>
<p>Once you&#8217;ve gotten it in installed, navigate to the bin folder of your installation directory. On my machine it&#8217;s C:\Java_ME_platform_SDK_3.0\bin. The command line tool we&#8217;re going to use is wscompile.exe. To run the tool you&#8217;ll need to create a small config file which you&#8217;ll pass as an argument to wscompile.exe. So in this directory create a config.xml with the following contents:</p>
<p><pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;configuration xmlns=&quot;http://java.sun.com/xml/ns/jax-rpc/ri/config&quot;&gt;
  &lt;wsdl location=&quot;http://10.120.6.24/SampleNetService/Service.asmx?wsdl&quot; packageName=&quot;rpcdemo&quot; /&gt;
&lt;/configuration&gt;
</pre></p>
<p>In the wsdl element you&#8217;ll need to set the location to the URL of your web service including the ?wsdl suffix (which generates the wsdl file), as well as the packageName attribute. Also notice that in the URL I replaced localhost with the address of my machine hosting the web service. The reason being that the generated stubs will contain the URL which the device application will be pointed to. Therefore using localhost in the client application will result in it not being able to access the URL. You could obviously use the hostname of your machine instead of the IP address, provided that it will be able to resolve it. The package name corresponds to the package which will contain the generated stub classes.</p>
<p>Now from command prompt, navigate to the above directory and run the following command:</p>
<blockquote><p>wscompile.exe -gen -cldc1.1 config.xml</p></blockquote>
<p>After having run the command you should find a subdirectory in the bin directory named after the package name you specified in the config file. In my case it&#8217;s rpcdemo. If you get an error that it cannot parse the config file it&#8217;s because for whatever reason the tool does not recognize UTF-8 encoding. If you then in command prompt enter the following command to see the contents of the config.xml file, you&#8217;ll probably notice that there are some strange characters preceding the first line in the file:</p>
<blockquote><p>type config.xml</p></blockquote>
<p>To fix the issue, make sure that you create the config.xml file using a regular text editor as opposed to an XML editor.</p>
<p>Now let&#8217;s develop the BlackBerry application. Open the BlackBerry JDE and create a new workspace. Then create a new project in the workspace. We&#8217;ll now need to create a class extending MainScreen on which we&#8217;ll place two labels to display the info retrieved from the web service as well a button which initiates and performs the web service calls. We also need a class that extends UiApplication, which will push (display) the screen with the controls onto the screen stack. Separate packages aren&#8217;t strictly necessary, but in my example I create two separate packages to store these two classes in i.e. core (for the UiApplication) and ui (for the screen). So for each of the above two classes, right click the project and select Create new File in Project and append a subdirectory name to the path corresponding to the package you want created i.e. core or ui. The java files I&#8217;ve created for the screen and UiApplication are GetServerDateScreen.java (ui package) and  NetServiceBBConsumerApp.java (core package) respectively.</p>
<p>Open the NetServiceBBConsumerApp.java, clear the code in it and paste the following code:</p>
<p><pre class="brush: java;">&lt;/p&gt;
/*
 * NetServiceBBConsumerApp.java
 *
 * © &lt;your company here&gt;, &lt;year&gt;
 * Confidential and proprietary.
 */

package core;

import net.rim.device.api.ui.*;
import ui.*;

/**
 * 
 */
public class NetServiceBBConsumerApp extends UiApplication
{
    public static void main(String[] args)
    {
        NetServiceBBConsumerApp app = new NetServiceBBConsumerApp();
        app.enterEventDispatcher();
    }
    
    NetServiceBBConsumerApp()
    {
    }
    
    public void activate()
    {
        if(getScreenCount() == 0)
        {
            //This is the first time the activate method has been called by the event dispatcher i.e. the app has just started up.
            this.pushScreen(new ui.GetServerDateScreen());   
        }
        else
        {
            //The application has just been reactivated e.g. the user might have switched to a different application deactivating this one and then switched back to this application.
            updateDisplay();
        }
    }
}
</pre></p>
<p>In the application&#8217;s entry method, main(String[] args), we create a new NetServiceBBConsumerApp which extends UiApplication. We then override the application&#8217;s activate function. This method gets called either when the application gets started or when perhaps a user navigates away from our application (by opening another application or taking a phone call) and then returns to our application. In this function we then check whether the application has just been launched (no screens exist on the stack yet) or whether the application has just been reactivated after another app has been closed (screens already exist on the stack). If this is a fresh start up of the appliation we create a new GetServerDateScreen (which contains our controls/fields) and push it onto the screen stack. If you&#8217;ve ever done .NET Compact Framework development or Windows Forms, you can think if this class as the Program class containing the main method that starts up the main form. Also notice that we&#8217;re importing the ui package at the top. Otherwise if this is a reactivation, we just call updateDisplay() which will refresh the device&#8217;s display for all the screens in the application.</p>
<p>In the GetServerDateScreen.java file, clear the code in it and paste the following code:</p>
<p><pre class="brush: java;">
package ui;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import rpcdemo.*;

public class GetServerDateScreen extends MainScreen
{
    LabelField lblServerHostname = new LabelField(&quot;&quot;, LabelField.FIELD_LEFT);
    LabelField lblServerDate = new LabelField(&quot;&quot;, LabelField.FIELD_LEFT);
    ButtonField btnGetServerInfo = new ButtonField(&quot;Get Server Info&quot;, ButtonField.CONSUME_CLICK)
    {
        protected boolean navigationClick(int status, int time)
        {
            GetServerInfo();
            return true;
        }
    }
    public GetServerDateScreen()
    {
        setTitle(&quot;Current Server Date&quot;);
        add(lblServerHostname);
        add(lblServerDate);
        add(btnGetServerInfo);
    }

    public boolean onClose()
    {
        System.exit(0);
        return true;
    }

    public void GetServerInfo()
    {
        try
        {
            ServiceSoap_Stub service = new ServiceSoap_Stub();
            String serverHostname = service.getHostname();
            String serverDateTime = service.getServerDateTime();
            lblServerHostname.setText(serverHostname);                             lblServerDate.setText(serverDateTime);
        }
        catch(Exception e)
        {
            Dialog.alert(e.getMessage());
        }
    }
}
</pre></p>
<p>Here we basically create the two labels and a button on which we override its navigationClick method. This method gets called when the button gets clicked. So we handle this event by calling the GetServerInfo method which simply instantiates the ServiceSoap_Stub class that we generated earlier and calls the appropriate web service methods to retrieve the server&#8217;s hostname and date. Thereafter we display the results on the two labels. On this screen&#8217;s constructor we add the controls/fields to the screen.</p>
<p>The generated web service stub classes need to be imported into the project before we can build it. Copy the rpcdemo directory from C:\Java_ME_platform_SDK_3.0\bin to the your project&#8217;s directory. To import them, right click the project and select Add File to Project. Navigate to the project&#8217;s rpcdemo subdirectory and select all the java files in it. In this example there should be six of them. The project&#8217;s file structure should look as follows:</p>
<div id="attachment_512" class="wp-caption alignleft" style="width: 313px"><a href="http://whatpaulhaslearnt.files.wordpress.com/2011/04/bbdemo1.jpg"><img class="size-full wp-image-512" title="BlackBerry JDE demo file structure" src="http://whatpaulhaslearnt.files.wordpress.com/2011/04/bbdemo1.jpg?w=750" alt="BlackBerry JDE demo file structure"   /></a><p class="wp-caption-text">BlackBerry JDE demo file structure</p></div>
<p>If you open the ServiceSoap_Stub class, in its constructor you&#8217;ll notice the URL you specified in the config file. So if the location of the service ever changes this is where you can change the URL before rebuilding the mobile application. One very important thing to remember is that an application will by default try to connect to via MDS. So although you might find that it can connect to the web service on an emulator, it will fail to connect once deployed on the device if the device is not connected to the MDS. Therefore, you need to specify in your code whether to use MDS, a straight GPRS connection via your service provider or a connection via WiFi. You do this by appending a connection string to the end of your web service URL in the ServiceSoap_Stub&#8217;s constructor. For example to force a WiFi connection you would append &#8220;;interface=wifi&#8221;. For a straight GPRS connection, you would append &#8220;;deviceside=true&#8221;. Here&#8217;s a method you can include in your code that generates and appends the correct connection string to your URL depending on whether an MDS or WiFi connection is available, otherwise a straight GPRS connection.</p>
<p><pre class="brush: java;">
    // Determines what connection type to use and returns the necessary string to use it.
    // @return A string with the connection info
    public static String getConnectionString(String connectionString)
    {
        // This code is based on the connection code developed by Mike Nelson of AccelGolf.
        // http://blog.accelgolf.com/2009/05/22/blackberry-cross-carrier-and-cross-network-http-connection                 

        // Simulator behavior is controlled by the USE_MDS_IN_SIMULATOR variable.
        if(DeviceInfo.isSimulator())
        {
            //Dialog.alert(&quot;Device is a simulator and USE_MDS_IN_SIMULATOR is false&quot;);
            connectionString += &quot;;deviceside=true&quot;;                
        }                               

        // Wifi is the preferred transmission method
        else if( (WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED) &amp;&amp; RadioInfo.areWAFsSupported(RadioInfo.WAF_WLAN))
        {
            //Dialog.alert(&quot;Device is connected via Wifi.&quot;);
            connectionString += &quot;;interface=wifi&quot;;
        }

        // Is the carrier network the only way to connect?
        else if((CoverageInfo.getCoverageStatus() &amp; CoverageInfo.COVERAGE_DIRECT) == CoverageInfo.COVERAGE_DIRECT)
        {   
            //Dialog.alert(&quot;Carrier coverage.&quot;);
            String carrierUid = getCarrierBIBSUid();
            if(carrierUid == null)
            {
                // Has carrier coverage, but not BIBS.  So use the carrier's TCP network
                //Dialog.alert(&quot;No Uid&quot;);
                connectionString += &quot;;deviceside=true&quot;;
            }
            else
            {
                // otherwise, use the Uid to construct a valid carrier BIBS request
                //Dialog.alert(&quot;uid is: &quot; + carrierUid);
                connectionString += &quot;;deviceside=false;connectionUID=&quot;+carrierUid + &quot;;ConnectionType=mds-public&quot;;
            }
        }                

        // Check for an MDS connection instead (BlackBerry Enterprise Server)
        else if((CoverageInfo.getCoverageStatus() &amp; CoverageInfo.COVERAGE_MDS) == CoverageInfo.COVERAGE_MDS)
        {
            //Dialog.alert(&quot;MDS coverage found&quot;);
            connectionString += &quot;;deviceside=false&quot;;
        }

        // If there is no connection available abort to avoid bugging the user unnecssarily.
        else if(CoverageInfo.getCoverageStatus() == CoverageInfo.COVERAGE_NONE)
        {
            //Dialog.alert(&quot;There is no available connection.&quot;);
        }

        // In theory, all bases are covered so this shouldn't be reachable.
        else
        {
            //Dialog.alert(&quot;no other options found, assuming device.&quot;);
            connectionString += &quot;;deviceside=true&quot;;
        }        

        return connectionString;
    }
    
    // Looks through the phone's service book for a carrier provided BIBS network
    // @return The uid used to connect to that network.
    private static String getCarrierBIBSUid()
    {
        ServiceRecord[] records = ServiceBook.getSB().getRecords();
        int currentRecord;
        for(currentRecord = 0; currentRecord &lt; records.length; currentRecord++)
        {
            if(records[currentRecord].getCid().toLowerCase().equals(&quot;ippp&quot;))
            {
                if(records[currentRecord].getName().toLowerCase().indexOf(&quot;bibs&quot;) &gt;= 0)
                {
                    return records[currentRecord].getUid();
                }
            }
        }
        return null;
   }
</pre></p>
<p>Once you&#8217;ve built the project, using a command prompt window navigate to the project&#8217;s folder and there should find a new COD file. This is the BlackBerry executable that needs to be deployed to the device. To deploy, run the following command after connecting the device via a USB to the machine:</p>
<blockquote><p>javaloader -usb load NetServiceBBConsumer.cod</p></blockquote>
<p>On the device you need to set the permissions for the application by clicking Menu &gt; Options &gt; Applications, selecting the application and making sure every field is set to allow.</p>
<p>Next we need to configure the device to connect to the WiFi, test the connectivity with your machine and web service and lastly test the application.</p>
<p>WiFi:</p>
<ul>
<li>Enable WiFi on the device by clicking Menu -&gt; Manage Connections and checking the WiFi checkbox.</li>
<li>In the same pop up menu select Wi-Fi Options.</li>
<li>To connect to a specific WiFi AP (Access Point), click Menu &gt; New and then Scan For Networks.</li>
<li>Select your WiFi network/AP and enter all the relevant wireless settings for your AP i.e. security type, key etc. and then click Connect.</li>
</ul>
<p>Test the connectivity to the server (your development machine) and web service:</p>
<ul>
<li>Click Menu &gt; Manage Connections &gt; Wi-Fi Options &gt; Menu &gt; Wi-Fi Tools</li>
<li>Select Wi-Fi Diagnostics from above available tools menu to ensure you&#8217;re connected to the correct WiFi network and view your IP Address.</li>
<li>From your machine try pinging your device with the above IP address.</li>
<li>From the device select the Ping tool from the above tools menu and enter the IP Address of your machine followed by clicking Menu &gt; Send Ping.</li>
<li>To go a step further you can establish whether the device can access the service, by opening the device&#8217;s internet browser.</li>
<li>Once inside the browser, in the top right hand corner you should see a WiFi icon. Otherwise if any other icon such as EDGE is displayed you won&#8217;t be able to access any resource on the WiFi network. Unfortunately as we all know a BlackBerry phone is a merely a phone, not an iPhone, therefore it&#8217;s not smart enough to choose the least expensive network automatically. To switch to WiFi for browsing, in your browser, click Menu &gt; Options &gt; General Properties and from the Default Browser drop down select Hotspot Browser followed by clicking Menu &gt; Save Options. Then click the Broser Configuration menu item and from the Browser drop down ensure that Hotspot Browser is selected and then save the options by clicking Menu &gt; Save Options.</li>
<li>Lastly in your browser, enter the URL of your web service in the address bar and hit enter on the device&#8217;s keyboard.</li>
</ul>
<p>Test the application:</p>
<ul>
<li>Click Menu &gt; Downloads and select the application you&#8217;ve just built and deployed.</li>
<li>Once it starts up, click the Get Server Info button and it should now hit the service and shortly after display the server&#8217;s hostname and date on the two labels.</li>
</ul>
<p>That&#8217;s pretty much it. You can also download the source code from here: <a title="http://www.mediafire.com/?g3hnbhwrd2k3s5e" href="http://www.mediafire.com/?g3hnbhwrd2k3s5e" target="_blank">http://www.mediafire.com/?g3hnbhwrd2k3s5e</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/whatpaulhaslearnt.wordpress.com/508/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/whatpaulhaslearnt.wordpress.com/508/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/whatpaulhaslearnt.wordpress.com/508/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/whatpaulhaslearnt.wordpress.com/508/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/whatpaulhaslearnt.wordpress.com/508/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/whatpaulhaslearnt.wordpress.com/508/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/whatpaulhaslearnt.wordpress.com/508/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/whatpaulhaslearnt.wordpress.com/508/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/whatpaulhaslearnt.wordpress.com/508/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/whatpaulhaslearnt.wordpress.com/508/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/whatpaulhaslearnt.wordpress.com/508/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/whatpaulhaslearnt.wordpress.com/508/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/whatpaulhaslearnt.wordpress.com/508/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/whatpaulhaslearnt.wordpress.com/508/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=whatpaulhaslearnt.wordpress.com&#038;blog=8255770&#038;post=508&#038;subd=whatpaulhaslearnt&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://whatpaulhaslearnt.wordpress.com/2011/04/19/consuming-a-net-web-service-from-a-blackberry-native-application-using-the-java-me-platform-sdk-3/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
	
		<media:content url="https://secure.gravatar.com/avatar/735c480b7d591c311bb406bb6fe80920?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Paul</media:title>
		</media:content>

		<media:content url="http://whatpaulhaslearnt.files.wordpress.com/2011/04/bbdemo1.jpg" medium="image">
			<media:title type="html">BlackBerry JDE demo file structure</media:title>
		</media:content>
	</item>
		<item>
		<title>Overview on getting started with BlackBerry development</title>
		<link>https://whatpaulhaslearnt.wordpress.com/2011/04/18/overview-on-getting-started-with-blackberry-development/</link>
		<comments>https://whatpaulhaslearnt.wordpress.com/2011/04/18/overview-on-getting-started-with-blackberry-development/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 18:18:19 +0000</pubDate>
		<dc:creator>Paul Kolozsvari</dc:creator>
				<category><![CDATA[computing]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://whatpaulhaslearnt.wordpress.com/?p=492</guid>
		<description><![CDATA[I&#8217;ve just started with BlackBerry development and I have to say it took me quite a while to get up and going mainly because there are some many different IDEs, API and approches. So the idea behind this post is to share my experiences with the different development environments and hopefully get some feedback from &#8230; <a href="https://whatpaulhaslearnt.wordpress.com/2011/04/18/overview-on-getting-started-with-blackberry-development/">Continue reading <span class="meta-nav">&#187;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=whatpaulhaslearnt.wordpress.com&#038;blog=8255770&#038;post=492&#038;subd=whatpaulhaslearnt&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just started with BlackBerry development and I have to say it took me quite a while to get up and going mainly because there are some many different IDEs, API and approches. So the idea behind this post is to share my experiences with the different development environments and hopefully get some feedback from other people&#8217;s experiences. In my next <a title="post" href="http://whatpaulhaslearnt.wordpress.com/2011/04/19/consuming-a-net-web-service-from-a-blackberry-native-application-using-the-java-me-platform-sdk-3/" target="_blank">post</a> I&#8217;ll describe how to develop a BlackBerry native application that consumes a .NET Web Service using the Java ME Platform SDK 3.0.</p>
<p>Firstly you&#8217;ll need to decide on the type of application you&#8217;ll develop. These are your options:</p>
<ul>
<li>RIMlet : a native BlackBerry application that utilizes the BlackBerry APIs to provide the application with a BlackBerry look and feel by using the native UI APIs, as well as other BlackBerry services such as the <a title="BlackBerry Enterprise Server" href="http://en.wikipedia.org/wiki/BlackBerry_Enterprise_Server" target="_blank">BlackBerry Enterprise Server</a> to send/receive emails (an many more) or send <a title="BBM" href="http://en.wikipedia.org/wiki/BlackBerry_Messenger" target="_blank">BBM</a>s. A RIMlet uses the CLDC API&#8217;s which are part of J2ME. The only drawback being that a RIMlet can only run on a BlackBerry device.</li>
<li><a title="MIDlet" href="http://en.wikipedia.org/wiki/MIDlet" target="_blank">MIDlet</a> : a generic <a title="J2ME" href="http://en.wikipedia.org/wiki/Java_Platform,_Micro_Edition" target="_blank">J2ME</a> application based on the <a title="http://www.oracle.com/technetwork/java/index-jsp-138820.html" href="http://www.oracle.com/technetwork/java/index-jsp-138820.html" target="_blank">UIDP</a> and <a title="CLDC" href="http://java.sun.com/products/cldc/" target="_blank">CLDC</a> specifications. As I&#8217;m sure you know like with any Java application, the basic idea behind a MIDlet is that you supposedly &#8220;<a title="write once, run anywhere" href="http://en.wikipedia.org/wiki/Write_once,_run_anywhere" target="_blank">write once, run anywhere</a>&#8221; i.e. it should run on any device without any modifications. Using this approach you can develop the MIDlet in your favorite Java IDE, but you cannot however just deploy and run the JAR//JAD files on the device. They instead need to be converted to a native BlackBerry executable, which is a COD file. In my short experience with MIDlets for BlackBerry, this isn&#8217;t as great or as easy as it sounds. Primarily because I&#8217;ve noticed that on some occasions, the conversion process results in build errors. Also the application doesn&#8217;t necessarily behave the same way on a BlackBerry as it does on the J2ME emulator. One of the reasons being that it seems like J2ME applications seem to be targeted at devices with the retro style left/right (select/menu) keys. This according to the documentation requires remapping of the keys etc. I didn&#8217;t spend much time on MIDlets to be quite honest, but personally I wouldn&#8217;t recommend this approach unless you have an existing MIDlet you&#8217;re attempting to port to a BlackBerry. If you insist on this approach, you might want to go through this tutorial on Programming the BlackBerry With J2ME which you faind here <a title="http://www.oracle.com/technetwork/systems/index-139239.html" href="http://www.oracle.com/technetwork/systems/index-139239.html" target="_blank">http://www.oracle.com/technetwork/systems/index-139239.html</a>.</li>
</ul>
<p>Regardless of the type of application you&#8217;ll be building, you&#8217;ll need to create a BlackBerry developer account to access the downloads, documentation and forums. You can do that from here: <a title="http://us.blackberry.com/developers/" href="http://us.blackberry.com/developers/" target="_blank">http://us.blackberry.com/developers/</a>.</p>
<p>Let&#8217;s have a look at the different IDEs that you can use:</p>
<ul>
<ul>
<li>BlackBerry JDE: If you&#8217;re going to be developing using Java, this IDE is a must. You might however, get away without it if you&#8217;re using the BlackBerry plugin for Eclipse. Personally after struggling with IDEs I eventually settled for the BlackBerry JDE. It turned out be the only environment where everything seems to just work out of the box. It does seem a little primitive relative to other IDEs like NetBeans and Visual Studio. It has an IntelliSense/Autocomplete feature, but it isn&#8217;t that great. The API documentation is included with the installer but class/method specific documentation is not displayed in the Intellisense. There is a feature that allows you to right click a class in the editor and select &#8220;Show help for &lt;class name&gt;&#8221;, which opens the documentation in your browser. Each version of the JDE maps to a specific version of the BlackBerry OS running on a device. According to the documentation, the APIs are backwards compatible. In other words an application built using the JDE 5.0 should in theory run on a device running OS 6.0, but not vice versa. I&#8217;m using a BlackBerry Curve 9300 with OS 5.0. Therefore I downloaded version 5.0 of the JDE. You can download it from <a title="http://us.blackberry.com/developers/javaappdev/javadevenv.jsp" href="http://us.blackberry.com/developers/javaappdev/javadevenv.jsp" target="_blank">http://us.blackberry.com/developers/javaappdev/javadevenv.jsp</a> and the version specific documentation and guides from <a title="http://docs.blackberry.com/en/developers/subcategories/?userType=21&amp;category=Development+Guides" href="http://docs.blackberry.com/en/developers/subcategories/?userType=21&amp;category=Development+Guides" target="_blank">http://docs.blackberry.com/en/developers/subcategories/?userType=21&amp;category=Development+Guides</a>.</li>
<li>BlackBerry Eclipse plugin : this environment seems to provide pretty much the same results as the JDE with the exception that Eclipse is a more mature environment with more features. BlackBerry provides a full installer that includes Eclipse bundled with the plugin, which you can get from <a title="http://us.blackberry.com/developers/javaappdev/devtools.jsp" href="http://us.blackberry.com/developers/javaappdev/devtools.jsp" target="_blank">http://us.blackberry.com/developers/javaappdev/devtools.jsp</a>. At the time of writing I downloaded version 1.3, which only includes the BlackBerry JRE 6.0. The plugin has a feature that allows you to download component packages required for a specific OS version. When initiating the download you need to enter the update site URL. I&#8217;ve found various URLs which didn&#8217;t work, so clearly the URL seems to change from time to time. As far as I&#8217;ve heard, the update feature on the plugin has been discontinued, but I did find a URL that worked : <a title="http://www.blackberry.com/go/eclipseUpdate/3.6/java" href="http://www.blackberry.com/go/eclipseUpdate/3.6/java" target="_blank">http://www.blackberry.com/go/eclipseUpdate/3.6/java</a>. To perform the update in Eclipse, click Help &gt; Install New Software. In the dialog that appears click Add and then enter either the above URL or enter the location of the component package on your machine if you&#8217;ve downloaded it directly from the site. I didn&#8217;t spend too much using this IDE, mainly because there were way too many hoops I had to jump through i.e. I couldn&#8217;t figure out how to start the emulator or debug on it or on the device for that matter using the 5.0 JRE. Reading through online forums, it seems I&#8217;m not the only developer not happy with this plugin. Lastly regarding this IDE, if you&#8217;re keen on trying to get it working on an Ubuntu box (i.e. Linux), you can have a look through this post <a title="http://od-eon.com/blogs/bogdan/blackberry-environment-setup-under-ubuntu/" href="http://od-eon.com/blogs/bogdan/blackberry-environment-setup-under-ubuntu/" target="_blank">http://od-eon.com/blogs/bogdan/blackberry-environment-setup-under-ubuntu/</a>. It&#8217;s a bit of a hack, but I managed to get the IDE installed and running, but it&#8217;s running through <a title="Wine" href="http://en.wikipedia.org/wiki/Wine_(software)" target="_blank">Wine</a> i.e. you won&#8217;t be running the Linux version of Eclipse, but rather the Windows one.</li>
<li>NetBeans : since this is such a great IDE, this was my first choice, but unfortunately I did have numerous problems in getting anything working. You can download it from <a title="http://netbeans.org/" href="http://netbeans.org/" target="_blank">http://netbeans.org/</a>. Firstly, to develop a native BlackBerry application you need to point your project to the correct APIs. Just to do that you need write up your own build config file. Next, after you&#8217;ve gotten the project to build you&#8217;ll need to write a config file to get the BlackBerry simulator to run. You can get all the gory details here <a title="http://www.scribd.com/doc/29831850/Setting-Up-Blackberry-Development-Environment" href="http://www.scribd.com/doc/29831850/Setting-Up-Blackberry-Development-Environment" target="_blank">http://www.scribd.com/doc/29831850/Setting-Up-Blackberry-Development-Environment</a>. Once you&#8217;ve gotten all of that working you&#8217;ll notice that you can&#8217;t attach the debugger to the simulator or device for that matter. I remember reading some post, on getting it working in the simulator by some guy that reversed engineered the APIs to find out how to get it working. In the short time I spent playing with NetBeans I got the impression that using it is pretty much a hack. I&#8217;m not even sure why RIM says that it&#8217;s a supported IDE. Obviously, if you&#8217;re going to develop J2ME applications, NetBeans is your friend. Once you&#8217;ve built your MIDlet into JAR/JAD files, you&#8217;ll need to convert it to a COD file using either the BlackBerry JDE or a command line cool that comes with the JDE called rapc e.g. rapc import=&#8221;c:\BlackBerryJDE3.6\lib\net_rim_api.jar&#8221; codename=LoginMIDlet -midlet jad=LoginMIDlet.jad LoginMIDlet.jar. From what I gather most developers using NetBeans develop and build their applications in it and then copy the source files into the JDE for debugging, which is possible, I&#8217;ve tested. Once you&#8217;ve copied the JAR and JAD files into a JDE project, regardless of whether it&#8217;s a native BlackBerry application or MIDlet it will try to convert them to a COD file when you build the project. After adding the Java source files to the project and setting breakpoints you can then attach the debugger to the simulator or device and do the debugging.</li>
<li>Visual Studio : RIM used to have an MDS plugin for Visual Studio that allowed you to create screens in a drop and drag fashion similar to .NET Compact Framework applications and all event handlers had to be coded in JavaScript. You can read all about it here <a title="http://kvnc.net/content/binary/BlackBerryNet.pdf" href="http://kvnc.net/content/binary/BlackBerryNet.pdf" target="_blank">http://kvnc.net/content/binary/BlackBerryNet.pdf</a>. I&#8217;m not sure why, but this plugin has been discontinued. Instead, they now have a the BlackBerry WebWorks plugin for Visual Studio, through which you build web applications using ASP.NET and the plugin provides a BlackBerry simulator. It&#8217;s basically just a web browser with a BlackBerry skin around it. You can download it from <a title="http://us.blackberry.com/developers/browserdev/devtoolsdownloads.jsp" href="http://us.blackberry.com/developers/browserdev/devtoolsdownloads.jsp" target="_blank">http://us.blackberry.com/developers/browserdev/devtoolsdownloads.jsp</a> and the documentation, guides and videos on it from <a title="http://supportforums.blackberry.com/t5/Web-Development/How-to-Use-the-BlackBerry-WebWorks-Plug-in-for-Microsoft-Visual/ta-p/446830" href="http://supportforums.blackberry.com/t5/Web-Development/How-to-Use-the-BlackBerry-WebWorks-Plug-in-for-Microsoft-Visual/ta-p/446830" target="_blank">http://supportforums.blackberry.com/t5/Web-Development/How-to-Use-the-BlackBerry-WebWorks-Plug-in-for-Microsoft-Visual/ta-p/446830</a>.</li>
</ul>
</ul>
<p>Alright, so now that you&#8217;ve got your IDE in place, this might be a good time to start coding something. I&#8217;ve found some great posts to help you get your feet wet by developing some sample native BlackBerry applications using the BlackBerry JDE:</p>
<ul>
<li><a title="How to write your first BlackBerry application - Lesson 1 : UI Fields" href="http://www.blackberrycool.com/2009/06/05/how-to-write-your-first-blackberry-application-lesson-1-ui-fields/" target="_blank">How to write your first BlackBerry application &#8211; Lesson 1 : UI Fields</a></li>
<li><a title="How to write your first BlackBerry application - Lesson 2 : Mail API Invoke and API Menu" href="http://www.blackberrycool.com/2009/06/16/how-to-write-a-blackberry-application-lesson-2-mail-api-invoke-api-menu/" target="_blank">How to write your first BlackBerry application &#8211; Lesson 2 : Mail API Invoke and API Menu</a></li>
<li><a title="How to write your first BlackBerry application - Lesson 3 : Create Shortcuts and more" href="http://www.blackberrycool.com/2009/07/16/how-to-write-a-blackberry-application-lesson-3-create-shortcuts-and-more/" target="_blank">How to write your first BlackBerry application &#8211; Lesson 3 : Create Shortcuts and more</a></li>
</ul>
<p>If you ever run into any issues, there are developer forums available here <a title="http://supportforums.blackberry.com/t5/Developer-Support-Forums/ct-p/blackberrydev" href="http://supportforums.blackberry.com/t5/Developer-Support-Forums/ct-p/blackberrydev" target="_blank">http://supportforums.blackberry.com/t5/Developer-Support-Forums/ct-p/blackberrydev</a> as well as being able to mail development support center using the devsupport@rim.com. Don&#8217;t get your hopes up the email address, I&#8217;ve sent two or three mails to this address and still haven&#8217;t gotten a reply.</p>
<p>Now depending on the device you&#8217;re planning on developing for you&#8217;ll need to download and install the corresponding simulator for it. You can the download the simulators from <a href="http://us.blackberry.com/developers/resources/simulators.jsp">http://us.blackberry.com/developers/resources/simulators.jsp</a>. As I mentioned before, my preferred IDE is the BlackBerry JDE so I&#8217;ll only mention how to get the emulator running in the JDE, but even if you&#8217;re running it in NetBeans you can still use the JDE to set it up. So to get a project running in a given simulator, once you&#8217;ve installed it, you&#8217;ll need to open the JDE, click Edit &gt; Preferences and select the Simulator tab in the dialog that opens. From the Profile drop down box select the simulator you&#8217;ve just installed. Now you should be able click Debug &gt; Go and the simulator will start running and your application will be deployed to the to it. Also note that unlike other platforms, the application doesn&#8217;t just start running once the emulator has booted up. Instead it gets deployed to the Downloads folder from where you&#8217;ll need to start it up i.e. Menu -&gt; Downloads. One of the issues I&#8217;m sure you&#8217;ll notice is that the emulator takes incredibly long to boot and there doesn&#8217;t seem to be a way of saving its state like with the Windows Mobile emulators. In other words, on first inspection it seems like every time you want to debug you have to restart the emulator and wait roughly 30 seconds. One workaround is to instead start the emulator from the Start menu &gt; Research In Motion &gt; BlackBerry Smartphone Simulators &lt;platform version&gt; &gt; &lt;platform version&gt;. Then in your JDE instead of clicking Debug &gt; Go, click Build &gt; Build / Build All. Then in your simulator click on File &gt; Load BlackBerry Application or Theme. Browse to your project&#8217;s directory and select the COD file. The application will get installed in the Downloads folder on the simulator. In the JDE click on Debug &gt; Attach to &gt; Simulator. This may take a little while so be patient.  Then simply set breakpoints, start your app on the simulator and debug your heart out. One issue you might encounter with the simulator is that it might appear like the keys are not working i.e. pressing keys has no effect or you only see a change on the screen after perhaps 30 seconds. Before you throw your toys out the cot, on the simulator, click View &gt; Graphics Acceleration and select it to be Off.</p>
<p>Running and debugging your application on a device is fairly straight forward. Once you&#8217;ve built the project and connected the device to your machine via a USB cable, open a command prompt and go to the project folder containing the COD file. Type the following command : javaloader -usb load &lt;file_name&gt;.cod. Your device&#8217;s screen should go white indicating an installation and then return to normal. The application will be in your Downloads folder. Upon attempting to run the application you may be prompted to set the permissions on the application. If not, then navigate to Menu &gt; Options &gt; Applications and select your application. Click Menu &gt; Edit Permissions and ensure that Connections and User Data are set to Allow, with Interactions  possibly set to Custom. Should you not set the permissions your application will probably not run. To Debug, in the JDE click Debug &gt; Attach to &gt; Handheld &gt; &lt;device&#8217;s name&gt;. This again might take a little while and if one or two error messages pop up, just remember that these error messages are only there to make you scared of BlackBerry development &#8230; but don&#8217;t be afraid, just click OK, nothing bad will happen. Once it&#8217;s done, set your breakpoints and start the application from the device.</p>
<p>You might find it also useful to be able to control your device from your PC. You can purchase the <a title="SOTI Pocket Controller for BlackBerry" href="http://www.soti.net/PCProBB/Default.aspx" target="_blank">SOTI Pocket Controller for BlackBerry</a> for that purpose, which can connect to the device either through USB or WiFi.</p>
<p>Lastly, if you went through all of the above mentioned tutorials, you will have noticed that you can run them on the simulator, but on the device you get an error saying that the application is trying to access restricted BlackBerry APIs. The reason for this is that RIM secures their APIs to prevent people from developing possibly malicious software and therefore they want to keep track of who developed what application and which APIs they&#8217;re utilizing. Therefore you&#8217;re required to get a signing key from RIM and sign every application that uses any of the restricted APIs. Apparently in the past, getting this key was not for free, but now it is. The basic process for submitting a request, receiving a key and signing an application is as follows according to RIM:</p>
<ol>
<li>Get a CSI file from RIM by applying for code signing keys here <a title="https://www.blackberry.com/SignedKeys/" href="https://www.blackberry.com/SignedKeys/" target="_blank">https://www.blackberry.com/SignedKeys/</a>. It may take RIM up to 48 hours to them to respond.</li>
<li>Configure communication to the RIM Signing Authority.</li>
<li>Register with the RIM signing authority using the provided CSI file.</li>
<li>Request a BAR file signature from RIM Signing Authority.</li>
<li>Create or provide an existing developer certificate.</li>
<li>Sign the BAR file with the developer certificate.</li>
<li>Publish the application.</li>
</ol>
<p>The whole signing process is also explained in the documentation related to your JDE as well as here <a title="http://docs.blackberry.com/en/developers/deliverables/23959/Signing_your_application_1422721_11.jsp" href="http://docs.blackberry.com/en/developers/deliverables/23959/Signing_your_application_1422721_11.jsp" target="_blank">http://docs.blackberry.com/en/developers/deliverables/23959/Signing_your_application_1422721_11.jsp</a></p>
<p>Once you&#8217;ve received the CSI files (you should get 3 of them through email), simply follow the process as described in their emails i.e. create private key password etc. You need to do that with all the CSI  files you received from. Lastly once you&#8217;ve built a project in the JDE, go to the project folder and ensure that it contains the COD file as well as a CSO file, both of which get created by the JDE. To sign the COD file, simply double click it and a signing dialog should appear, indicating which utilized APIs of the application require signing. Select the API that requires signing and Click on the Request button. The status of that API should change to Signed. You will also receive an email indicating your success of failure to sign your application.</p>
<p>Alright, so hopefully you now you have a basic idea of the basics on getting started with BlackBerry development. Since I&#8217;ve also just started I&#8217;d really appreciate it if anyone can provide this post with more tips/tricks/advice on things you might have experienced or problems you were faced with and solved.</p>
<p>Read my next <a title="post" href="http://whatpaulhaslearnt.wordpress.com/2011/04/19/consuming-a-net-web-service-from-a-blackberry-native-application-using-the-java-me-platform-sdk-3/" target="_blank">post</a> on  how to develop a BlackBerry native application that consumes a .NET Web Service using the Java ME Platform SDK 3.0.</p>
<p><a title="http://whatpaulhaslearnt.wordpress.com/" href="http://whatpaulhaslearnt.wordpress.com/" target="_blank">http://whatpaulhaslearnt.wordpress.com/</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/whatpaulhaslearnt.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/whatpaulhaslearnt.wordpress.com/492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/whatpaulhaslearnt.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/whatpaulhaslearnt.wordpress.com/492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/whatpaulhaslearnt.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/whatpaulhaslearnt.wordpress.com/492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/whatpaulhaslearnt.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/whatpaulhaslearnt.wordpress.com/492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/whatpaulhaslearnt.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/whatpaulhaslearnt.wordpress.com/492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/whatpaulhaslearnt.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/whatpaulhaslearnt.wordpress.com/492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/whatpaulhaslearnt.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/whatpaulhaslearnt.wordpress.com/492/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=whatpaulhaslearnt.wordpress.com&#038;blog=8255770&#038;post=492&#038;subd=whatpaulhaslearnt&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://whatpaulhaslearnt.wordpress.com/2011/04/18/overview-on-getting-started-with-blackberry-development/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="https://secure.gravatar.com/avatar/735c480b7d591c311bb406bb6fe80920?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Paul</media:title>
		</media:content>
	</item>
	</channel>
</rss>
