15 April 2011

Amazon Appstore restrictive terms

This IGDA post very much echoes the concerns I had when I considering publishing to the Amazon Appstore.

Make sure you read it (and the full Amazon terms) before participating in the Amazon Appstore.

27 October 2010

Persuasion Android app


I recently published my first Android app. It's a puzzle game called Persuasion. You can search for it on the market or find out more at persuasion.codesimple.net.

Here's a few things I learnt in the process:

  • Developing for Android is pretty pleasant: the documentation and tools are good and comprehensive. And if, like me, you're not a fan of Eclipse you don't have to use it: The tools will generate an Ant build file for your project complete with an install task to run the app on your device or emulator. I imported this into a Java Free-Form Project in NetBeans to get code-completion goodness whilst still using the standard build file.
  • If you want to add global highscores to your game, I'd recommend Scoreloop. Basic integration is easy and I found the support excellent.
  • Don't be afraid of the dips. I initially wrote my app to run in "compatibility mode" (i.e. the Android System will pretend the screen is 320x480 regardless of the device). For a game, I thought it would be hassle switching to using dips and handling this stuff myself. It wasn't. All I needed to do was work in dips internally, grab the density from DisplayMetrics and then use it to scale to pixels when calling drawing APIs and scale from pixels when receiving input events.
  • If you're planning to do multiple versions of the app (e.g. a free and a paid one) use a Library Project. You can then put all your shared code and resources in a separate project. Create a new project for each variant and the build script will take care of merging the resources and code.

22 September 2009

That Big Shop



I've always found shopping at Amazon a bit of a cumbersome experience. The pages seem a little cluttered and when choosing between products there's lots of back-and-forth as you switch between search results and product detail.

So I thought I'd make use of the Amazon Product Advertising API and write my own interface. The result is That Big Shop. It's not old browser or search engine friendly but it does, I think, have a more responsive feel to it than the standard Amazon interface.

To create the site, I choose to use the Cappuccino framework and I'm glad I did. The painful part of writing web applications is getting them to look and work the same across browsers. With Cappuccino I didn't need to worry about that; as long as I coded to the framework API, Cappuccino would take care of rendering what I wanted consistently across browsers.

12 August 2008

QR codes for cogteeth.com


With a little help from the Google Chart API, I've added the ability to create QR code t-shirt, mugs and cards over at cogteeth.com.

QR codes are quite nifty little two-dimensional barcodes which can store a surpising amount of data in a small space. There are numerous readers available to decode them including mobile phone apps which enable you to decode them using your phone camera.

Any data can be stored in these codes but there are a number of standards or conventions recognised by the readers. For example, many will detect an encoded URL and automatically pull up the referenced web page. The documentation for the zxing reader gives a good summary of these conventions.

15 April 2008

Google App Engine

It took less than two hours to convert cogteeth.com to run with the Google App Engine. Admittedly this is a pretty simple example since cogteeth doesn't use a database and Django is supplied with the App Engine environment.

All that was necessary was:

  1. Create a main.py: Since the app is Django based this was just a modified copy of the version on this page.
  2. Create an app.yaml to pass all URLs onto main.py and serve the static files directly.
  3. Modify some URL fetching code that previously used urllib2 to use urlfetch.
When I say it's running with the App Engine that's not strictly true. It runs locally with the SDK, now I just have to hope they work through the wait list quickly and send me an invite...

11 October 2007

Blogger custom domains

This blog is currently hosted at http://www.codesimple.net. This is a pity since the more succinct http://codesimple.net would be preferable. Unfortunately if I try and set the custom domain in Blogger to just "codesimple.net" it complains with a somewhat dubious "Another blog is already hosted at this address" message.

I think perhaps this is related to also having Google Apps active on this domain. Both services require you to point your DNS at ghs.google.com.

Also slightly odd is that Google do an HTTP redirect for any requests to http://codesimple.net to http://www.codesimple.net. I can't find any setting in Google Apps to control this "feature".

WordPress to Blogger

I recently decided to switch my blog from Wordpress to Blogger. Not because I think Blogger is better but because I wanted to avoid maintaining my own instance of Wordpress and Blogger would host my blog on my domain for free.

To copy the posts across I wrote a small Python script which takes a file of exported Wordpress posts and uses the Blogger Data API to upload them to Blogger.

If you want to do this yourself, you will need to:

  1. Download the script wptoblogger.py.
  2. Ensure you have Python 2.5, BeautifulSoup and Google's GData Python Client.
  3. Create your target Blogger blog and note its ID.
  4. Export your Wordpress blog to an XML file (I think this is only available in version 2 and above of Wordpress).
  5. Run wptoblogger:
    python wptoblogger.py -u your_blogger_username -b your_blog_id -a author_for_posts wordpress_xml_file
There are a few limitations though...
  1. It doesn't support multiple blog authors - all posts will be marked with the author_for_posts.
  2. A limitation with the Blogger API means that comment authors can't be set (they always appear as the blog author). As a workaround, I prefix each comment with a "Comment from..." line (see the existing comments on this blog).
  3. Blogger impose a limit on the number of posts you can create via the API in a certain time period. So if you have a lot of posts to transfer you may need to modify the script to post them in batches over a number of days.