Jump to content
Sign in to follow this  
Umer Y.

Integrate AAR SDK in FMX Android app

Recommended Posts

Is there any way to utilize .aar android library in delphi android project. We can use JAR archive. 

Share this post


Link to post

Thanks Mustafa. I have gone through these links. But still not able to use aar in project. JAR, I was able to.

 

For AAR Library, all code is compiled to Java Byte code. And there need to also include maven repo dependencies.

  • Like 1

Share this post


Link to post

I have just made the AndroidMerger Tool: Integrate AAR SDK in FMX Android app

An Android library, also called as Android Archive, includes everything you need to build an app like source files, resource files, manifest etc. This is the reason why AARs are different from JARs. AARs can contain resource files as well other than compiled byte code.
Adding such library to Delphi project is long and convoluted process consisting of extracting resources from library, manually adding them to Delphi deployment files, compiling R.Java class, checking dependancies, etc.

With AndroidMerger all of the above can now be done automatically in a single command line. In brief AndroidMerger will:

  • Use graddle or internal implementation to list all dependencies.
  • Download libraries and dependancies from local or central maven repository.
  • Merge the resources of all AARs inside a single directory.
  • Merge the AndroidManifest files of all AARs inside AndroidManifest.template.xml.
  • Merge google-services.json in the resources of the project.
  • Create the R.jar with all resource IDs using aapt or aapt2.
  • Update the project file (.dproj) to include all resources.
  • Generate the Delphi native bridge file from the Java libraries.


Everything is here (source code included) : https://github.com/MagicFoundation/Alcinoe/tree/master/Tools/AndroidMerger

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×