How to Set Up Android Platform Development and Debugging
Most of the existing Android documentation is geared toward application developers utilizing the Java-based Android SDK. Documentation for Android at the platform level is rather sparse and includes fewer tools and support for developers. Here, Knowledge Center contributor Larry Schiefer discusses platform-level development for Android, and guides developers through Android platform source and tools setup, including how to set up native, platform-level debugging using Eclipse.The number of mobile devices powered by the Android operating system is growing dramatically, but potential uses extend well beyond the mobile market. Android's simple architecture and extensible framework open the possibility for it to be used to power set-top boxes, kiosks, video displays, data collection terminals or other devices. There are many reasons to use Android: there are no licensing costs, it is a stable open-source platform, open source allows you to customize the code to fit your needs, and it is backed by Google (which is desirable for some users).
Having access to Android's source code gives you tremendous power to extend it to suit your device's unique needs. The only problem is, similar to many open-source projects, the documentation tends to be the source code and you may need to depend on the community to answer questions or help solve problems.
Most of the Android documentation is targeted toward application developers using the Java-based Android SDK. This is where the real push is right now: to get more applications written for the new devices. Large companies making high-profile devices may receive direct help from Google. If you are not included in this select group, then creating new, native components or bringing up a new platform may require you to figure out critical issues for yourself.
Having the source code will help with technical issues but requires debugging guidance not covered in the current Android documentation. In this article, I will help you set up your development environment and debug lower-level code.
Setting up the platform
Native code development requires the same type of environment as Android applications, with some minor additions. Follow the instructions on the Android developer Website for setting up Eclipse and the Android SDK.
You now have the components needed for Java development on Android. Developing and debugging native code requires the C/C++ Development Tooling (CDT) extensions. Get them through Eclipse on the Software Updates dialog box from the Help menu. Click Available software. Expand the "Ganymede Update Site" and "C and C++ Development" trees and click the top-level "C and C++ Development" checkbox. Additionally, download the Android source code from the Android Open Source project Website and build it.