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

<channel>
	<title>Excursions in Android</title>
	<atom:link href="http://blog.soware.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.soware.co.uk</link>
	<description>A .Net Developer&#039;s wanderings through Google&#039;s Mobile OS</description>
	<lastBuildDate>Sat, 27 Feb 2010 00:39:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Barcodes and Android</title>
		<link>http://blog.soware.co.uk/2009/12/05/barcodes-and-android/</link>
		<comments>http://blog.soware.co.uk/2009/12/05/barcodes-and-android/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 00:00:31 +0000</pubDate>
		<dc:creator>Basiclife</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Apps]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://blog.soware.co.uk/?p=21</guid>
		<description><![CDATA[Barcodes are very widely used and often contain a unique ID to identify a product, person or similar.  They can also be used to store small pieces of information. This is very useful when it comes to Android.
There are a lot of different encodings for barcodes but the one we&#8217;re primarily interested in is known [...]]]></description>
			<content:encoded><![CDATA[<p>Barcodes are very widely used and often contain a unique ID to identify a product, person or similar.  They can also be used to store small pieces of information. This is very useful when it comes to Android.</p>
<p>There are a lot of different encodings for barcodes but the one we&#8217;re primarily interested in is known as QR Code. It&#8217;s a 2-D barcode which looks something like this:</p>
<p style="text-align: center;"><img src="http://blog.soware.co.uk/wp-content/plugins/qr-code-tag/data/qrct-ca19789ef666c0e4726585e5570b3aa2.png" class="qrctimage" /></p>
<h3>Why are barcodes useful?</h3>
<p>They provide us with a quick and easy way to transfer snippets of information (or instructions) to your Android phone.</p>
<p>There is a Google application in the Marketplace called <strong>Barcode Scanner.</strong> It uses the camera on your phone to act as a barcode reader. It supports a large number of formats.</p>
<p>There are other applications which allow you to display certain information from your phone as a QR Code barcode.</p>
<p>This allows you to display Contact,  SMS,  URL,  Address,  Geo Location,  and other types of data on your screen in a machine-readable format.</p>
<p>From there, it&#8217;s simple to read them on a second device using the barcode scanner.</p>
<p>There are a number of actions on the pone which can be triggered using specially formatted URLs. The most useful of these (for me) is to locate applications in the Marketplace. For example:</p>
<p style="text-align: center;"><img src="http://blog.soware.co.uk/wp-content/plugins/qr-code-tag/data/qrct-24dcd0fc89796bd411f55aae139e8bc0.png" class="qrctimage" /></p>
<p style="text-align: center;"><em><strong>market://search?q=pname:com.javielinux.apptoqr</strong></em></p>
<p>When scanned with an Android phone will search the Marktplace for an application which which generates barcodes for every application on your phone.</p>
<p>I use a number of QR Codes in this blog &#8211; Each page has the current url in a QR Code. I also provide the market:// urls for any applications I mention</p>
<h3>How can you use QR Codes?</h3>
<p>The simplest answer it to take advantage of the Google <a href="http://code.google.com/p/zxing/">ZXing</a> (pronounced &#8220;Zebra Crossing&#8221;). Google has provided online tools to <a href="http://zxing.appspot.com/generator/">encode</a> data as a QR Code and <a href="http://zxing.org/w/decode.jspx">extract and decode</a> QR codes from images.</p>
<p>If you have a Wordpress blog, you can get a <a href="http://www.spreendigital.de/blog/2009/09/19/qr-code-tag-wordpress-plugin-v1-0/" target="_blank">plugin</a> to easily insert QR codes into your posts.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.soware.co.uk/2009/12/05/barcodes-and-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Posting from my Android mobile</title>
		<link>http://blog.soware.co.uk/2009/10/26/posting-from-my-android-mobile/</link>
		<comments>http://blog.soware.co.uk/2009/10/26/posting-from-my-android-mobile/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 02:51:58 +0000</pubDate>
		<dc:creator>Basiclife</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Apps]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Experiment]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://www.soware.co.uk/blog/2009/10/26/posting-from-my-android-mobile/</guid>
		<description><![CDATA[I&#8217;ve found an application called wpToGo which allows me to post directly from my phone. This is me testing it out.
wpToGo:
Attached is a photo taken outside my office.
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve found an application called wpToGo which allows me to post directly from my phone. This is me testing it out.</p>
<p>wpToGo:</p>
<img src="http://blog.soware.co.uk/wp-content/plugins/qr-code-tag/data/qrct-9e888a6315e57bbeaeacc88a1b66f9b9.png" class="qrctimage" />
<div class="wp-caption alignnone" style="width: 810px"><img style="display: block; margin-right: auto; margin-left: auto;" title="Sunset outside my office" src="http://www.soware.co.uk/blog/wp-content/uploads/2009/10/wpid-2009-10-13-18.30.43.jpg" alt="image" width="800" height="600" /><p class="wp-caption-text">Taken Fri 23rd october</p></div>
<p>Attached is a photo taken outside my office.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.soware.co.uk/2009/10/26/posting-from-my-android-mobile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Started</title>
		<link>http://blog.soware.co.uk/2009/10/26/getting-started/</link>
		<comments>http://blog.soware.co.uk/2009/10/26/getting-started/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 02:11:55 +0000</pubDate>
		<dc:creator>Basiclife</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Installation]]></category>

		<guid isPermaLink="false">http://www.soware.co.uk/blog/?p=9</guid>
		<description><![CDATA[I&#8217;ve recently started developing for my new android Phone (The T-Mobile G-1, currently running Android 1.5 (Cupcake)) . After writing a few applications I decided to keep a record of my discoveries and so I created this blog.
I&#8217;ve read blogs for years but never had my own so any tips, tricks or hints would be [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently started developing for my new android Phone (The T-Mobile G-1, currently running Android 1.5 (Cupcake)) . After writing a few applications I decided to keep a record of my discoveries and so I created this blog.</p>
<p>I&#8217;ve read blogs for years but never had my own so any tips, tricks or hints would be greatly appreciated.</p>
<p>Ok&#8230;</p>
<p>Before we dive in, let&#8217;s have a quick look at how the Android powered phones work</p>
<p>According to the documentation;</p>
<blockquote><p>Android is a software stack for mobile devices that includes an operating system, middleware and key applications.</p>
<p>The Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language.</p></blockquote>
<p>So, we&#8217;ve got an application framework which is Java-based and running on Linux. This allows us an enormous amount of flexibility whilst also giving us a consistent, managed environment in which to develop.</p>
<p>Google and Motorola have both provided IDEs which will allow you to work far faster than a standard text editor. (Installation instructions below)</p>
<p>There is one consideration when developing for Android which you may not be used to:</p>
<p>As we&#8217;re developing for a mobile platform, performance and resource usage is critical.  We&#8217;ll have limited RAM, a light-weight CPU, the Dalvik VM interpreting code (which adds a considerable CPU overhead) and finally,. the more work we do, the more battery we use.</p>
<p>All of the above combine to make resource usage one of your top considerations. If your application is going to run when the user isn&#8217;t actively using the phone, you should try to use an event-driven model rather than polling. This way, you only use battery when you need to respond to an event.</p>
<p>In short, if you&#8217;re using more battery than the user would expect, they&#8217;re likely to uninstall your application.</p>
<p>More information about Android performance can be found <a href="http://www.koushikdutta.com/2009/01/dalvik-vs-mono.html">here</a></p>
<p><span style="font-size: large;">What can Android applications do? </span></p>
<p>Android applications can specify which permissions they require when they are installed. The following list assumes your app has been granted the appropriate permissions:</p>
<ul>
<li>Read information from phone sensors &#8211; Location, orientation, network signal, etc&#8230;</li>
<li>Intercept inbound call, email and SMS events</li>
<li>Generate outbound Emails, SMS and calls</li>
<li>Access the internet</li>
<li>Read data exposed via contentProviders (Contacts, Call history, etc&#8230;)</li>
<li>Play multimedia using native codecs (<a href="http://developer.android.com/guide/appendix/media-formats.html">More info here</a>)
<ul>
<li>Audio: MP3, AAC, AAC +, WMA, WAV, MIDI, REAL AUDIO, OGG</li>
<li>Video: H.264, 3GPP, MPEG4, and Codec 3G</li>
</ul>
</li>
<li> Run in the background (This is a huge advantage over the iPhone)</li>
<li>Display a UI</li>
</ul>
<p><span style="font-size: large;">What can&#8217;t Android applications do? </span><br />
Unfortunately, there are some things which you simply cannot do with the standard android environment. I&#8217;ve only found a couple so far but I&#8217;ll add more here as I find new ones.</p>
<p>It&#8217;s worth noting that most of these are not possible for a good reason &#8211; Android is a very robust environment which prevents applications from performing actions which could impair overall device usage.</p>
<p><span style="font-size: large;">The development environment</span></p>
<p>Fortunately, the <a href="http://developer.android.com/">documentation</a> provided by Google is first-class so please do reference it as an when required.</p>
<p>First of all, we need to get some tools. You have 4 options:</p>
<ul>
<li>Use eclipse with the android SDK.</li>
<li>Use MOTODEV Studio</li>
<li>Manually integrate into a different IDE</li>
<li>Command-lines and scripts.</li>
</ul>
<p>I played around with options 1, 2, and 4.  MOTODEV Studio is also eclipse-based and includes all the functionality of the andoid SDK as well as adding some additional functionality. It&#8217;s very easy to develop with and will save you a lot of time.</p>
<p>Although the command line is not often required if you&#8217;re using MDS, it&#8217;s useful to have a quick look over the developers guide pages so you&#8217;re aware of what is possible.</p>
<p>Assuming you&#8217;re going to use MOTODEV Studio;</p>
<ol>
<li>Download the <a href="http://developer.android.com/sdk/1.6_r1/index.html">Android SDK</a>
<div style="clear: both; text-align: center;"><a style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;" href="http://4.bp.blogspot.com/_RaoohDPwyew/SuSmo1zS6XI/AAAAAAAAAAU/Apo24uvtFTQ/s1600-h/AndroidFS.png"><img style="border: 1px solid #cccccc;" src="http://4.bp.blogspot.com/_RaoohDPwyew/SuSmo1zS6XI/AAAAAAAAAAU/Apo24uvtFTQ/s320/AndroidFS.png" alt="" /></a></div>
<p>Create an <strong>Android</strong> folder in an easy to access part of your disk. As I&#8217;m on windows, I chose C:\Android.</p>
<ol>
<li>Extract the SDK to a sub-folder as shown on the right. I chose to use the SDK version as the folder name (1.6)</li>
<li>Create additional directories for Keys, SDCards and Projects as shown</li>
</ol>
</li>
<li>Download and install <a href="http://developer.motorola.com/docstools/motodevstudio/download/">MOTODEV Studio</a>
<ol>
<li>This installation is fairly straight-forward. If you do not have the appropriate software (JRE, SDK) installed on your system already, the installer will prompt you to install it.</li>
<li>Once installation has completed, select the option to launch MDS and click Finish.</li>
<li>When MDS launches for the first time, it will ask you to provide it with the location of the android SDK. Direct it at the folder you created in Step 1:
<div style="clear: both; text-align: center;"><a style="margin-left: 1em; margin-right: 1em;" href="http://2.bp.blogspot.com/_RaoohDPwyew/SuS05CxTG2I/AAAAAAAAAAk/rp6GA1EOCt4/s1600-h/2009-10-25+003.png"><img src="http://2.bp.blogspot.com/_RaoohDPwyew/SuS05CxTG2I/AAAAAAAAAAk/rp6GA1EOCt4/s200/2009-10-25+003.png" border="0" alt="" /></a></div>
</li>
<li>When prompted, choose the option to create an AVD (Anddroid Virtual Device). This is a fully functional device emulator which will allow you to test your applications without the need of a phone plugged into your PC.</li>
<li>You can have multiple AVDs configured at any time but for the moment, we&#8217;ll set up one device which will run the 1.5 (Cupcake) version of Android. (I&#8217;ve picked 1.5 as not all phones have had the 1.6 Donut patch yet). Name your AVD something appropriate and continue:
<div style="clear: both; text-align: center;"><a style="margin-left: 1em; margin-right: 1em;" href="http://2.bp.blogspot.com/_RaoohDPwyew/SuS07vI9OyI/AAAAAAAAAAs/mDDvsrEHtVE/s1600-h/2009-10-25+004.png"><img src="http://2.bp.blogspot.com/_RaoohDPwyew/SuS07vI9OyI/AAAAAAAAAAs/mDDvsrEHtVE/s200/2009-10-25+004.png" border="0" alt="" /></a></div>
</li>
<li>Next, we&#8217;ll configure the new device. Most settings can be left at their defaults for now.One important step to take is to create a new SD Card image. This is the physical file on your machine that will represent the SD Card inserted into the virtual device. I&#8217;d recommend a size between 512M and 2GB
<div style="clear: both; text-align: center;"><a style="margin-left: 1em; margin-right: 1em;" href="http://3.bp.blogspot.com/_RaoohDPwyew/SuS08_xZy-I/AAAAAAAAAA0/JIxx4hF2yDg/s1600-h/2009-10-25+005.png"><img src="http://3.bp.blogspot.com/_RaoohDPwyew/SuS08_xZy-I/AAAAAAAAAA0/JIxx4hF2yDg/s200/2009-10-25+005.png" border="0" alt="" /></a></div>
</li>
</ol>
</li>
</ol>
<p>And that&#8217;s it, you&#8217;re done! You now have a fully functioning development environment.</p>
<p><span style="font-size: large;">Distributing applications</span></p>
<p>Each application is distributd in a single <strong>.apk</strong> (Android package) file. This is a compressed file which contains the application manifest, the application itself and any other resources required by the application (layouts, images, etc&#8230;). You can manually inspect these files using your favorite zip program &#8211; Personally, I prefer WinRAR.</p>
<p>By default, Android will only install applications from the Android Marketplace.  This won&#8217;t be an issue on your virtual device but when you get to using a real phone, you&#8217;ll need to go in to the security settings and enable installation from &#8220;Untrusted Sources&#8221;.</p>
<p>Incidentally, this is one of the major differences between Android devices and the iPhone &#8211; iPhones will <strong>only</strong> install applications from the Apple Application Store (and their inclusion quidelines are <a href="http://www.theregister.co.uk/2009/08/31/dziuba_apple_fcc/">the subject of some debate</a>). This is what made me choose Android in the first place.</p>
<p><span style="font-size: large;">Sample Code</span><br />
Google provide an excellent set of examples. I&#8217;ll be covering points from most of them in future postings. For the time being, you may wish to <a href="http://developer.android.com/guide/samples/index.html">explore them</a> yourself.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.soware.co.uk/2009/10/26/getting-started/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
