🤖
Android Tips
  • 🤖AOSP
    • Clone AOSP repository
    • Directory Structure
    • Setup IDE
      • Setup VSCode
    • Build
      • BluePrint for Application Project
      • BluePrint for Android Library Project
    • Manifest
      • sharedUserId
      • persistant
  • Gradle
    • Create Custom Build Config Variables
    • Create Custom manifest Variables
    • Make app debugable
  • Android Process
    • Find a process by name
    • Kill a process by Id
  • Catch any exception in Android
  • 🎨Theming
    • Theming
      • RRO
        • RRO Internals
        • RRO classes in AOSP
        • RRO Example
        • RRO Permission
      • Fabricated RRO (FRRO)
        • FRRO Example
        • Permission
  • Lifecycle
    • Basics
      • Lifecycle
        • Activity
        • Fragment
          • Fragment add
    • Lifecycle Aware Custom Class
  • ℹ️Interview
    • Interview Questions
    • Architecture Pattern
      • MVC Architecture pattern
      • MVP Architecture Pattern
      • MVVM Architecture Pattern
  • ↔️AIDL
    • Simple AIDL Communication
      • Creating an AIDL file
      • Create an AIDL server
      • Create AIDL client
      • Limitations
    • AIDL with callback
      • Create AILD interfaces
      • Create an AIDL server
      • Create AIDL client
Powered by GitBook
On this page
  1. AOSP
  2. Build

BluePrint for Android Library Project

How to configure Android.bp for an android library

Here is list of some properties in an android library blueprint

  • name: The name of the module. This must be unique across all Android.bp files.

  • platform_apis: A boolean property that specifies whether the module is using platform APIs. If this property is set to true, then the module can only be used on devices that have the platform APIs installed.

  • srcs: A list of the source files that are used to build the module. These files can be Java, C++, or resource files.

  • resource_dirs: A list of the directories that contain resources that are used by the module. These directories can contain XML files, layout files, drawable files, and other resource files.

  • static_libs: A list of the static libraries that are linked to the module. These libraries can be used to provide additional functionality to the module.

  • libs: A list of the shared libraries that are linked to the module. These libraries can be used to provide additional functionality to the module.

  • manifest: The path to the AndroidManifest.xml file for the module. This file contains information about the module, such as its permissions and activities.

Here is an example Android.bp file

android_library {
    name: "CarLauncher-core",
    platform_apis: true,

    srcs: ["src/**/*.java"],

    resource_dirs: ["res"],

    static_libs: [
        "androidx-constraintlayout_constraintlayout-solver",
        "androidx-constraintlayout_constraintlayout",
        "androidx.lifecycle_lifecycle-extensions",
        "car-media-common",
        "car-telephony-common",
        "car-ui-lib",
        "WindowManager-Shell",
    ],

    libs: ["android.car"],

    manifest: "AndroidManifest.xml",
}
PreviousBluePrint for Application ProjectNextManifest

Last updated 1 year ago

🤖