abstractwankery.com
taking it to the next level
Lifecycle of an Android Application
Posted by Nick at 1:58 PM
Every time I get a new gadget, something possesses me to try to write an application for it. It's happened with dang near everything since the Newton, yet only a few gadgets have ever had a finished project. I tried the hardest on Symbian, but never came up with anything useful. I'd like to blame the SDK, but you should never blame your tools, no matter how much they completely sucked.

In October of 2008, a brand new T-Mobile G1 arrived via UPS, one of the first Google Android devices to hit the market. I had always owned smartphones, whether they ran Windows Mobile or Symbian (S60 or S80), but I wanted to get something that was easy to develop for, and would work well on my network. So, Symbian was out (hated the SDK), iPhone was out (Just started supporting apps, plus no one wants to be on AT&T), Blackberry was out (SDK even worse). Android seemed like a really neat, but young option. Being on the bleeding edge never scared me, it just usually screwed over other people.

So, approximately 3 days after receiving that G1, I downloaded the SDK, and started to use my extremely rusty Java skills to bang out a LiveJournal client for Android. It's not as though I still really used LiveJournal, but I felt like it'd help me try out all of the neat APIs in Android. Web services, location tracking, image capture and manipulation, they were all there and usable. A shell of an application started to emerge around a series of mocked up layouts, and I was able to hook up login, posting, preferences, and user pictures in a short amount of time. ElJay was born, and I even wrote about it here. I'm amused at how proud I was that it was pretty complete after a few days -- because it shows. Since I decided to dive right in instead of going through tutorials and example applications, it was subject to many of the first time Android developer errors. Screen rotation would lose settings, or interrupt a login, or interrupt a post. Web activity would throw exceptions that I never caught. Nothing was in a service, so switching applications or views would interrupt the same interruptables as above. Everything I did was in onCreate, so switching back to the application after Android cleaned house meant that someone would have to log in again. Sometimes, state wasn't kept, so you'd post to no account at all. It was a barrel of laughs. I updated and updated until it was a mess of spaghetti code and generic exception catching. Android 2.0 finally broke it, and I didn't care for a while.

I eventually pulled it from the market.

... until the screams entered my inbox.

A few weeks ago, I recommitted to ElJay, but instead of running through to try to fix it, I made the best and worst choice I could make, and started over. This time, I started it as if I were doing one of my Perl-based web applications, or writing a desktop application -- I started with the back end. My first task was my XML-RPC interface, followed by my LiveJournal model. I created a unit test suite for those external interfaces. I created a suite for all of my display controllers. After a while, I got to the point where I had a decent unit test suite, and a few test accounts that passed the unit test suite. This process took a lot longer than the "few days" it took to bang out the first version, but from a system level, it worked well. It also helped me solve a long-standing bug I ran into in the first version, where the default Java XML library used by Android doesn't handle some output from LJ very well. Hey, I could have saved myself from a rewrite! ... Nah.

Tangent.

Only then did I start working on the user interface. This time, I could actually plan for exception handling, threading, the external service, the sync API, even basic user interaction. It also honors resolution independence properly, since I'm no longer using pixels as measurement. :P It's amazing how much more confidence I feel in this application -- not that I believe it's bug free or foolproof, beta testing will prove that wrong within minutes -- but that I can easily work with it, fix issues, and section pieces out for later. Things are getting really close now, and the beta rolls out in less than two weeks.

For those keeping track, the first version allowed posting with user pictures, security options, tracked your location, worked with tags and moods, and allowed you to save entries for later. The new one does all of that -- and well -- but also adds friends list support, attaching photos to your posts, and with any luck, manage your messages. I'm also throwing ads in, but they're optional.

It does live.

1 comment
It's been a while, since...
Posted by Nick at 2:17 PM
I know, I know, I'm a terrible blogger. I've all but ignored this blog, and given up on LiveJournal as well. The last couple of months have been insane on top of insane, but I'm finally digging out of it. Between dealing with Christmas, dealing with minutia and fallout from moving here months ago, and a second contract that I really shouldn't have taken, I've had absolutely no free time. This means no side projects, no new shiny things, and no blogging.

