[This is part of the Android Diary.] As of late last night, I have a bit of nontrivial code actually running on the G1. I feel a bit reluctant to diarize since I’m a complete beginner, swimming in ignorance; but it occurs to me that for every expert out there, there are many n00bs like me, who might wonder what the experience is like.

How to Learn · Just like everyone else, I started with the Hello, Android! tutorial. There is a ton of material here and there around the net. As of now, here are the browser tabs I have open (the order is not significant):

Tools · I’m using the Android plug-in for Eclipse. Yes, I’m a NetBeans partisan, professionally and personally, but I’m also hardly unusual in using both. It just seemed that all the demos and troubleshooting and walk-throughs assumed you were on Eclipse. Also, I hadn’t hand my hands on it for a while, so I was curious.

For someone who’s used to NetBeans, the transition is effortless. Eclipse on the Mac doesn’t look nearly as pretty, but most of the stuff I’m used to is easy to find. And the integration with the emulator and device is pretty slick.

Having said that, I suspect I’ll be leaving Eclipse behind. I get the feeling that the serious developers are mostly using the raw tools from the command-line, and that Eclipse will start to feel like training wheels pretty soon. Also I hear some rumbles about IntelliJ.

Problem: Unit Testing · This is a really big fucking hairy problem. So far, the large majority of my code does mundane things like HTTP-fetch chunks of XML, parse the XML, and pull together iterators of one flavor or another.

I’m pretty TDD-infected, and I just don’t feel comfy writing any volume of code without hitting the “run the tests” button. Android just doesn’t make this easy or obvious. There are work-arounds out there: see Diego Torres Milano here and here; also at Google Code and Google Groups.

I can’t report on any of these workarounds first-hand. What I did so far was sketch in all the code in an ordinary Eclipse project with ordinary JUnit tests, then drop it into the Android project once it was working.

Which constitutes major suckage.

Problem: Trouble-shooting · When I took my apparently-running code and dropped it onto the Android emulator, it blew up with a “SocketException - unknown error” the first time I did an HTTP GET via Apache’s DefaultHttpClient, the stack trace sprawling unhelpfully all over the Android runtime.

Fifteen seconds of Web search turned up the solution; but still, it would be nice if the system had something useful to say about why it wouldn’t GET.

Problem: Over-eagerness · This is a little weird. I got my code running in the emulator well enough to display a line or two of read-out (no graphics yet), so I went and got the G1 and plugged the USB link into the computer. Then I started casting about to figure out how to install and run the app. While I was doing this, my eye happened to fall on the phone and what do you know, there was my app running.

For the moment I was all “W00t cowabunga, I’m a certified 133t mobile haxx0r!” Then I thought “Danger, Will Robinson!” Suppose that’d been the ClearContactsListAndSync app or the LaunchNuclearFirstStrike app? So what Eclipse really needs is a nice prominently-featured “Upload to phone and run” button or some such. Did I mention training wheels?

Next Steps · Well, one o’ them there Graphical User Interfaces the kids these days seem so hot on. Plus some more network pipefitting. Then some decision points about whether I care about the result, and whether anyone else might, and whether Sun should.

But, it’s still a milestone; the first time I’ve seen my code running on a device I can carry in my pocket.



Contributions

Comment feed for ongoing:Comments feed

From: Ramin (Dec 28 2008, at 13:44)

Thanks for posting all this -- especially the links. I'm one step right behind you. Got my Dev G1 last week.

I'm coming at it from the iPhone and have substantial amounts of code I'm interested in porting over.

Incidentally, I count myself as a pretty serious programmer -- and don't consider Eclipse to be 'training wheels' at all. It's pretty much indispensable for cross-language coding. I use it all the time for Java, Python/Django, Ajax, and Flex coding.

Having an Eclipse plug-in, a working simulator, and ability to run on the Mac were the main reasons I decided to give Android a shot. It's also why I'm holding off on the Blackberry SDK.

[link]

From: imabonehead (Dec 28 2008, at 15:57)

There's an Android plugin for Netbeans.

http://kenai.com/projects/nbandroid

[link]

From: Steve (Jan 07 2009, at 09:29)

Thanks very much for this post! As a fairly new Android developer myself, a lot of things in your post were very pertinent to my own findings.

As someone who also is locked into the TDD mentality, I share your frustration with the lack of Android testing frameworks. I'll be sure to give those links you included a look.

Good luck to you!

[link]

author · Dad
colophon · rights
picture of the day
December 28, 2008
· Technology (90 fragments)
· · Mobile (86 more)

By .

The opinions expressed here
are my own, and no other party
necessarily agrees with them.

A full disclosure of my
professional interests is
on the author page.

I’m on Mastodon!