Search code examples
androidaar

Get AAR version programmatically


I am creating an AAR library, In the arr manifest we have version name, and version code. How can I get this version. I don't want the main app version. I just want the library version.

Is there a way to get this version?


Solution

  • Step #1: Define those values as resources.

    Step #2: Adjust your manifest to reference those resources.

    Step #3: Refer to those values from the rest of your app via those resources.