Is mobile video-calling a device thing?

Ever since I’ve been involved in the telecoms industry, it seems that people have been proposing video calling as the next big thing that will revolutionize person-to-person calling. Of course, the industry has been proposing it for even longer than that, as this video from 1969 shows.

[youtube]http://www.youtube.com/watch?v=qqtoVmACDng[/youtube]

One thing not anticipated by that video is mobile communication, and video calling was meant to be one of the leading services of 3G mobiles. When 3G arrived in Australia in 2003, the mobile carrier Three sold its 3G phones as pairs so that you’d immediately have someone you could make a mobile video call to.

Needless to say, the introduction of 3G didn’t herald a new golden age of person-to-person video calling in Australia. So, despite all the interest in making such video calling available, why hasn’t it taken off? I’ve heard a number of theories over the years, such as:

  • The quality (video resolution, frame rate, audio rate, etc.) isn’t high enough. Once it’s sufficiently good to be able to easily read subtle expressions/ sign language gestures, people will take to it.
  • The size of the picture isn’t big enough. When it is large enough to be close to “actual size”, it will feel like communicating with a person and it will succeed.
  • The camera angle is wrong, eg. mobile phones tend to shoot the video up the nose, and PC webcams tend to look down on the head. If cameras could be positioned close enough to eye-level, people would feel like they are talking directly to each other, and video calling would take off.
  • People don’t actually want to be visible in a call, for various etiquette-related reasons such as: it prevents them multi-tasking which would otherwise appear rude, or it obliges them to spend time looking nice beforehand in order to not appear rude.

But despite the low level of use of video calling on mobiles, there is one area where it is apparently booming: Skype. According to stats from Skype back in 2010, at least a third of Skype calls made use of video, rising to half of all calls during peak times.

One explanation could be that Skype is now so well known for its ability to get video calling working between computers that when people want to do a video call, they choose Skype. Hence, it’s not so much that a third of the time, Skype users find an opportunity to video call, but that a third of Skype users only use Skype for video. Still, it’s an impressive stat, and also suggests that super-high quality video may not be a requirement.

Certainly, I’ve used Skype for video calling many times. I’ve noticed the expected problems with quality and camera angle, but it hasn’t put me off using it. I find that it’s great for sharing the changes in children across my family who are spread around the world, and otherwise difficult to see regularly. But a tiny fraction of my person-to-person calls are Skype video calls.

However, I’ve ordered an Apple iPad 2 (still waiting for delivery) and one of the main reasons for buying it was because of the front-facing camera and the support for video calling. I am hoping, despite all of the historical evidence to the contrary, that this time, I am going to have a device that I want to make video calls from.

The iPad 2 seems to be a device that will have acceptable quality (640×480 at 30fps), and it is large enough to be close to actual size, but not so large that the camera (mounted at the edge of the screen) is too far away from eye line. So, they may have found the sweet spot for video calling devices.

If you know me, be prepared to take some video calls. I hope that doesn’t seem rude.

Child brutality in black and white

This month’s book-club book is again a work of post-apocalyptic fiction. Perhaps we have a preference for stories about screwed-up worlds. I don’t know what that says about us.

The Hunger Games

Teenage girl gladiator fights for family in deadly reality TV show

This novel by Suzanne Collins is a light read on a dark subject. The Hunger Games is a reality TV show where randomly chosen youngsters battle each other for glory and to placate the state. How to write a tasteful story about children killing each other? Collins tries to walk a fine line between glorifying the violence and keeping the moral perspective. I’m not sure she always does it successfully, but she doesn’t stray too far into unhealthy territory.

I found it difficult to classify the book. It has fate handing down violence for the amusement of others, as in Gladiator. It has children trying to out-game others, as in Enders Game. And it also has the post-apocalyptic game show element of The Running Man. And it has a female lead. So, if you can imagine all that, then it’s something like the feel of this book.

While I found the book itself enjoyable, especially towards the end, I had trouble immersing myself in the story. Perhaps because it focussed more on the characters’ predicament than the characters themselves, or because the protagonist Katniss is so analytical herself, or maybe because of the gruesome game, I didn’t find myself empathising with the characters.

