[Ofer Goren really needs no introductions, does he? He writes here more than I do, lately. Anyway, this time he shares a harrowing tale of Android OS and job insecurities of a completely different kind.]
The Android OS is out for quite some time. Recently it was decided that we should bring our SIP Stack revolution to this uncharted world It was a challenging task, which only a few can take: . a new operating system, to add to the many that our stack already works with. I boldly took the responsibility on myself, and I emerged triumphant. Well, kinda.
The First Hesitant Step
The heavy-duty work was done by our Common Core team. They are the experts in porting our OS-abstraction layer APIs to work with new operating systems. This layer helps us, the rest of the developers, to work without directly interacting with the OS bits and bytes, pipes and ports and whatnot. So what’s the big deal in another OS to port to, right? All you have to do is RTFM. Such an easy job those Common Core people have….
Therefore, after this “unimportant” phase, it was time for me to work my magic. Of course, with the help of our Common Core team, again. Why? Because the Android’s way of compiling code is quite different than the one we usually use. The first thing I had to do is check out the documentation of the Android’s Makefile system. It was buried deep in the NDK documentation (<NDK_INST_DIR>/docs). That took me some time. Or at least that’s what I told my boss when asked about my slow progress.
We’re On It, Baby
So we were done with the porting, and we knew how to name the android Makefile (android.mk – Ingenious!). Our system started humming and making start-up sounds. Now came the hard part: should we force Android developers, our existing and new customers, to work our way (and as god intended, if I may say), or submit ourselves to Google’s will?
The thing is – if you wish to compile your code, you need to place it under one of the Android NDK folders. You can’t just place your code anywhere you want, as you used to with *nix or Windows. You must have at least one anchor well placed under the environment tree. Out of generosity, we decided to let Google win this time.
After some additional steps (write a JNI wrapper, place an Android.mk file in almost every folder, etc.), we were able to compile everything. Experts as we are, it all ran smoothly the first time we tested it. That is, if you agree to call that time we tried it, after 3 weeks of continuous debugging because of crashes, the “first time”. But what are 3 weeks compared to eternity, right?
So What You Should Do
If you’re going to develop some code under the Android platform, there are some things you should know. First, you’ll need to download and install the Android SDK and NDK. You should also write some pieces of JNI code that will connect the Android GUI to the C code you’re writing. It will also be a good idea to download and install Eclipse, and then install Android ADT plug-in for Eclipse. For more information, you might want to read this article.
It was a nice experience. People actually thought I work on Android (I didn’t. Remember the OS-abstraction layer?) and I could see them gather in the corridors, whispering about the cool job I have. Hey, if they are already staring at me, I rather think this is what they’re thinking.