0

We have android.jar and framework-res.apk in AOSP and we refer to the resources as @package-name:type/resource_namae ( eg: @android:drawable/name )in applications. I want to similarly generate a jar conatining my custom resources, so that developers can use that jar in their apps. Is that possible and how?

Manfred Radlwimmer
  • 13,257
  • 13
  • 53
  • 62
khetanrajesh
  • 300
  • 3
  • 13

1 Answers1

-1

In addition to JAR files, the Android uses a binary distribution format called Android ARchive(AAR). The .aar bundle is the binary distribution of an Android Library Project.

An AAR is similar to a JAR file, but it can contain resources as well as compiled byte-code. A AAR file can be included in the build process of an Android application similar to a JAR file.

It is possible to create libraries modules which can be used as dependencies in Android projects. These modules allow you to store source code and Android resources which can be shared between several other Android projects.

Reference: Creating an Android Library

Daud Arfin
  • 2,499
  • 1
  • 18
  • 37
  • Hi , Is there any way to create AAR in aosp ? – khetanrajesh Apr 26 '17 at 05:21
  • Yes. Add your project which has AAR output defined in AOSP. Refer this link for defining Android.mk file for AAR http://stackoverflow.com/questions/31205856/aar-support-in-android-mk – Daud Arfin Apr 26 '17 at 05:50
  • That is when I already have an aar file . I want to create an aar in AOSP and not in Android Studio . (using LOCAL_STATIC_JAVA_AAR_LIBRARIES does not help ) .Can you tell me how to create it in AOSP source using Android.mk . Also creating an aar and distributing it will duplicate the resources , I want the resources to be only added once in my framework . – khetanrajesh Apr 26 '17 at 10:21