Rating by andrew: 3.0 stars
***

Why some scientists diverge from the mainstream

A while ago, a friend sent me a link to an article by Richard Lindzen as an example of a respectable scientist who sits on the “skeptical” side of the fence in the global warming debate. At the time, I noted that Lindzen was also known as a skeptic of the link between smoking and lung cancer, but aside from thinking it was an interesting coincidence that he fell twice into the skeptical camp on such emotional topics, didn’t ponder it much more.

However,  recently I listened to a lecture by Naomi Oreskes (presumably connected with her recent book) where she provided a possible explanation of the link between the two views that also can explain why a respectable scientist is willing to diverge so far from the mainstream position.

We don’t hear debates about whether the sun-goes-around-the-earth or the earth-goes-around-the-sun any more. There isn’t disagreement on whether driving a car is dangerous, or whether excessive sun-baking increases the chance of skin cancer.

But when it comes to climate science, there is a very visible debate. If there was a clear split in the climate science community, that would be one explanation. Although, all major national science academies fall in the climate change believer camp, and in an essay in Science, Oreskes found that of 928 randomly selected abstracts on climate change, exactly none argued against the idea of human-influenced global warming. (Other similar studies can be found listed here.)

I’m not interested in discussing here who is right or wrong, but noting that the respectable scientists who are arguing a skeptical position regarding climate change are a small group indeed. It’s not a bad thing for science that they exist, as educated debate improves our body of knowledge, and such a debate needs people on both sides. However, it must be a tough job for the individuals involved. It’s natural to wonder why they would do it.

Due to the politicisation of the field, and the implications for certain industries depending on resulting policies, I’m not surprised that scientists who argue against climate change are effectively given a megaphone. On the other hand, I would be surprised if this was a sufficient reason for respectable scientists to adopt positions that they didn’t believe.

Oreskes proposes that the reason is: many scientists in the skeptical camp are fierce believers of capitalism and the free market. Hence they will naturally assume that any argument leading to a conclusion of greater industry regulation must be wrong, and will look very hard for the flaws in it.

An example of such a scientist, according to Oreskes, is Fred Singer.  Not only is he a climate change skeptic today, but in the past has been skeptical of the link between (second hand) cigarette smoke and cancer.  In the case of second hand smoking, he was arguing against the US EPA‘s desire to regulate smoking.

So, perhaps this applies to Lindzen as well. In that case, his skeptical views on both the dangers of smoking and climate change are not co-incidental at all.

Of course, if scientists all agreed on everything, then we wouldn’t need scientists. But I find it interesting to understand what might motivate scientists to disagree when it must seem like the whole scientific community is in agreement against them.

Someone needs to invent …

… a tiny, highly directional speaker that can be used in portable devices like laptops, tablets and mobile handsets.

Given the helpful comments that I got last time I made a wish for a product, directing me to exactly what I was after, I am hoping that I’ll get lucky again. But I’ve searched around, and I fear that it doesn’t (yet?) exist.

Normal speakers in portable devices are unsuited to a shared environment when I’m going about a personal activity. For example, if I want to watch a TV program on my laptop, while my wife watches some video on the iPod on the couch next to me, we are going to interfere with each other, making it difficult for either of us to listen to our shows.  Similarly, in an office environment where people are sitting on adjacent desks, it would be great if the sound from any one computer wasn’t audible to the rest of the office. Or alternatively, where many people are on a train and watching video or playing games on their portable devices, reducing the interfering noise would be appreciated.

Headphones are unsuited to both “snacking” type tasks (pick up the device, do something quickly, put it down again) and where a camera is used (as in a video call). If I have to stand up, put down the device, find the headphones, connect them, put them on, then sit back down every time I find I want to watch a video, the result is that I don’t watch videos. And in a video call, while the trend is more and more towards an almost “present” level of quality, seeing the other party wear headphones pretty quickly breaks the illusion. Needing peripherals, such as headphones, usually indicates a compromised experience.

Even if the audio quality is relatively poor, I would still rush out and get a portable device if it had the ability to produce directional audio. I don’t necessarily need high fidelity for watching online video or making a video call.

