Starting with android sdk

| | Comments (1)

After sketching out a couple of ideas on paper, the right thing to do is make a level editor for Nutmeg to use on her kindle, which can translate into loading/running/pausing a working game. Since kindle is her device, I need to get started with android.

I snagged the old android sdk updater awhile ago, and toggled on all the new downloads including atom and mips binaries. Then it was time to unravel some getting started tutorials.

After a couple of google/youtube searches, I stumbled onto a pretty detailed looking series. It became pretty clear that eclipse is the android dev ide of choice, but I didn't want to download the android ADT bundle, since I already have all the parts - a working eclipse, jdks, and the droid sdks. The sdk tools install from an eclipse update site (, so I installed those too.

The jira greenhopper plugin links to a 'scrum vs. kanban' book, which was a good 41 page read. I got Jira configured with a handful of issues on a kanban board (overkill for a currently 1 man project I see moving over to a 1 man / 1 kid project). Attachments aren't working on Jira, so I bugged it for later. Broke the first idea into subtasks, and it's time to put together a stubbed in UI.

First project time! Right clicked in eclipse to make a new project, and ran through it a few times. Looks like most things shouldn't be changed, except the first panel: app namespace, app name, and app project. Satisfied, checked code into perforce (add eclipse team/share to project), opened jira task integration, and saved all login details. Hopefully don't need to exit the IDE for awhile.

After realizing app name could be a human string, fought through the different settings to find the string resources. Edited the app name and hit save, but the UI layout string didn't update. Checked out all the files with perforce so they were writable, cleaned build, and rebuilt. Presto. There must be some generated build output saved in there (insert sad face).

The next tutorial step from the android developer site is about the iteration loop: using the emulator or a device. Awesome. Dig out some old devices - crap. The shatterphone (moto droid2 slider) is not charged. Plug it in. The incredible2 charging port broke, and my hand-repair was unsuccessful. (But, it's like christmas - a 16gb micro sd card is sitting there, unused. I move it into my work phone.) I'm not going to using my work samsung s4 for development, so I guess I'm done. On to the emulator.

The easiest way to setup kindle emulation is to add the kindle update site for the Android SDK package manager (, and get the AVD definitions directly from them. If you already have the Intel Atom binaries, that's great. Even though the processor is an Arm, the guidelines recommend using the Atom binary. Probably the other Arm image from google is older, or for popular handsets. I see mips ones (Yay imgtec!).

With the AVD selected, we get to the first real blocker during the tutorial: android emulator panics when attempting to start the AVD.


Hopefully that's not too bad; according to stack overflow, setting ANDROID_SDK_HOME to the parent directory of my .android directory (which went into HOME) can clear this. I set it in windows, restarted eclipse, and my device was still listed in Android Virtual Devices tab. Ran the emulator again, and progress bar completed without printing the panic message. But after the dialog completed, there was no visible emulator window. The start button for the emulator was still selectable. Minutes later, crash dialog.


Gah. Maybe some feature is too fancy. Let's try disabling the GPU emulation, since I have an ATI radeon. Perhaps it really hates that. I leave the scale to size box checked, and we get a little further - a crash with error text: "error: Failed to open the HAX device!"


A little more research on stack overflow shows that memory use is a really common issue. Even with gobs of RAM, users who aren't administrators and who are using UAC get blocked on the spawned emulator session. Running eclipse as an administrator allowed it to launch the AVD to a window, but RAM is gone and the system starts paging.

Seriously? Windows or UAC keeps eclipse from increasing its total stack size to accommodate the spawned AVD window and emulator? That's .. lame. Lame enough that the eclipse AVD window has a warning that suggests windows users might have to constantly decrease the available RAM until the machine can load it, which means Android tools developers didn't quite understand the issue?

At this point in development, I'm really happy to have 2 things: the portal, and stack overflow and its community. It's like having a locked wiki, and some coworkers or helpful friends.


Oh. Yes, ctrl+f12 to go to landscape, ctrl+f11 to return to portrait. Excellent.

Recent Tweets