Sunday, January 19, 2014

Book Review: Embedded Android

Just finished reading Embedded Android, a book with deep technical details about the Android platform. Loved it: read my review to find out why.

A few years ago, I downloaded the Android Open Source code (AOSP) to take a look. The download took a long time, and the contents had a confusing directory structure. I could see some familiar directories, but I had no idea what the remaining code did. I understand the Linux filesystem hierarchy and kernel-user space divide and daemons. But Android had none of that, so it made it very difficult for me to transfer any of my understanding. My standard Linux skills were falling short, and the system felt strange and unfamiliar.

"Embedded Android", by Karim Yaghmour covers deep technical details about Android that no other book currently covers. Most Android books give you details about Android programming: Activity/Service/BroadcastReceiver. Karim's book answers questions such as:
  1. How does an activity start up?
  2. How does a package get installed?
  3. Who starts the ActivityManager?
  4. How can you interface with the ActivityManager on the console?
  5. How does the Android system boot up?
  6. Which service does what?
  7. How do I get busybox on there?
Frequently, I marvelled over how clearly something was explained: like the boot process and how the init.rc is structured. Or how detailed the explanation on the build process was. And I kicked myself for not having read this book three years ago -- excusable since this book was written last year.

This book is for advanced Android programmers and Android device makers. This book is for Android programmers who understand Linux and want to see where the lines between Linux and Android blur. If you have ever downloaded the AOSP, you would benefit from reading this book.

Nothing is perfect. The editing on this book could have been better. There are some winding passages and unfocussed sections of text. And some sections could do with expanded explanation. The detailed material makes up for these minor issues. The author has laboriously dug through the AOSP code to make sense of the system, and his depth of understanding makes the book a pleasure to read.

The chapter on Android Framework (chapter 7) was brilliant. The book provides documentation for components that have none. This book explains what Android really is, and how it ticks.

Worth every penny.

(I do not receive evaluation copies of books. The reviews written here are out of my own reading, done in my own time, on my own dime. I try to read the entire book before writing a review.)

(Image courtesy: O'Reilly Media)

Saturday, January 18, 2014

Advice to a younger me

I was talking to an intern candidate to discuss whether our team would be a good match for the candidate. The candidate asked me a couple of questions: about work life, specific project details. And then, the candidate had a brilliant question. I wish I had asked that question when I was starting work as a software engineer. I mentioned that I had interned before, and it was a great learning experience. The candidate's question was:
After your internship, what advice would you give a younger yourself?

 This is both a brilliant and insightful question. Everyone talks about internships being a great learning opportunity. Well, what do you learn?

Everyone learns different things. Here is my attempt at an answer. I learned two broad things during my internship:

  1. Dealing with inadequacy: All through my internship, I was surrounded by people smarter than me. Co-workers, project managers, executives, ..., even my fellow interns were much, much smarter than me. It is difficult to quantify how much smarter, but in some cases, 10x or 100x would probably be right. In some discussions, I felt strange being in the same room with these people. Perhaps for the first time in my life, I felt like a complete idiot.
    A big part of the internship was learning how to cope with that feeling. Learning that it was natural to feel silly and incapable. All these engineers had spent years perfecting their skills, and I was completely inexperienced. Of course they were better. I had to learn that there were some things I might be better at, if I worked hard.
    And I learned that I have some valuable skills, which others might lack. Maybe I am not as technically capable, but I am a strong listener. I can explain a situation clearly and patiently. Sometimes it was a little Linear Algebra. At others, it was shell scripting. But I had to remind myself that I understood some things betters than others.
    I had to learn how to cope with this again as I started a full-time job. I felt like I got in due to a recruiting error and had to remind myself that I was capable.
  2. Learning from others: It was clear that other engineers were more experienced. The other lesson from the internship was how to learn from others. How do you ask for help? How do you suggest you are lost? How do you solicit feedback? If you had an hour of the best engineer's time, how would you use it effectively?  Once you are surrounded by shocking brilliance: how best do you imbibe it?
I haven't conquered these two issues yet. I wish I could feel adequate. I wish I could learn better from others. The internship got me started.