Now, we are ready to build a custom system image. We will re-use the previously written code and test it on an actual device. Therefore, you will need to build the custom system server code and flash it to the Nexus S device in this recipe.
Navigate to the proprietary binary page for the Nexus S and download all files for the GRJ22 build. Unzip and extract them.
Lunch the
full_crespo-userdebug
target.Execute a full make. Once successful, navigate to
ANDROID_SRC/target/out/product/crespo/
.Flash
system.img
,boot.img
, andrecovery.img
as described above.Reboot the phone. You can use:
fastboot reboot
The code images are cross compiled for an ARM architecture and the proprietary binaries are included in them. The appropriate prebuilt kernel image is picked up and included in boot.img
during the build process.
In the preceding recipes, we created a custom service that can be invoked by obtaining a reference directly to the service via the Service Manager. In this recipe, we will create a class library that abstracts much of that code away into a clean interface. The advantage of creating a class library is that it acts like an SDK-API for our custom service. The example we go through here will also guide us in adding code to the Android class library. The code is generally independent of system services and can be used for other purposes as well. An example of an Android class library is android.app.Activity
, which is a commonly used class to represent Android activities. This class is part of the Android class library.