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 : Immediate search tells us following files are having code related to Bluetooth, this framework defines the basic package ” … Read more

How Android Bluetooth Profiles are enabled and Services are activated ?

How Android Bluetooth profiles are enabled ? Answer: Check packages/apps/Bluetooth/res/values/config.xml If you want to disable the above profile, change from “true” to “false” 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. Supported Profile services are defined at, Now inside init, it … Read more

How to compile native C library and daemon using Android.mk ?

To compile any c library inside android, we need to write an Android.mk makefile, for reference please check below, In below makefile Android.mk we assume, you have a C library code in library_source.c file and application using this c library in main.c To compile as Shared Library, LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)LOCAL_SRC_FILES := library_source.c LOCAL_C_INCLUDES … Read more

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

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

Java programming with Java Native Interface ( JNI ) / Calling Native C functions from JAVA using JNI

JAVA and JNIpre-requisite – Install Java SE Development Kit 6u14 under /usr/jdk1.6.0_14Write a JAVA class [ HelloWorld.java ] [java] public class HelloWorld { static { System.loadLibrary("hello"); } public native void printHelloWorld(); } [/java] Compile the class using javac sudo javac HelloWorld.java after this HelloWorld.class file should get created.Create header file required for writing a native … 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