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

Compiling Android application as part of AOSP source code

This post details about how you can integrate your Android application as part of Android OpenSource Build system to get it compiled using command line. Normally Android applications are developed using Android Studio and it generates build.gradle to configure and compile the application, but when you want to get this same application compiled as part … Read more

How to compile native C library and native C program as part of Android AOSP’s external directory using Android.mk makefile

To compile any c library inside android, we need to write an Android.mk makefile, for reference please check below, $ mkdir external/mysource $ cd external/mysource $ vim Android.mk To compile as Shared Library, LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)LOCAL_SRC_FILES := library_source.c LOCAL_C_INCLUDES :=$(LOCAL_PATH)LOCAL_CFLAGS := -O2 -g -W -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_HLOCAL_MODULE := libmylibLOCAL_MODULE_TAGS := debugLOCAL_SYSTEM_SHARED_LIBRARIES := … Read more

Adding a new board or platform to android source & build

add a file AndroidProducts.mk In the products directory, create an AndroidProducts.mk file that point to (and is responsible for finding) the individual product make files. # # This file should set PRODUCT_MAKEFILES to a list of product makefiles # to expose to the build system. LOCAL_DIR will already be set to # the directory containing … Read more

Solved : java.lang.OutOfMemoryError: Java heap space

When I was trying to compile latest repo sync Android source code ( Android 10 ), and tried to compile demo application, I got an error as, When tried to find out some related information, I found that this error is due to less JAVA heap memory and we need to increase that memory, so … Read more

Use repo on Windows to download android source

Android had developed repo tool to download huge android source code, primarily keeping in mind of development on Ubuntu / Linux and MacOS, but there are lot of people who just has access to Windows, so this post is to help those people with Windows, who can use below steps to download / repo sync … Read more

Understanding Android AOSP build system

Starting Steps source build/envsetup.sh This adds functions like “lunch” into environment. Check build/envsetup.sh for more details. You can check all added functions ( which also acts like a command ) by, $ cat build/envsetup.sh | grep function OR The first thing which happens is the display of “lunch” options which are built like below, # … Read more

How to install Android Studio for 64 bit Ubuntu machines ?

Note: Android no longer supports Studio for 32 bit Linux / Ubuntu platforms hence you will need only 64 bit platforms for development on Ubuntu. The prerequisite to make sure we can compile Android applications using command line, is we need to install JDK as, $ sudo apt-get install openjdk-8-jdk Visit website https://developer.android.com/studio/Click on “Download … Read more

How to install Android Studio for 32 bit and 64 bit Windows machines ?

Visit website https://developer.android.com/studio/ Click on “Download Android Studio” button to download latest version of Android Studio. The latest version available while we installed was 3.4 for Windows 64-bit. Once you click on Download, you will be asked to Accept the terms and conditions. After accepting, it will download an exe at your machine. For 64 … Read more