Android.mk 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/libz.so at load time: LOCAL_LDLIBS … Read more

How to install Android NDK on Ubuntu 16.04 / 18.04

The Android NDK is a toolset that lets you implement parts of your app in native code, using languages such as C and C++. For certain types of apps, this can help you reuse code libraries written in those languages. To install and configure the NDK, follow these steps:Download android ndk suitable for your platform … 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

How Android Bluetooth Profiles are enabled & Services activated ?

How Android Bluetooth profiles are enabled ? Ans: Check packages/apps/Bluetooth/res/values/config.xml <resources> 16 <bool name=”profile_supported_a2dp”>true</bool> 30</resources> If you want to disable the above profile, change from “true” to “false” Check related lxr The above flags are used during initialisation as below, in file, packages/apps/Bluetooth/src/com/android/bluetooth/btservice/Config.java Resource flag to indicate whether profile is supported or not. private static … 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

Understanding Android Bluetooth Code : part 1 – Application Framework

At the application framework level is the app’s code, which utilizes the android.bluetooth APIs to interact with the bluetooth hardware. Internally, this code calls the Bluetooth process through the Binder IPC mechanism. Get the code : $ git clone https://android.googlesource.com/platform/frameworks/base $ git checkout -b lollipop-release origin/lollipop-release $ cd base Immediate search tells us following files … Read more

Understanding Android Bluetooth Code : part 1

Android provides a default Bluetooth stack, BlueDroid, that is divided into two layers: 1) Bluetooth Embedded System (BTE), which implements the core Bluetooth functionality & 2) Bluetooth Application Layer (BTA), which communicates with Android framework applications. Figure 1. Bluetooth architecture ( Image from : https://source.android.com/devices/bluetooth.html ) A Bluetooth system service communicates with the Bluetooth stack … Read more

Android DRM info, Check your device’s DRM Capabilities

Netflix and other services such as Amazon Prime Video are protected by digital rights management, or DRM services, and on Android require the most secure level of Google’s Widevine DRM solution (Widevine Level 1) in order to deliver HD (720p+) video content to Android devices. Types of DRM WidewineL1 – requires hardware-backed DRM measures to … Read more

How to create / change Android boot animation

bootanimation.zip – This is a zip after extracting, it contains following things desc.txt – The first line from desc.txt indicates as, “Width” “Height” “Framerate” android – folder with 00.png to 30.png images of 681300 px which are shown once during boot loading – folder which has 31.png to 79.png of 681300 px which are shown … Read more