It appears that the basic technology needed for this sort of speaker is an array of ultrasound generators. You know it has got to be awesome technology if it uses something called ultrasound, right?

From the details on the Explain that Stuff! website, it seems that basically two (ultra) high frequency audio signals are produced, and it is the beat frequency between them that is the actual audio that you hear. Because the frequencies are so high, they are highly directional.

I have found only one product on the market that uses this approach – the American Technology Corporation HSS-H450 – which is a foot long and available for the bargain price of US$1,069.62 (strangely, that’s a UK site).  Meanwhile, I have come across a kit that might be used to make your own (if you’re more talented than I am at electronics). Alternatively, there are some less-than-ultrasonic but still directional speakers that I’ve found from Brown Innovations and Dakota Audio. But neither would suit embedding in an iPad, let alone an iPod.

So, I continue to wait and hope…

How unexpected are 1-in-100 yr events?

I was chatting to someone about once-in-a-century events, and I was reminded of a book I read a while back which pointed out that understanding probability is a pretty recent thing. In fact, there haven’t been that many centuries in which people could talk knowledgeably about 1-in-100 years events.

(I should probably put a disclaimer right here that, just as it seems any public post  about poor grammar is bound to be riddled with grammatical errors, my post about probability is going to be full of  mistakes. So, I promise to fix them, if they are pointed out to me.)

A funny thing about 1-in-100 year events, like 1-in-100 year floods, or storms, or market busts, is that they can appear to come along more frequently than once every hundred years. But it looks like we’re stuck with the name.

A 1-in-100 year event is simply one that has a 1% chance of happening in any particular year, which means that, mathematically, you would “expect” there to be one, on average, every hundred years. But of course, some centuries will have more or less of them.

In fact, (making assumptions about the distribution of events,) you would expect 37% of centuries to never have a particular 1-in-100 year event. You also get exactly one 1-in-100 year event in around 37% of centuries. The rest (26%) have more than one.

While more than a quarter of centuries can see multiple occurrences of a 1-in-100 year event, it’s worth asking: how many times can such an event crop up in a century before you start to wonder if it’s really still a 1-in-100 year event. How many occurrences of 1-in-100 year events should you actually expect?

The answer depends on the threshold for unlikeliness. A reasonable standard might be that anything less than 5% probable is pretty improbable. Back in high-school, playing D&D role-playing games, throwing a 20 sided die and getting a 20 (i.e. a 5% chance) was enough to get you special results. It came up a few times every game, but it was something pretty unlikely indeed. So, let’s use that standard for now. (It’s also common elsewhere.)

So, how many occurrences of a 1-in-100 year event in a single century are needed before we get to a level that’s less than 5% likely (or, you would expect to occur in less than one century out of twenty)?

The answer is 4. It’s only when you get four of a 1-in-100 year event happening in the same century that you might want to start questioning whether something else is going on, because it’s all starting to get a bit improbable. Four or more of such an event should crop up in less than 2% of centuries.

So, in summary, you shouldn’t be shocked to see three of a 1-in-100 year event occur in the last hundred years – it’s perfectly expectable.

The Future, as feared by Fforde

Our  book-club book for the month is Jasper Fforde‘s most recent novel for adults. Not sure if I’m going to make it to book club this month, but anyway, while the book is still relatively fresh in my mind, I wanted to jot down my thoughts about it here.

Shades of Grey

An intriguing post-apocalyptic world with some novel ideas

Jasper Fforde is better known for his literary comedy books, which provide a post-modern take on the some traditional genres, like nursery rhymes. This book is a departure from that, so existing fans may not find it quite to their liking. This is, in essence, a science fiction novel: a story set in post-apocalyptic world.

There are still some comedic elements, and there is a hint of romance, but foremost this is a display of Fforde’s inventiveness. For example, in this speculative future, the characters live in a colourtocracy, where association with certain colours relates to a position in the class structure. One might consider the result to be the dystopian love child of George Orwell and Roald Dahl.