That being said, it is now 2009, and I have a whole list of things I want to get accomplished right now. My wife is in Russia for two weeks, so I now have no excuse for not doing any of it. My first priorities are my abandoned Android application and whatthefuck.com.

ElJay is going to see a new release in a few days fixing a lot of the difficulties people are having. There's a 25% reduction in memory use, a huge increase in speed and responsiveness, and seems to take care of much of the network connectivity issues people have been coming up with. Once that's out, work will begin on a new application that posts not only to LiveJournal, but any LJ-based site, Movable Type, Wordpress, or Blogger site. It's the number one feature request besides specific LiveJournal stuff, so there will be some parallel development. I will likely be maintaining both applications separately, so those who only use LiveJournal don't have to learn a new tool, but both applications will benefit from the use of some shared code.

The old wtf has been running quite well lately. The number of exceptions being passed back to me have dropped considerably, and people seem to be using the site without too much difficulty. I have a huge checklist of crap I need to finish before I start mail bombing old users, but I have to say, things aren't bad right now. What's coming? Mostly style and behind the scenes changes. The code needs to be cleaned up quite a bit, as there is something like three years of start and stop development in there, and it needs to be tightened up a bit. Data management and cleanup needs to occur, as some older board posts are missing and/or corrupted, due to an old bug. The mobile site at m.whatthefuck.com is going to be filled out with some of the user options and an email notifier, and promoted to a top tier service out of wtf. Some basic blog functionality is going to be added as well, due to popular demand, and support for it is likely going to be rolled into the above "new blogging application".

From there? Who knows. I have big plans for 2009. As for the freebies? "Things I Hate About You" is going to get some social features, comments, and Facebook integration, TwitterGrowl is going to get a GUI, and is going to get a new storage engine and a new home site.

Things that aren't free? Well, you'll see. :)
1 comment
ElJay, a LiveJournal Client for Android
Posted by Nick at 9:47 AM
This morning, I uploaded my first application to the Android Market. As a quick background, Android is Google's new mobile operating system, designed for smartphones and similar mobile internet devices, and similar in theory to the iPhone operating system. The Android Market allows third party developers to distribute their software through a centralized location for a small fee. As of right now, all software on the market is free, so you don't make any money on the process.

I decided, for some reason, that my first application was going to be a LiveJournal client, that is, an application that enables easy posting to a LiveJournal blog. I would be able to work with simple HTTP requests, design a simple but effective user interface, play with threads a little bit, and touch the Location Manager (GPS/Tracking) if I was lucky.

I was.

I'm happy with the final product, and it's modular enough that I can add to it later if I wanted to, or fork it to a generic blog posting tool if I felt crazy enough. You can log into your LJ account, select user pictures from a live gallery of all of your user icons, dynamically retrieve your location from GPS or fuzzy tracking, add moods or your current music. It's remarkably complete for a few days of work, and I think I want to add the ability to attach photos later on, as well as limit to certain friend groups or post to other communities. Trivial tasks in the long run, but I wanted to get it out there as soon as possible.

Click through if you want to see what it looks like.
You can click these images to get a full 320x480 view.


Login screen, pretty simple. This authenticates you to LJ, so ElJay can grab user pictures, moods, groups, etc.


Initial post screen, with a subject and a body. It starts out bare so you have room to type, but via the below menu or the Settings menu, you can set which fields it shows by default.


When you hit the menu key, this is what appears. Change settings, edit the user picture, or add fields to your post screen.


This is the post screen after adding all three fields. You can even use the built in wifi/cell mapping or GPS to get your actual or approximate location via the 'Get' button.


Userpic browser. Uses the standard image chooser in Android to show you all of your user pics. Just flick your finger to scroll through the available pictures. Hit back to cancel.
2 comments