Developing Android App in AOSP Sources

I’ll show you how to build Android App from sources in the Android Open Source Project source tree.

Create a new project in Android Studio in /packages/appsdirectory,
e.g. /packages/apps/Foo.

Add Android.bp file to the root directory of your project

android_app {
srcs: ["app/src/**/*.java", "app/src/**/*.kt"],

resource_dirs: ["app/src/main/res"],

name: "Foo",

platform_apis: true,
certificate: "platform",

optimize: {
enabled: false,