Thursday, February 27, 2014

Understanding Android Open Source Project

A while ago someone asked on Quora about some good ways to understand the AOSP. Although I don't work with Android internals anymore, it was fun looking back into AOSP and finding some sources (no pun intended). Here's my answer (edited for this blog):

Obviously, first go to AOSP site and follow the instructions to download the source.

Although outdated, take a look at Android Platform Developer's Guide (it's a copy of the old PDK, removed from Android site now). You can also check the source for older tags, such as gingerbread, probably under docs there are instructions on how to build the documentation. But don't blindly follow them. Sometimes I find it easier starting from where things started instead of diving into what's the current state.

I highly recommend setting up ctags, AOSP is just too big for Eclipse and you can't build it anyway using Eclipse (or Android Studio or IntelliJ).  Or try GLOBAL.

Chrome has a nice extension developed by Roman Nurik, it adds an “ad” keyword to the omnibox to search Android documentation and, the interesting point to your situation, adds a “view source” link in documentation pointing to the source of that class (look at screenshots in Android SDK Search extension to get an idea of what I'm talking about). This way you familiarize yourself with Android source code while developing normal apps.

Look at some patches sent to Gerrit Code Review. Also, try to solve some bugs in the Issue Tracker, it's an easier way to focus on one task and not get overwhelmed.

I also recommend this book: Embedded Android and some Marakana/New Training videos:

Some videos of Karim Yaghmour (Embedded Android author):

Also, although not exclusive to AOSP/low level stuff, understanding how IPC is done on Android is fundamental to understand Android:

Last, but not least, take a look at Android Builders Summit videos:
Android Builders Summit 2011 (download list)
Android Builders Summit 2012 (download list)
Android Builders Summit 2013 (youtube playlist)

I'd do a shameless plug and link to my own presentation on this topic, but it's in Portuguese and indeed doesn't make much sense without someone presenting it.

Sunday, February 23, 2014

The Setup

There are a lot of posts about how someone uses their computer to get the job done. One of my favorite sites that compiles a list of posts like that is The Setup. As I like to keep track of what I use, I'm doing my own The Setup-like post to open this blog.

Who are you, and what do you do?

I'm Douglas Drumond, Android developer at Movile and organizer of GDG Campinas. I blog here about anything and on Roboto Dojo about Android development (in Portuguese). I've been working with Android since 2010, except for a brief hiatus when I opened my start up on business intelligence with some partners, although I never lost complete contact with Android. After failing with the start up, I came back to mobile development and now I focus 100% on Android.

What hardware do you use?

I use a Dell Inspiron 14R at home, attached to a LG 22LE6500 television. At work, I use a Mac mini with two LG displays. I use a Galaxy Nexus as my main phone and a Motorola RAZR i that Intel gave me at a NDK course. I use a Samsung Galaxy Note 10.1 from 2012. I used to read a lot on my old Kindle keyboard while commuting, but since I joined Movile I go by bike and carry no gadgets beside a cell phone, so I don't read as much as I want. I still have my iPhone 3GS to play Taiko no Tatsujin and Guitar Hero and my first gen iPad to play Taiko no Tatsujin (again) and read Go books.

And what software?

I use Linux since 1999 and abandoned Windows in 2004. In 2008 I bought a Mac and fell in love with OS X. It combines a nice GUI with great underhood OS (it's a Unix, afterall). This year I bought a Dell laptop and I'm back to Linux at home with Ubuntu 13.10. It feels great.
For Android development, I use Android Studio and I cry in pain every time I need to use Eclipse. When it's not Android related (sometimes even when it is) I use Vim. I used to provide binaries for MacVim on OS X 10.7 and 10.8, but after my MacBook Air broke, I can't build for 10.8 anymore. I like vim so much that I'm always thinking in using it for Android development too. Even my browsers are vimified.

And talking about browsers, I browse the web on Google Chrome or Mozilla Firefox with Vimium (Chrome) and VimFx (Firefox) extensions. I use Google stuff for almost everything, Gmail, Blog, Drive, Google Apps for your domain, you name it.

GitHub for public repos and Bitbucket for private ones.

When I use a Mac, there a lot of tools I rely on to boost productivity, such as Alfred, PCKeyboardHack, KeyRemap4MacBook and Keyboard Maestro. I use f.lux to save my eyes. Now I'm trying to set up a similar configuration on Linux, still unsuccessful. I used to save my notes on Evernote, but its app is becoming slower and slower, it lacks a native Linux client (there are 3rd party alternatives, but I didn't like any) and its web counterpart isn't so nice to use, so I'm looking for alternatives. For now, I'm sticking with it, but I'm experimenting with Google Keep and Simplenote.

Under Linux, I use default terminal, my Mac runs iTerm2. My shell of choice is Zsh.

What would be your dream setup?

I like the idea of Chromebooks. Use a lot of remote stuff and let the companies deal with infrastructure, backups and so on. Log in from another chromebook and everything is there. But it should have same speed as my local PC and great development tools also. I hate configuring things, I'd like to grab another computer, log in and it just works.