Using .in Files and Macros for API Management

Overview When working with large graphics APIs like OpenGL ES and EGL, especially in complex systems like Android, developers face the challenge of managing hundreds of function declarations, pointers, and related metadata. A common and powerful solution is to use macro-based code generation with .in files. This approach, while adding some complexity, brings significant benefits in maintainability, consistency, and flexibility. This post explains what .in files are, how they’re used with macros, and why this pattern is so valuable in graphics stacks like OpenGL ES and EGL. We’ll also look at concrete examples and discuss the trade-offs involved. ...

June 25, 2025 · 3 min

IPC in Android

Android and Linux systems rely on various communication methods for processes and threads to interact. Linux provides several IPC (Inter-Process Communication) mechanisms such as pipes, message queues, shared memory, sockets, semaphores, and signals. Android adds its own Binder IPC mechanism, which is widely used for communication between system components and apps. The Zygote process uses sockets for communication, while higher-level services (System Server, Media Server, Apps) primarily use Binder. For communication within the same process, especially between threads, Android uses the Handler message mechanism. ...

June 17, 2025 · 2 min

Android Architecture

Android - System Architecture Linux Kernel Layer Manages core system services such as security, memory management, process management, network stack, and driver model. Provides an abstraction layer between the hardware and the rest of the software stack. Start the swapper process of the kernel (pid=0): idle process. It is used to initialize process management, memory management, and load Display, Camera Driver, Binder Driver and other related tasks. Start the kthreadd process (pid=2): Create kernel worker threads kworker, soft interrupt threads ksoftirqd, thermal and other kernel daemons Hardware Abstraction Layer (HAL) Purpose: Standard interface for hardware. Structure: Multiple modules for specific hardware types (e.g., WiFi, Bluetooth). Function: Loads appropriate module when hardware access is requested. Android Runtime(ART) & System Libraries ART: Each app runs in its own VM (via DEX files). Features: Ahead-of-Time (AOT) and Just-in-Time (JIT) compilation, optimized garbage collection (GC), and debugging-related support. Native System Libraries: User space daemons, HAL, boot animation. Init Process (pid=1): Parent of all user processes. Starts daemons (ueventd, logd, healthd, installd, adbd, and lmkd) and services (servicemanager, bootanim). Starts the Zygote process (parent of all Java processes). Framework Layer Zygote Process: Forked by init (in init.rc), loads VM, preloads classes/resources, starts Zygote socket. System Server: Forked from Zygote, manages Java framework including ActivityManager, WindowManager, PackageManager, PowerManager and other services. Media Server: Forked from init, manages C++ services (AudioFlinger, CameraService, etc.). App Layer Launcher: First app process from Zygote (user’s desktop). Other Apps: Browser, Phone, Email, etc., each in its own process, all forked from Zygote. Syscall & JNI Syscall: Interface between Native (user space) and Kernel. JNI: Bridge between Java and Native (C/C++) code. Appendix JNI - Java Native Interface It defines a way for the bytecode that Android compiles from managed code (written in the Java or Kotlin programming languages) to interact with native code (written in C/C++). JNI is vendor-neutral, has support for loading code from dynamic shared libraries, and while cumbersome at times is reasonably efficient. ...

June 17, 2025 · 2 min

degoogle rom

/e/ OS settings put global captive_portal_http_url http://204.ecloud.global settings put global captive_portal_https_url https://e.foundation/net_204/ change ntp settings put global ntp_server pool.ntp.org DeBlot pre-installed apps Use this command to list all the apps installed adb shell pm list packages To search any particular keyword use grep command adb shell pm list packages | grep 'keyword' Package names will be somewhat like this, eg. for Google Assistant its com.android.hotwordenrollment.okgoogle, for Google Auto its com.google.android.projection.gearhead Copy the name of the package you want to uninstall and use the following command ...

November 23, 2021 · 1 min