While the world itself is fascinating, and learning more about it was the impetus to keep reading, the main character was a bit of an empty shell. I didn’t find anything particularly likeable or admirable about him, nor anything repulsive either – he just stumbles along through the plot, primarily pushed along by other characters’ agendas.

Finally, it is worth noting that this book is the first of a trilogy, and the other books aren’t written yet. This was something not immediately apparent from the cover of the edition that I was reading.

Rating by andrew: 3.0 stars
***

Three is not the magic number

About a week ago, Demographia published their 7th Annual International Housing Affordability Survey. They picked up some press for finding that Sydney was the least affordable major housing market outside of Hong Kong, and Melbourne wasn’t that much better. Both were labelled “severely unaffordable”.

And while there is some irony in using the term “unaffordable” to describe the prices at which actual sales occurred (in any case, I agree that Australian capital city houses are expensive), it is the methodology of the survey that I want to nit-pick. It is based on a ratio that Demographia call the “Median Multiple”, which is calculated by dividing the median house (i.e. not apartment) sale price in that market for that period by the median household income for that market at that point in time. Apparently, such a measure is endorsed by such august bodies as the UN, the World Bank and Harvard.

I have previously talked about the mistakes that can be made in comparing two different medians, and it should be clear that there is no reason to assume any particular relationship between (say) today’s median Melbourne household income and the median sale price of a house in Melbourne over the last quarter. Ideally, the median should be calculated on the set of individual house affordability ratios, rather than a ratio calculated from the medians of two somewhat independent sets.

But the major issue I have with the report is that it picks, seemingly out of the air, the value “3.0” as value that separates unaffordable markets from affordable markets, as if it is some kind of universal constant. In fact, the value seems to be chosen principally because, in the past, affordability ratios were less than 3.0:

As Anthony Richards of the Reserve Bank of Australia has shown, the price to income ratio was at or below 3.0 in Australia, Canada, Ireland, New Zealand, the United Kingdom and the United States until the late 1980s or late 1990s, depending on the nation.

In fact, it should be clear that in a country like Australia, and specifically in cities like Melbourne, you would expect their Median Multiple figure to generally increase over time. Hence, there is no constant value that can be used for this ratio to indicate whether the housing market is out of whack.

For the Median Multiple to increase, basically median property values need to grow faster than median income. From my point of view, there are two obvious drivers for this growth to occur.

1. Gentrification

The Australian Housing and Urban Research Institute (AHURI) recently published a report on the gentrification of Melbourne and Sydney. (Essentially, this is when the existing residents of an area are displaced by a wealthier demographic.) For Melbourne, the regions of Maribyrnong and Northcote were identified as undergoing gentrification.

In such cases, property prices rise because people with higher incomes move into the neighbourhood. Actual incomes don’t necessarily rise at all – it’s just people moving around.

When an area has little ability to accommodate the displaced, e.g. through supporting greater housing density from subdividing lots or building apartment blocks, they need to find somewhere else to live. According to AHURI, displaced residents commonly relocate to an adjoining suburb (e.g. in 44% of cases of employed renters or 38% of owners). As they note, this in turn creates a “rippling effect” of gentrifying another region, and then another.

2. Trading Up

A major constraint to purchasing property is the ability to borrow money. First Home Buyers feel this pain worst of all, because (unless a significant deposit has been saved) they typically borrow between 80-90% of the  purchase price.

However, everyone else in the market (by definition) has already purchased a home. So, when trading up, any additional amount to be borrowed will depend on the difference between the value of the current property and the value of the next.

Since banks limit the amount they lend based on a household’s income levels, clearly if a purchase relies principally on borrowing, it will be constrained by income level. But, if a purchase makes use of the equity in an existing home, it can go beyond income level.

Admittedly, this requires property values to grow, in order for the home owner to build up equity. So, it’s somewhat circular to argue that growth in property depends on growing property values. However, the growth in equity is typically much faster than the growth in the underlying property value, which is why subsequent properties can be purchased at a level equivalent to growth faster than income.

