Android: BulletML
In the process of putting together a shoot-em-up style game for the Android phone I remembered coming across BulletML from Kenta Cho. I am familiar with Kenta from rRootage which was/is the coolest shooter for the jail-broken iPhone. Somehow it has never appeared on the app store which is pretty bizarre. Anyway I knew that Kenta had defined a mark-up language for defining all the crazy bullet patterns from his games. I had a look at the Java Applet here. It was written in java how hard could it be?
In the end it wasn’t too bad but I still haven’t a clue about Kentas code which is as opaque as it gets.
I can visualise how I will marry this to my game although I will have to write an OpenGL rendering layer.
- Main list

- Typical bullet sweep

- Another sweep

Demo source code here. I haven’t decided whether to put it up on the market yet in the demos section.
Update #1
I have rewritten graphics layer and implemented an OpenGL renderer for drawing the lines. Anyone interested in line graphics on Android might be interested in this. The line width feature under OpenGL does not work on the phone. It appears the width is fixed on the actual hardware to 1px.
Update #2
I got the profiler working. It looks like the application was linking to the opengl class in the SDK on the phone. Well, that’s what it looked like because when I changes the package name for the opengl stuff I ‘lifted’ from the v1.5 source it started working. Go figure.
The subversion source is kindof broken in the sense that I havce come across a bug in the int buffer. To make it work on the emulator comment out the lines marked ‘workaround’. More on this in later posts.
Android: Getting the cupcake source
I am currently working on a few projects with Android. One of these is an OpenGL game. Looking at the most recent blog post on the Android blog there is mention of a GLSurfaceView class which I was immediately interested in. The problem is it is in the 1.5 Cupcake source branch. How to get the code?
I had previously installed Git but it’s been a while since I used it so I couldn’t remember the commands to pull a branch of the code down. Stumbling around the inter-tubes I came across this page which has a url which pulls the latest head of the current branch. Hmmm I thought, I wonder if it would be possible to modify this to get the ‘cupcake’ branch. Well the answer is yes. You just have to modify the ‘h’ parameter to point to the target head.
So if the head is referenced as h=refs/heads/cupcake then the full url is http://git.source.android.com/?p=platform/frameworks/base.git;a=snapshot;h=refs/heads/cupcake;sf=tgz.
My plan is to pull the GLSurfaceView code out and build it into my app. This a stopgap until the 1.5 SDK is published officially.
Android: gTraffic UK and BBC Data
I think it might be worth pointing out that the gTraffic Android application does not break the Terms and Conditions applied to the BBC Traffic data. The biggest singular reason for this being that it is free. It will always be free because (unless I strike a deal with the BBC, TrafficLink and the Highways Agency) that is the main condition of use. See for yourselves here. I did see an argument on the comments for the iPhone traffic app which tried to reason that anything using the data was basically an RSS reader but I understand perfectly well that this is not the case. It is the data which comes under the Terms and Conditions and no amount of pre-processing it changes that.
Android: gTraffic NY
Here is gTraffic application modified to take NYSDOT traffic RSS feed.

This is a bit of an experiment but I am hoping someone might find it useful. I have split the NYSDOT feed into regions. The application filters the main RSS feed according to a centre point and a radius which I took from Wikipedia. The application is up on the market so if your from New York then download it and send me some feedback, I can take it.
Definitely my last Android traffic application for a while as I _really_ have to get on with another more pressing application.
On a different note I see that Doom has been launched on the Market. The key bindings are a bit hard to setup but it’s still pretty cool.
Update
I have removed the NY traffic application from the market. It was an interesting experiment and I managed to get some nice refinements for the UK traffic application from it but I have to view it as more hassle than it was worth. NYSDOT do update the feed but only to add severe incidents like accidents and the like, otherwise it just looks like the data is old. This seemed to confuse the users of the application.
Android: gTraffic – Crashes
I have been getting reports of crashes with the latest version of gTraffic for Android. This is all a bit unfortunate and a bit of a surprise. It works fine on my dev phone but that has been updated to the 1.1 version of the SDK. I see there could be many reasons for this. I am loathe to roll back to the previous version as it has many annoying flaws which I fixed in the most recent. I will watch and see if the installs start to rise again and try and get some feedback as to whether it works for some people. If it works for you please email me or leave a comment.
Update #1
Well install didn’t start to rise again they just fell and fell. I am totally gutted about this as I didn’t mean to cheese people off. I guess the damage is done. I have withdrawn the app from the market until I can figure out what the hell is going on.
Update #2
I have rebuilt and re-deployed. Strangely the file size was different between the old and re-compiled version. I am clueless as to why. Let’s hope this has fixed it.
Android: gTraffic 1.3.5
version 1.3.5 is up on Android Market. This has a few improvements for stuff that was annoying me but not necessarily things people might have noticed.
- Empty list text centred on the view.
- Position indicator letter for region list.
- Position indicator letter for incident list. Letter maps to the first letter of the ‘location’ description which can be a road or a street.
- Map keeps position and zoom level after help display or settings is opened and then closed on the map view.
- Toast is killed is you exit the map view and one is displayed.
- Load is picked up and not aborted when keyboard is flipped open when loading.
Lots of nice comments. Thanks for that. In answer to those people asking about a U.S version I will have to look into it. The UK has quite a progressive agency for traffic management who are heavily into new technology and public dissemination of such travel data. The U.S is a lot larger and data tends to be supplied on a city to city basis. Also (and most significantly) it’s not generally free to use. I would have to strike a deal with what amounts to the local authority for the target region.
Android: gTraffic Published!
I finally got sick of working on gTraffic for Android and published it. There is still a ton of stuff I would put in but I have to get started on a commercial application.
Go to the Android market to download it. You can view comments here.
A bit hello to anyone surfing in here on their phone. Feedback always welcome.
Android: Traffic App – gTraffic
Side by side. You can see the Android app looks like it has pulled the more recent data.

I am still struggling with making an XML pull parser which extracts the data to the same degree of accuracy that the old Python parser did.
Android: UK Traffic
I am back working on my UK Traffic application. Here are some screenshots.
Loaded traffic list from selected region. Icons are for test purpose only. They will be redone once I iron all the wrinkles in the UI out. You will note they are coloured for severity. Parsing the TPEG data to extract this was a major pain as none of the Android pull-type parsers perform entity replacement which is what TPEG uses heavily to allow multi-language support. I ended up having to devise a two pass solution which parses the xml on the first pass then fills in the entities on the second. I load the entity definitions I am interested in from a local definition file on start-up of the application. It’s pretty clunky as a solution but sometimes you’ve just got to go with what works.

Master list of regions loaded only once on startup from BBC OPML definition.

Filter dialog lets you switch types on and off from traffic event view.

Android: Tracking applications
Those of you with an Android application on the Android Market may be interested to note that it’s possible to track the progress of your application at these two sites.
- Cyrket lets you view the Android Market application listings. It has the last batch of comments and a ranking system.
- Androidstats has something which I was looking for which is a historical record of application placings by rank
What is most fascinating is watching how an application moves up the rankings to find it’s place in the overall list of apps in the same category. I note that after the inital batch of downloads that my application Simple Weather seems to be levelling out. If Iam interpreting this correctly there is more of less fixed amount of people interesting in this sort of application. Having looked at it they decide to keep it or bin it. Last time I looked I was running at a 40% keep rate which I don’t think is too shabby.
I have noted the comments from people and adjusted the application. The font is a bit larger and I added the ability to change the temperature display to Celsius.