Monthly Archives: November 2007

Google Android Notes

Just some notes.

(1) If you see the text

ActivityManager: Error: Activity class {org.chuck/org.chuck.Hello} does not exist.

When you recompile – you are doomed. You can find some stuff in the
Android Beginner Groups but all you will learn is that no one knows the answer to this. The solution is to start a new project and paste your code into that new project.

(2) Do not use the XML editor built into Eclipse to add attributes – it seems incapable of editing XML except when you change attributes. Just use some other editor like vi or notepad to edit the XML. Then use right-click on the XML file and “Refresh” in Eclipse to get Eclipse to re-read it and re-generate the R.java file and compile the rest of your app. You *can* change attribute values – just not add new attributes. What I really need to do is tell Eclipse to just open the dang file without their little helper so you can edit the XML directly.

(3) Do not shutdown and restart the emulator – you should only start the emulator once per Eclipse session. If you shut it down, Eclipse will start it back up – but something will be subtly wrong. No big deal if you close the emulator. Just close and restart Eclipse.

(4) The Log.i is the best way to get debugging output. System.out.println should go to the log – grrr. AH well – just use the log.

(5) The Mac stuff is Intel-only.

Outstanding issues

(1) I do not know how to completely reset the emulator – I would like to have it not sure the programs are 100% gone between downloads – it makes me nervous – but it is not fatal.

That is all for now. I am off and running to write a Pong game based on a hack of the Lunar Lander. I have Twitter and reading and parsing RSS in Android working – it needs a completely new UI – but the networking is working and the XML parsing is working – so I am satisfied for now. That tool will be evolved into that IMS Tool interoperability for the Android – but I really want the last SI543 assignment to be a pong assignment to match our pong assignment in regular Java. So I will work on Android Pong before Android IMS Tool Interoperability.

Google Android Twitter Viewer

Well – I have a simple Google Android application that read an RSS feed and parses out the title of the first item and displays it.

Source code

The cool thing is that my XML map parser works in Android too! Pretty printing broke so I will have to rewrite that bit.

Now I need to write a pong game in Android and then IMS Tool Interoperability in Android.

I think that I just taught the first lecture in a for-credit college course (SI 543 at University of Michigan) that is about Google Android!! It is recorded – when it goes up I will post a URL. The first Android homework is already complete by a number of the students in the course in tonight’s lab based on the

Installing and testing Android on Windows podcast

Nifty C-Shell foreach script Trick for spaces with file names

This code did not work with files with spaces in the name:

foreach i ( `find . -name '*.java'` )
ls -l "$i"

This code did work:

foreach ii ( `find . -name '*.java' | sed 's/ /@@@@/g'` )
set i=`echo $ii | sed 's/@@@@/ /g'`
ls -l "$i"

I was quite pleased – I almost resorted to using walk in Python – but that was averted. Somehow Sakai’s assignments tool (in mid semester) changed the format of the “Download all for grading” ZIP file. I am sure it is an improvement – but it broke my C-Shell scripts I use for grading.

Moving a Reclining Sofa Into the Basement

We are redoing our basement and wanted to put one of these really cool sofa’s with a recliner at each end and really fluffy – for the kids to site on while playing video games and even to sleep over – bu reclining the couch back and throwing on a blanket. Teenagers are tough. So we bought a nice Lane reclining sofa from Sams Club for $600 and brought it home.
But this thing was big and bulky and it did not look like it would go down the stairs or through a window. But we bought it anyways and let it sit in the garage for a week measuring things to see if it could go down the stairs or through a window. There seemed to be no solution until my brother Scott came over one evening and I told him this sad story of how we were going to take back the couch because it would not fit down the stairs.
Scott went into the living room where we had a similar couch and flipped it over – and pointed out that the three sections were simply bolted together and held together with two metal bars running across the bottom of the sofa. Eight easy-to-reach bolts and it would be in three pieces.
So we went back to the new couch and tore off the packaging – that probably meant that I could not take it back to Sam’s and get my money back. We flipped over the new Lane sofa and indeed it had the same construction as the Berkline sofa in the living room.
We removed the eight bolts and the three separatre couch pieces went easily down the basement stairs (it was much lighter). In 10 minutes I had it reassembled and up in the basement.
It just goes to show you that sometimes there is a simple solution hiding amongst all the complex solutions.