Seconds Pro for Android

The latest Android app I’ve been working on for Runloop’s, the hugely successful iOS interval timer Seconds Pro, is now live. Packed with the following features:

• Quickly create timers for interval training, tabata, circuit training
• Save your tim…

The latest Android app I’ve been working for Runloop, the hugely successful iOS interval timer Seconds Pro, is now live. Packed with the following features:

• Quickly create timers for interval training, tabata, circuit training
• Save your timers, as many as you need
• Organize Timers into groups
• Text to speech
• Install timers from the timer repository
• Send your timers to your friends
• Full control over every interval
• Assign music to intervals or timers
• Large display
• The choice of personal trainers up and down the country

seconds

You can download the app now from the Google Play Store.

If you’re looking for high quality Android development, head over to my company’s website – Valis Interactive.

Getting Started with NFC on Android for .NET Magazine

A tutorial I wrote for .NET Magazine is now up on their site. This tutorial takes you through the basics of getting NFC working with Android 4.0+ with a “Top Trumps” like demo. It covers both reading and writing data to/from NFC tags, stickers or cards.…

A tutorial I wrote for .NET Magazine is now up on their site. This tutorial takes you through the basics of getting NFC working with Android 4.0+ with a “Top Trumps” like demo. It covers both reading and writing data to/from NFC tags, stickers or cards.

nfc-netmag

Head over to .NET Magazine to read the tutorial!

Winners at Create London NFC Hackathon

We had what was probably the first BBQ weather over the weekend, but I wouldn’t know about that. Instead I spent the weekend hacking away at the NFC Hackathon (sponsored by O2) with my team members George Medve and Aaron Newton.

The idea was to spend…

We had what was probably the first BBQ weather of the year over the weekend, but I wouldn’t know about that. Instead I spent the time coding away at the NFC Hackathon (sponsored by O2) with my fellow team members George Medve and Aaron Newton.

The idea was to spend 28 hours designing and coding something that made use of NFC (Near Field Communication). We were supplied with NFC enabled Galaxy S2s and some useful SDKs from Proxama and BlueVia for tracking NFC campaigns, making payments and tracking users.

We spent the night before the event thinking about just what we could do that was new. Even at this fledgling stage it felt as if everything had been done in some way already, we needed something unique. One idea we explored was transforming shopping by allowing customers to scan NFC price stickers in the many aisles instead of at the till; simply weighing in their shopping at the self checkout (to reduce unpaid bagging) and scanning their phone to transfer the shopping list and payment. Fortunately we didn’t go with this idea as another team at the event did (albeit without the weighing part).

At some point that night another idea came to me, “StreetScreen“. We could allow retailers and advertisers to directly interact with customers by using an NFC sticker in shop windows to initiate a connection between the screen and the phone, and with a multi-user server allow the customer to control the screen in real time.

At the event we used technologies like node.js, HTML, JavaScript and Flash to create some demos including browsing and rotating products, buying flowers for mother’s day and even a 2 player game (see “Connect 4” game pictured). I’m pleased to say with this we won the Finance category prize sponsored by Visa. Thanks to the truly excellent Isobar and sponsors, the whole event was a lot of fun and I think I’ll be looking forward to developing a product around NFC in the near future.

The potential applications for this technology are endless. The number of NFC enabled handsets is expected to reach 1 in 6 by 2014, but that’s not going to stop us pushing the envelope in the meantime.

If you are interested in using this technology in your campaign please get in touch via the contact form. You can read more about the event over at the Isobar site.

FanChants for Android

Last week I pushed FanChants for Android live. This app for FanChants.com provides access to the 20,000 real football chants as sung by the fans. Chants include lyrics and through an in-app-purchase can be set as your phone’s ringtone.

View FanCh…

My latest Android project is now live. This app for FanChants.com provides access to the 20,000 real football chants as sung by fans all over the world. Chants include lyrics and through an in-app-purchase chants can be set as your phone’s ringtone.

