Analyse android booting using Bootchart

Bootchart provides CPU and I/O load breakdown of all processes for the whole system. It doesn’t require rebuilding system image and can be used as a quick sanity check before diving into systrace. Install dependencies on Ubuntu Desktop / laptop Download the source code to get the script from system/core/init from android aosp, Now, … Read more

Android property system / service and how android sets and gets properties

Each property has a name and value, and they are all in string format. Each process can get/set properties. When the system is initialised, Android will allocate a shared memory area to store the properties. These are done by the “init” daemon. The “init” daemon will start an android property service. platform/system/core/init/init.c platform/system/core/init/property_service.c platform/system/core/libcutils/properties.c Subscribe … Read more

How to extract android boot.img ?

boot: The boot partition contains a kernel image and a RAM disk combined via mkbootimg. In order to flash the kernel directly without flashing a new boot partition, a virtual partition can be used: kernel: The virtual kernel partition overwrites only the kernel (zImage, zImage-dtb, Image.gz-dtb) by writing the new image over the old one. To do this, it determines … Read more

How to create / change Android boot animation ?

Android boot animation is the loading animation that is played when your device starts up. In this post, we will show you how to change the default boot animation with the new animation in Andorid. – This is a zip after extracting, it contains following things desc.txt – The first line from desc.txt indicates as, … Read more

How to create a native daemon and run from init.rc in Android ?

Android’s init is located at the root of the filesystem i.e. /init and also it uses different naming conventions than normal linux init, so its advised to first try and understand the details of android init Language, from system/core/init/readme.txt you can also check in the source code you have or click the link here. Now, … Read more variable to link system or external library during compilation

LOCAL_LDLIBS This variable contains the list of additional linker flags for use in building your shared library or executable. It enables you to use the -l prefix to pass the name of specific system libraries. For example, the following example tells the linker to generate a module that links to /system/lib/ at load time: Using … Read more

Cross compiling C/C++ programs for Android using NDK Toolchains

If you are using NDK version more than r19, the toolchains which comes as part of NDK zip can be used and we no longer need to generate toolchain using script for versions before r19. Below post will describe how we can compile native C/C++ programs using NDK. The first step is to make … Read more

Solved: java.lang.UnsatisfiedLinkError: no hello in java.library.path

When we were developing the JNI example as mentioned in our another post, “Java Native Interface ( JNI ) Example , Calling Native C functions from JAVA” we got an error “Exception in thread “main” java.lang.UnsatisfiedLinkError: no hello in java.library.path” as below, Solution : This error can be solved by adding the PATH of the … Read more

Java Native Interface ( JNI ) Example , Calling Native C functions from JAVA

The Java Native Interface (JNI) establishes a well-defined and platform-independent interface between the JAVA and Native C program / library. Using JNI we can access the native C API’s from JAVA applications. pre-requisite – Install JAVA using “How to Install Java using apt-get command on Ubuntu ?” Write a JAVA class [ ] Compile … Read more