1

EDIT:

When I use the response of How to manually include external aar package using new Gradle Android Build System I have an error.

BASE: I never use AAR file, with the release of Android Studio we can use it.

But I don't find any explanation to use it.

Do you know how to use it?

It's necessary to make some things like ask for the permissions or create the dependencies?

Thanks

Community
  • 1
  • 1

1 Answers1

0

AAR format is a jar file containing a compiled Android Library project. Here's some info on what is inside an AAR file

What this means for app developers is that instead of (the old way):

  1. Downloading the source code of a library project
  2. Building it in eclipse
  3. Setting your application project to depend on the local library project

You can instead add the dependency specification to your project/app/build.gradle's dependencies block: compile 'fr.baloomba:viewpagerindicator:2.4.2'

Then gradle (on the next build) searches for the aar file in a central binary repository, downloads the library and allows you to use it's functionality in your project. ( ex: http://search.maven.org/remotecontent?filepath=fr/baloomba/viewpagerindicator/2.4.2/viewpagerindicator-2.4.2.aar )

You can also search the central repository's web interface for libraries to depend on. Once you've clicked on a library to add to the project, click "Gradle/Grails" under "Dependency Information" to copy the line to add to build.gradle.

In my opinion this is a huge improvement.

You don't need to add any permissions to the app, either way, adding a Library project dependency is a compile time thing, not runtime or user-facing.

Stan Kurdziel
  • 5,476
  • 1
  • 43
  • 42