FanChants

View FanChants over at Google Play

Snowball Fight for iOS and Android

I’m pleased to announce a game we’ve been working on is finally out. A collaboration between The Creation Agency and Bitmode, we bring you The Great Snowball Fight!The game is played over Google Maps, launching virtual snowballs at unsuspecting p…

I’m pleased to announce a game we’ve been working on is now out. A collaboration between The Creation Agency and Bitmode (my previous home), we bring you The Great Snowball Fight!

Snowball Fight

The game is played over Google Maps, launching virtual snowballs at unsuspecting players in order to rank up, earn points and even win prizes from retailers you hit. You can also add buddies, connect via Facebook and receive special powerups.

Utilising Flash with AIR 3 and native extensions, we were able to build a game for iOS, Android and also PC. The game uses native extensions for deeper platform integration, such as the compass sensor or push notifications, as well as GPS to pin-point your location.

Head on over to the site to download the game and get throwing some snowballs!

Update: See comments for iOS compass extension source.

.NET Mag: User Interface Design for Android Apps

I recently wrote a tutorial for .NET Magazine covering styling and theming components in Android. This includes how to use resolution independent units so that your UI looks crisp across a wide range of devices and 9-patch images for smooth scaling.…

I recently wrote a tutorial for .NET Magazine covering styling and theming components in Android. This includes how to use resolution independent units so that your UI looks crisp across a wide range of devices and 9-patch images for smooth scaling.

netmag_android

Here’s a link to the article.

Are You OK Made The Finals of The Vodafone Smart Accessibility Awards 2011

I was absolutely delighted to hear that the app I put together for the Vodafone Smart Accessibility Awards has been made a finalist for 2011. The app, “Are You OK” falls under the wellbeing category. If you’re not familar with the awards, the idea is to…

I was absolutely delighted to hear that the app I put together for the Vodafone Smart Accessibility Awards has been made a finalist. The app, “Are You OK” falls under the wellbeing category. If you’re not familar with the awards, the idea is to improve the lives of the elderly or disabled through technology.

Are You OK is a simple app that was inspired by the panic button pendants many elderly use in their homes. The button communicates with a base-station plugged into the phone which contacts an emergency call center and and a voice can be heard over the speakerphone. The problem is these buttons are often left lying around out of reach, and many hours, or at worst days can go by before they get help after something like a fall. On top of this there’s a monthly fee for the service.

Are You OK works in reverse. It has an easily configurable alarm which goes off every X hours throughout the day, asking if they are OK with two big buttons, yes or no. If they hit no or fail to get to the phone within a certain time, it sends a text message to chosen friends or family asking them to check in by phone or by dropping by.

Tomorrow I’m off to Brussels to present the app before a panel. Here’s hoping it all goes well and if I’m very lucky I’ll get to bring back good news!

You can view the final 12 apps here.

Android Workshop at TechHub London 24-25th November 2011

The Android Workshop is coming to TechHub in London, tickets are now available for Thursday 24th and Friday 25th of November this year. It’s a full 2 day introduction covering a huge range of topics, for more info please head over to the site. Sign up fa…

The Android Workshop is coming to TechHub in London, tickets are now available for Thursday 24th and Friday 25th of November this year. It’s a full 2 day introduction covering a wide range of topics from layouts and widgets to styling and database access, for more info please head over to the site. Sign up fast to guarantee your Early Bird price, or add yourself to the mailing list for future events.

Finally there’s the Twitter account @androidws, feel free to shoot over any questions you may have or drop them in the comment form below. Look forward to seeing you there.

Dynamic Application Cache Manifest for PHP

Earlier today Paulo Fierro uploaded an example of how to do a dynamic application cache manifest for HTML5 web apps using Ruby. A cache manifest is a text file that browsers look for in order to determine which files to store locally on the device, this…