For example, a property purchased on a 10% deposit will, after five years, have had its equity grow the equivalent of about 30% per year, if the underlying property value grows just 5% per year for that period (assuming the mortgage isn’t paid down at all). Or more specifically, a $400k property on a $360k mortgage will end up as a $510k property with $150k of equity under those conditions. If the household income has also grown during that period, then the mortgage that could be serviced at the same level (as the mortgage at time of purchase) will have grown at the same rate. Putting that together with the increased equity is how the purchase price of the next home grows faster than income, while keeping the portion of income used to service the loans at about the same.

Australia has a large proportion of home owners as possessors of property. The recent AHURI policy bulletin on Australia’s changing patterns of home ownership noted that the home ownership level continued to remain around 70% of the population. Together with tax treatment that allows home owners to sell their property without any tax implications (versus, say, investors who would be up for GST), this creates an environment where trading up is encouraged.

Concluding remarks

So, if you’ve read this far, you’ll hopefully now agree that the Median Multiple price-to-income ratio is likely to increase over time in Australia, and hence there is no constant level of affordability that relates to it. 3.0 is not the magic number of affordability.

To conclude, I will leave you with a graph from an RBA speech on housing costs showing how, as you’d expect, the  price-to-income ratio for Australian property has fluctuated, but trended up over the last 15 years (blue line).

Another tweak to the blog

WordPress can be frustrating. It’s the software that I run my blog on, and while the fact that it’s open source gives me the option to tweak it, I would rather that I didn’t constantly need to tweak it.

They have an impressive release cycle: in the last two years there have been three major releases and twelve minor releases. Any of those releases has the potential to break things, or at least render things obsolete.

While having a WordPress plugin of my own means that I have knowingly signed up to this sort of pain, it also applies to my ordinary usage of WordPress which I host myself, as any of the plugins I use may break upon an “upgrade” or my theme may need some editing to keep it in sync with the now-available features.

I picked up my current theme in 2006 – I think it actually dates from 2005 – and it predates a number of WordPress features that are useful to me. Over time, I have added into it: widget support, compatibility with the new image editor, avatars, favicon, and OpenID.

Ever since I criticised Facebook for not being able to reply to specify comments (also known as “threaded comments”), I’ve meant to enable this WordPress feature on my blog. This weekend, I finally got around to implementing it, thanks to others who have previously documented clearly how to do it. It was relatively straightforward, but did require changes in a number of places across several files.

So, if you’ve been waiting for an excuse to write a comment on the blog, then helping test drive this new tweak could just be it!

Division of Labour

It’s something that I think all couples, and in particular, all parents grapple with: how to fairly divide up the housework. I know that some of my friends have also written about it.

One of the best things I’ve ever read about the division of parenting and housework between the sexes was on the New York Times, and if you’re interested in the topic, I recommend you go read it right now. It’s well researched, balanced and insightful.

And in that article, there’s a reference to something that blew my mind. It’s research done by Professor Esther Rothblum at the San Diego State University. Rothblum’s work, published in 2005, compared the amount of hours spent on housework between the sexes, taking into account whether they were gay or straight.

Given that the typical study into sharing of housework finds that men spend much less time doing housework than women, I expected that heterosexual men also on average spend less time doing housework than homosexual women, or even homosexual men. However, that’s not what Rothblum found when she looked at gay and straight couples’ division of labour.

The research concluded that on average 6-10 hrs of housework per week was performed each by lesbians, gay men, and straight men, and 11-20 hrs per week for straight women. (“6-10 hrs” and “11-20 hrs” were different responses in a survey.) A corollary would be that heterosexual couples spend more time in total on housework than gay couples.

Why might this be so? It’s not clear. Rothblum doesn’t go into that aspect in her study, as she seems more interested in the relative share between partners than the absolute numbers.

However, some possible explanations that come to mind are:

  • There may be some kind of cultural pressure that applies in the female heterosexual community, but not in the homosexual community or the male heterosexual community, that requires women to keep their house to a higher standard. (But can such communities be distinct enough for this effect to have significant force?)
  • When straight couples have children, it is known to reinforce traditional gender roles, resulting in women spending more time on household duties than they did prior to children. Perhaps gay couples are less likely to have children and this reinforcing effect is then less likely to occur.
  • Straight men may be, on average, so bad at housework that more time is required by straight women to keep a house to the same standard as that of a gay couple’s, even when straight men spend the same amount of time doing it as, say, gay men. (But if they are “practicing” for the same amount of time each week, why would they be worse?)
  • Men are likely to overestimate the amount of time spent doing housework on a survey, and surveys were used in this research. But does this apply only to straight men and not to gay men?
  • About 200 people in each category were surveyed, and perhaps not enough people were included to get a representative result of the whole country. Although, the women’s results were statistically significant (p < 0.0005).

Still, this is a counter-intuitive finding, and it would be interesting to see if other research reinforces the conclusion. If valid, it may go some way toward defending (heterosexual) men against the charge of not pulling their weight around the home.

But in any case, these results describe average situations across a large number of couples. There’s no “right” figure, of course. Every couple needs to find their own balance, taking into account their own unique circumstances. Which is why, I guess, it’s interesting for us all to write about it.

A Java ME coder looks at Android

I’ve had a long association with Java programming.

I started playing around with Java software development back in 1995, before the platform was even released as version 1.0. In 2001, I got my hands on a Siemens SL45i handset and began to develop using Java ME (known as J2ME at the time), a cut-down version of Java for embedded devices such as mobile phones. For a time, I worked for mobile games developer Glu (known as Macrospace at the time) porting games to different Java ME handsets.

That’s all just so I can say that I got to know a lot of the ins and outs of doing Java development for mobiles. Although, I haven’t really done much of that recently, and these days Java ME has fallen out of favour, with the rise of smartphones that support other software platforms. However, Android-based smartphones are now becoming popular, and Android applications are written using Java.

So, I was rather curious as to what developing on Android was like, and over the last couple of months, I’ve spent an hour or two every 2-3 days tinkering around with an Android project as a hobby. This was my chief diversion during the weeks after our daughter was born in November.

I didn’t do an Android course or read an Android book. I simply took what Google provided on Android and ran with it, to see what I would learn.

Getting going

Google makes a lot of really good information and tools for Android available for free. I was able to easily set up a development environment on our laptop (an old Dell Inspiron 1501). Unlike if I’d been developing for, say, the Apple iPhone, I didn’t need to get a specific brand of computer, nor pay anyone to join their development program. In fact, they even make the full source code for Android available if you want to see how it works under the hood.

It made me think how empowering this is for people. In years gone by, if you wanted to tweak your car (or even build a car up from parts), you could easily get access to the information and tools to do it yourself. For modern cars, that’s not really the case. However, it is the case for your modern mobile phone, and given how important a tool it has become in our daily lives, that’s a really liberating thing.

In fact, our particular laptop has a comparable amount of grunt to a modern mobile phone (such as an HTC Desire), so it’s no wonder I find myself doing more tasks on a handset rather than this laptop. In addition, while with Java ME, it was common to test the software on an emulator (e.g. running on the laptop) before loading it onto a real device, but here, the inability of the laptop to emulate a modern handset at anything like real speed made that impractical. Also, the Android adb tool does a great job of exposing logging and debug information in real-time from devices, so there’s no real penalty in testing directly on the device.

Also due to the lack of grunt, rather than using the normal Eclipse development environment, I ended up using the much more lightweight ant and vi tools. Not very pretty, but fast on my machine.

Developing

Android development is theoretically done using the full Java SE, rather than the cut-down Java ME. While it is true that there is a lot more power and flexibility in the hands of developers than there was for Java ME, there are still a lot of wrinkles that make it unlike full Java SE.

