Sergey Kosarevsky's blog

Embedding precompiled .APK into Android ROM

There a lot of tutorials out there on how to build your own Android ROM from sources and how to integrate your application into the build process. However, there are very few clean instructions on how to put your own precompiled .apk into the ROM. Here is how (I assume you have an Android working tree ready):

Create a folder for your app: packages/apps/<your-app-name>

Put your .apk into the packages/apps/<your-app-name>/<your-app-name>.apk

Now Android build system will recognize the package with your application. To include it into the ROM add <your-app-name> to the PRODUCT_PACKAGES variable for a desired target configuration. I.e. in build/target/product/full_base.mk.

Build the ROM as usual and you will have your precompiled application embedded into it.

If you have native C++ library inside your .apk, you should unpack it manually, put into the packages/apps/<your-app-name> folder and describe it in Android.mk: