I’ve been messing around with Android Fragments for the past couple of days and just wanted to bung up some early screenshots and get some feedback. The screenshots shown are from a G1 running 1.6 and a Samsung Tab 10.1 (confusingly framed in a Motorola Xoom).
Seeing the changes of a platform which has grown to handle various screen sizes, various OEM alterations, various API tweaks, re-writes and now devices types has been an exciting, albeit challenging experience.
I’ve had the fortune of working with some of the best Android developers out there, but keeping on top of all of this is a must and unfortunately only experience can account for a lot of quirks in Android.
There’s been a number of times where I’ll moan about the method of achieving a task in android despite there being seemingly no reason to alter the initial attempt. Examples of this include:
‘this’ vs getApplicationContext(). A large number of examples when Android first came up passed ‘this’ around when a context was needed. This was later addressed by Romain Guy as being an easy way to cause memory leaks. But the problem is it’s easy to miss these posts and the only time you’ll need to read it is when the application starts to act in weird ways, not really giving an indication that this is the cause.
ViewFlipper. There was a very subtle bug in ViewFlipper where it causes a force close after a few orientation changes / moving between activities. The fix was simple, but it was an easy one to miss and release into wild.
Helper classes like AsyncTask & ListViewActivity. I will openly admit that this one is largely personal preference but I will still chuckle if anyone discusses the issue with me and later finds it would of been easier if they had taken the initial hit of more work. Starting with the ListViewActivity, I see little point is using this, the code saved in finding the ListView from the layout seems so trivial it is easily out weighed by the fact you can no longer extend a different class. As for AsyncTasks, the code has a great deal of boiler plate and doesn’t really simplify things (From my point of view). But the real issue is you lose freedom to spin off other threads if you need to. Al Sutton did a great talk at Droidcon 2011 on Android multi-threading.
Tiling Bitmaps. I’ve found numerous posts where people have had issues with tiling bitmaps. Again this is one of those bugs where even though the majority of the time it works, the odd once or twice it files and you end up with a stretched image. The solution, again simple, request the tiling in code instead of XML.
Back to my point, a lot of things I do in Android is a result of experience and learning off of others.
I regularly try out new things in Android and try to forget some of these issues in the hope that they are resolved. This is only ever done when I’m producing examples, where a force close caused by a bug in the Android source isn’t a real concern.
Today I’ve been working on one of the simplest app’s I’ve ever worked on. A Kitchen Sink application for Android, the main aim of which is to make themes quicker and easier as well as cover off most of the scenarios of input and state.
I’ve not done much work with Android Fragments and been using this app as a learning experience. But it has revealed an extremely old pet hate.
The Dialog.
I’ve spent a few hours hitting my head against a brick wall figuring out why displaying a DialogFragment and then rotating the device would cause a crash.
The answer was to simply not add the fragment in XML, but add it in programmatically.
These kind of issues scare me. I tend to create bespoke Dialog’s in my own app’s to keep in with a heavily customised UI, but for client code I will tend to opt for the Google code base. With bugs like these, where the outcome is determined by such a fundamental decision, it’s shows Androids infancy.
Android began to stabilise a lot before the release of Honeycomb. Now with the release of Ice Cream Sandwich I get the impression more of these bugs are going to surface. Fortunately the issues will be found faster than ever before thanks to the thriving community of developers.
Another post on Little Printer? Yeah, you guessed it
I’m not going to say much on it apart from a congrats to Berg for releasing it, it’s a fantastic looking product and I’m looking forward to getting my hands on one and secondly the reason I like this is because it’s moving away from digital.
It’s a bit of a weird thing to suggest (especially for an app developer), but a small chunk of paper I can grab in the morning, with all the bits of info I need for the day, that’s pretty handy. The main reason I think it’s going to be successful is because the output is something physical.
It’s easy to believe that everything should be in the cloud and to be honest I keep the majority of my content in cloud. At the end of the day I don’t want to worry about back-ups and how to access content when I’m away from my usual computer. However, with this mentality comes a sense of letting go of all things physical, paper notes, CD’s, DVD’s, even hard drives, but should that be the case?
The root cause of my interest stems from the loss of physical attributes which occur when shifting to the cloud. This was peaked during a completely different discussion about applications like bump with one of my close friends Andy Coghill, who has a background in product design.
After starting a conversation around substituting a physical business card for a digital one, the first thing Andy focused on was the loss of touch.
Taken back I probed further questioning why he didn’t like the idea of things like NFC, QR codes or bump, thinking NFC was the most natural way to do it and Andy simply moved onto to push that touching, feeling and owning that card was far more powerful. I had to agree. My software engineer background went to the toolbox and found the usual tools of the trade, cloud computer, NFC & mobile devices. His product design background went to the toolbox and found the materials, the user perception and everything he knows and loves.
Now consider Little Printer, you can see how that might apply. Having a physical receipt sized piece of paper with the vital bits of info you need for the day has a number of physical properties that you could easily overlook. All this printer offers is a link between the cloud to the physical, something which has been overlooked all too much these days.
I’ve been working with team Phaedrus at Future Platforms HQ to develop the Qt version of LastMinute.com’s hotel booking application.
Being one of the first Qt projects I’d worked on, I was amazed at how easy it was to get to grips with Qt Quick, Nokia’s technique for developing applications in QML and Javascript.
After the application was finished Nokia asked if we would be happy to talk about our experience developing with Qt and you can see the result below.
The site was looking a little bit outdated and it wasn’t quite fitting my needs:
I struggled to adding sections to the site at a whim, at least now it consists of small chunks of content I can add, edit and remove.
It was old and looked it
I wanted an excuse to play with a little HTML5
I wasn’t particularly happy with the format of the blog and hopefully the simplified look and feel will encourage me to post on a regular basis.
If you find any problems with the site please give me a shout, otherwise go and check out gauntface.co.uk and enjoy the blog.
p.s. I’m sorry for out right blocking users of IE9 or less . . . . but unfortunately I don’t want to cater for such a small portion of my visitors by building vasts amount of backwards compatibility.
It’s that time of year when all the conferences are a go and if you’re an Android developer the key event you should have in your diary is Droidcon UK 2011.
I attended the second day of the event last year (Was in project deadline mode for the first day unfortunately) and thoroughly enjoyed it. Judging by the speaker list so far it should be an unmissable event.
The main talks I’d personally have on the top of my list: Richard Hyndman & Nick Butcher from Google, Mark Murphy form CommonsWare, Yosi Taguri from BlueVia (interesting revenue share opportunities with telefonica) and Kieran Gutteridge.
If you’ve not been to this or any of the Londroid events, this is a great event to get to know some of the people in the Android community and I’m quite excited to see how much larger the community has grown.