Three examples of these wrinkles are:

  1. AndroidManifest.xml: This is a text file that is included in every Android app, and basically describes how the system should interact with the app. Instead of this being specified in the Java code, it needs to be separately documented here. For example, it specifies which icons appear in the list of launchable applications and which classes should be invoked when those icons are selected. It also specifies how other applications on the device might interwork with the app.
  2. Activity-oriented architecture: Every Android app is basically broken into components of four different types. These are the Activity (an interactive screen of some kind), Service (an invisible, background task), ContentProvider (a database-like interface to some content), and a BroadcastReceiver (waits for a system-wide event to perform a task upon). These components communicate with each other using a type of message called an Intent, which is typically a URI and some associated metadata. (My small hobby application used a ContentProvider, a Service, and several Activities.)
  3. Dalvik Virtual Machine: Instead of compiled Java bytecode running on a Java virtual machine (the typical approach for Java SE), the compiled Java bytecode is converted into Dalvik bytecode and that is run on the Dalvik virtual machine. This is a pretty clever way to allow developers to reuse the well-known Java tools but allow the Android system to operate outside of them. However, as the Java to Dalvik conversion doesn’t have full knowledge of the original source code, it seems to find it difficult to optimise things automatically, and leads to strange advice like manually copying class fields into local variables to make execution more efficient.

Another interesting thing, from a mobile developer perspective, is that Android manages a “stack” of screens (Activities) in a similar way that was done for the old WAP/WML 1.1 browsers (and HDML browsers before them). The developer can push screens onto the stack in various ways, while the user hits the back button to pop them off. Given that this approach was dropped from the newer versions of WAP (and in the newer mobile browsers that followed), it is with some nostalgia that I see it come back again. However, it does make a lot of sense for mobile handsets and their small screens (i.e. the impracticality of having several windows open side-by-side).

Difficulties

While the Android SDK gives the developer a lot of power, it wasn’t as easy to use as I’d hoped. Not that Java ME was easy, by any means, but Android’s design and development has probably resulted in some strangeness that Java ME avoided.

You have to remember that Java ME evolved in a (some would say ponderously) slow fashion. It was effectively the product of a standards organisation, with a lot of smart minds spending time arguing about small details. For example, while JSR-37 (the original specification of the version of Java ME for mobile phones) was published in September 1999, it took until August 2002 for the specification for sending a text message to become available (JSR-120). The final result was typically elegant, consistent with overall Java ME design philosophy, and extensively documented. But you didn’t want to hold your breath for it.

I was developing to Android v2.2, which was the 8th release of the platform (not counting revisions). There had been five separate releases of the platform in the previous year (from the 3rd release in April 2009 to the 8th release in May 2010). It has been evolving very quickly, so I wasn’t too shocked to find things worked in unexpected ways.

I found the Android API library to be a bit confusing. Classes weren’t always in the packages that I expected to find them. For example, while Activity and Service are in android.app, ContentProvider and BroadcastReceiver are in android.content. Also, some UI elements are in android.view and others are in android.widget. And while some standard icons were available as constant values, others needed to be copied as files out of the SDK.

The Activity-oriented software architecture also took a while to get used to. It turned out that although one method I tried to use (startActivity) was available on some classes (such as a Service), they would throw an error if called because they were only meant to be called from particular components (an Activity, in this case).

Additionally, while ordinarily an application runs in a single process, it uses a number of threads. There is one special thread called the UI Thread. Again, one method that I tried to use (showDialog) was available in a class, but silently failed when it was called from a thread other than the UI Thread. In practice, you need to use an Android construct called a Handler to pass messages from one thread to another to allow the right thread to invoke the right method.

Also, seemingly harkening back to the days of Java ME, the media library seemed to have frustrating bugs. One API call I was expecting to use as documented (MediaPlayer.setDataSource) turned out not to work at all, and that I had to specify a FileDescriptor rather than a file path to load a media file. Also, another API (MediaPlayer.getCurrentPosition) returned completely erroneous values, and I had to develop a work-around. Thank goodness for StackOverflow in both these cases.

Conclusions

In the end, I got my little app working nicely. It was very satisfying to find that there was the ability to effectively add a new feature into my phone.

In that sense, Android gives user-developers a lot of power. And while I was expecting it to be a straightforward Java SE like development exercise, I discovered that it had a lot more in common with Java ME development. I had hoped that such platforms would easily attract the large pool of desktop developers, but it seems that there is still a mobile-specific learning curve that a developer will need to go through, and this will shrink the available pool of expert developers.

That said, I hope that Java developers will take a look at Android and see what kind of features they can innovate on top of it. As for myself, I hope to find the time for another hobby project again soon.