Earlier today Paulo Fierro blogged an example of how to build a dynamic application cache manifest for HTML5 web apps using Ruby.

A cache manifest is a text file that browsers look for in order to determine which files to store locally on the device, this lets you open the site/app offline, great for web apps (on iOS bookmarking a site to the home screen also let’s you specify an icon and removes browser chrome). Creating a cache manifest dynamically means that you don’t have to worry about modifying a text file every time you add or remove a file from the app.

This prompted me to upload my PHP version that works pretty much in the same way. I built it for an iPad web app that needed to run completely offline collecting peoples details at a car show (it later synced data with a server when it found a connection). It’s pretty basic, it just creates an MD5 of all the files in a directory (apart from excluded files, including itself!), so that when one is changed, either the content or the name, the MD5 value changes and that results in the contents of the manifest changing, causing the browser to re-evaluate it.

Below is the dynamic manifest, let’s call it “cache.manifest.php”:


<?php 
	header("Cache-Control: max-age=0, no-cache, no-store, must-revalidate");
	header("Pragma: no-cache");
	header("Expires: Wed, 11 Jan 1984 05:00:00 GMT");
	header('Content-type: text/cache-manifest'); 
	
	$hashes = "";
	
	function printFiles( $path = '.', $level = 0 ){ 
		global $hashes;
	    $ignore = array('.', '..','.htaccess','cache.manifest.php','index.html','submit.php', "video.mp4");  

	    $dh = @opendir( $path ); 

	    while( false !== ( $file = readdir( $dh ) ) ){ 
	        if( !in_array( $file, $ignore ) ){ 
	            if( is_dir( "$path/$file" ) ){ 
	                printFiles( "$path/$file", ($level+1) ); 
	            } else { 
					$hashes .= md5_file("$path/$file");
	                echo $path."/".$file."n";
	            } 
	        } 
	    } 

	    closedir( $dh ); 
	}
?>
CACHE MANIFEST
<?php 
printFiles('.');
// version hash changes automatically when files are modified
echo "#VersionHash: " . md5($hashes) . "n";
?>

NETWORK:
./submit.php
./video.mp4

FALLBACK:
./video.mp4 ./images/offline.jpg
./images/video.jpg ./images/offline.jpg

Remember that cache space is extremely limited. I think it was about 5mb on the iPad first gen. If you need more space you’ll have to use local SQLLite (perhaps storing blobs) and request more DB space from the user.

So you probably don’t want to be including things like video files, you also don’t want to cache the output of dynamic server-side scripts. This is what the NETWORK and FALLBACK portions of the manifest are used for. You can force the browser to only look to the network for certain files, and also provide fallbacks for files it won’t find offline (in the case above, it shows an offline image in place of the video).

To make the browser look for the manifest, you just add the manifest attribute to the HTML tag:

<html manifest="cache.manifest.php">

Now when it comes to actually forcing your client app to check for updates, the following JavaScript should provide some insights. Sorry it’s a bit rough and ready, but it should illustrate how you might invoke an update:


var cacheStatus = getCacheStatus(window.applicationCache.status);
	console.log("App cache status: " + cacheStatus); 
	
	var appCachedHandler = function () {
		console.log("AppCache cached");
		dialog.dialog("close");
	}
	var updateReadyHandler = function() {
		console.log("AppCache update ready");
		
		$("#versionImg").attr("src", src="images/update_available.png");
		$("#versionImg").css("visibility", "visible");
		
		dialog.dialog("close");
			
		if(	!isSyncing && confirm("Update available, update now?") ) {
			window.applicationCache.update();
			window.applicationCache.swapCache();
			window.location.reload(true);
		}
	}
	var downloadingCacheHandler = function() {
		console.log("AppCache downloading...");
		dialog.dialog({modal: true, title: 'Downloading update...'});
			
		$("#versionImg").attr("src", src="images/loading_small.gif");
		$("#versionImg").css("visibility", "visible");
	}
	var cacheErrorHandler = function(obj) {
		console.log("AppCache error " + obj);
		dialog.dialog({modal: true, title: 'Cache error:'+obj});
	}
	window.applicationCache.addEventListener('cached', appCachedHandler, false);
	window.applicationCache.addEventListener('updateready', updateReadyHandler, false);
	window.applicationCache.addEventListener('downloading', downloadingCacheHandler, false);
	window.applicationCache.addEventListener('onerror', cacheErrorHandler, false);

