Sunday, 29 August 2010

7cache - Geocaching App for Windows Phone 7


Microsoft is ramping up to the release of Windows Phone 7, and they've really been pushing the developer tools recently. The tools for WP7 development are now packaged alongside the XNA Game Studio 4.0 previews. I can see the reasoning behind it - WP7 development is either Silverlight or XNA and you'll use the same tools to develop XNA games for Windows, Xbox and Phone.

What makes less sense is that the Silverlight applications development side of the WP7 tools are also bundled in with the beta, creating an odd mishmash of tools for WP7 apps, WP7 games, as well as Xbox and Windows games development.

If Microsoft were hoping to tempt some of the XNA community over to Silverlight, they've succeeded! I briefly touched on Silverlight back in the 2 beta but I thought I'd have a dip into creating an application for Phone 7. I also intend to explore cross-platform games development for the phone and Xbox at a later date.

I've decided to create an application for Geocaching on the phone. In a nutshell, Geocaching makes use of GPS technology to create a worldwide outdoor treasure hunt. Geocaching.com holds a database of "caches" placed by Geocachers around the globe, and provide the data for users to hook up their handheld GPS unit or GPS-enabled mobile phone and go hunting for caches.

The best mobile Geocaching application I've used is Trimble's Geocache Navigator on my Nokia N95. I'd like to get all the features of that particular application into my app, while providing a modern easy-to-use interface that makes the Geocaching-on-the-go experience a pleasant one.

And so I've begun prototyping my first Windows Phone 7 application, 7cache.



It's a good project as it not only exposes me to more Silverlight, but it also makes use of many features of the the phone, including GPS, mapping and (when made available in the API) the compass.

Unfortunately, while I can develop out the application to be as feature-rich as most Geocaching applications out there, I may never be able to release it as a real product. To be of any use, the application must be able to bring in XML data about the caches themselves. In other applications, this happens in one of two ways:

1. The user uploads .GPX waypoint files to the phone, and the application reads them in. Or:
2. The application connects to Geocaching.com's API and retrieves cache data directly.

The first method is not possible on Phone 7, because Microsoft is not allowing direct access to the filesystem either by users or third party apps. I was hoping to make use of the rumoured Skydrive integration, but the API is currently limited to retrieving pictures from a user's Skydrive. I could leverage Azure services, but that would require users to go through a Windows application or hosted website to get their GPX files to their phone, which is an unwanted layer of abstraction.

The second method would be ideal, if Geocaching.com made their APIs public. At the moment, only selected partners are able to query the Geocache database directly in their applications. They have said they are looking at opening up the APIs to a wider audience in the future. If they do, I'll be waiting with a near-complete solution for Phone 7 users.

Of course, there's other obstacles to overcome - I'll need a physical device to implement real geolocation properly. It's possible to fake it in the current API, but in order to build out the "cache radar" function, I'll need to test on real hardware. Having said that - so far the emulator is doing a great job!

On another note, I should really stop starting new projects!

4 comments:

Joel Ivory Johnson said...

You can still go with Option 1. You would just need to make a desktop application that host a service that would serve up the updated Geo-Cache data. This is something that could could be assembled in about 100 lines of code plus other IDE generated code. I made something to move data in the opposite direction the other day ( http://tinyurl.com/29f6grr ). If you need help let me know.

Gareth said...

Thanks Joel, I'll check it out. I was hoping not to need an accompanying desktop app, but until something else gets opened up, it'll do the job!

Dino said...
This comment has been removed by the author.
Jimmy H. said...

What is the status of this project?