Book Review: Android Wireless Application Development

I’ve read a few books on Android development over the last couple of years, so it was interesting to see how this book would compare in style and content. Android is a very fast evolving platform, so it’s always hard for a book to stay up to date. Androi…

I’ve just finished reading through a copy of Android Wireless Application Development (Addison Wesley Developer’s Library, 2010 by Lauren Darcey & Shane Condor). Having read a few books on Android development over the last couple of years, it’s always interesting to see how a book tackles this big, constantly evolving platform. The book covers Android up to version 2.2 and includes access to the online Safari edition which hopefully means they can add a few post-print updates where necessary.

android_wireless_app_dev

To be honest, if you’re just getting into Android development, it’s not so important to learn about the newest additions of the latest and greatest version, just to have a firm understanding of the core components which haven’t really changed all that much. Android 2 covers you for development on all current phones, and your apps can still support Android 3 devices if desired, but if you did want to target Honeycomb tablets, you may want to continue your learning by reading up on topics such as Fragments and Loaders.

What’s inside?

The book sets out to be a fairly complete reference and pretty much runs the gamut. Starting off with an overview of Android, a look at the anatomy of Android apps and an understanding of the component parts that make up a project; it leads on to user interface design, a multitude of common APIs (far too many to list, but this includes subjects like data storage, networking/web, location and multimedia) and then runs through important design principals and more advanced topics such as how to be a good Android citizen and make your app feel fully native. The topic of deployment, signing and testing is covered in depth including selling your app. Finally the appendices collate a lot of information you’d otherwise need to search around for, such as various options and usage of the emulator, DDMS, ADB, Eclipse and a SQL Lite quick start guide.

Reference or cookbook?

Most tech books seem to lean toward either being a pretty dry reference, or a cookbook. By cookbook I’m talking about a collection of short practical examples of specific tasks, and I tend to prefer cookbook-style as I find it more enjoyable to read, with searchable online references filling in the minutiae and specific details when needed.

I think this book is a combination of the two styles. There are a lot of tables outlining the various options around certain functions and classes and also plenty of references. This satisfies the “developer’s library” label. But I would say a large part seems to be presented in the form of cookbook-like recipes, particularly in later chapters. For example “processing asynchronously” which teaches the reader the importance of running code on another thread to keep the UI from being blocked and the dreaded “Application not responding” alert.

Suitable for beginners?

It has a gentle enough introduction to suit most skill levels, but enough depth to provide new information for even the most seasoned Android programmers. I did say it felt more like a cookbook but it is structured well enough to be able to dip into a specific topic and quickly retrieve the example you need without much reading around the topic.

The book does touch on some pretty advanced topics such as OpenGL 3D graphics. If you’ve ever done any OpenGL programming you’ll know this stuff easily fills a book (or 3) itself. But it’s nice of them to include a springboard into this kind of development for those interested in real-time game programming.

Further comments

It was nice to see some time had been put into writing a chapter on the history of mobile development. It helps those new to the field understand just how we got to where we are. Remember WAP? This chapter brought back a flurry of deeply buried memories of J2ME; we live in better times.

Two unexpected (but nice) additions were the chapters on “The Mobile Software Development Process” and “Best Practices in Bulletproof Mobile Applications” which discuss application requirements gathering, documentation practices, testing/QA and all kinds of experience-garnered gems.

All in all this is a bumper book at nearly 700 pages with a massive range of topics covered, a worthwhile addition to the bookshelf.