SlideShare a Scribd company logo
1 of 35
Download to read offline
Get started with AAR archives 
How to create and work with the new AAR archive format using gradle and android studio
René Mertins 
Senior Java Architect with more then 10 years experience. 
Architect of the apponsormonetization platform. 
Email: r.mertins@bitforce-it.de 
g+: +ReneMertinsHH 
www.apponsor.com 
www.bitforce-it.de
WTF is AAR? 
-Introduced I/O 2013 
-Library project packaging format 
-AAR is Android ARchive
It‘s a simple zip
Benefits 
1.Never handle complete library projects any more 
2.No need to publish a library in source
For distributors 
-Provide precompiled 
-Optimized and obfuscated for best performance 
-Be more sure that no one changes what shouldn‘t changed 
-Easer publishing and distribution over maven
For developers 
-reference like support lib or play services 
-Clean project structure 
-Online update if remote repository
Actual situation 
-Full copies of lib projects in source 
-Reference by file path 
-Build every time with your app 
-Difficult to optimize and obfuscate 
-Difficult to manage different lib versions
Actual situation 
-Full copies of lib projects in source 
-Reference by file path 
-Build every time with your app 
-Difficult to optimize and obfuscate 
-Difficult to manage different lib versions
Actual situation 
-Full copies of lib projects in source 
-Reference by file path 
-Build every time with your app 
-Difficult to optimize and obfuscate 
-Difficult to manage different lib versions
The idea 
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar‚ 
compile 'com.jeremyfeinstein.slidingmenu.lib:slidingmenu:1.3@aar' 
-Library projects are separated from app projects 
-Published as desired in to AAR 
-App developer only declare dependencies
Good to know 
Or how we failed the first time
Creating AAR is easy 
-Create lib project 
-Call „bundleRelease“
But now? 
-Place in project structure? Fail 
-Gradle include? Fail 
-Gradle file dependency? Fail
The trick 
-Provide as maven repo like google does 
-Publish into maven repo is easy with gradle 
-Reference AAR in access able repositories 
-New trick, import
The trick 
-Provide as maven repo like google does 
-Publish into maven repo is easy with gradle 
-Reference AAR in access able repositories 
-New trick, import
The trick 
-Provide as maven repo like google does 
-Publish into maven repo is easy with gradle 
-Reference AAR in access able repositories 
-New trick, import
A working example 
Decide what‘s next: live coding or slides ?
Start a library 
Use the project wizard to create an initial android library project.
Add something useful 
I added a static method which returns „Hello [name]! How are you?“
Tweak gradle 
-Add the android-maven plugin 
-Apply adroid-maven and maven plugin 
-Define maven meta data 
-Define upload archive task
Use gradle tasks 
-Call bundleReleaseto create AAR in build folder 
-Call uploadArchivesto upload the AAR to your locale repository
review 
That’s the repository created by gradle task „uploadArchives“
A new app 
Create a simple app to test our library.
Define dependency 
-Apply the maven plugin 
-Define your locale repository 
-Setup the dependency to the new library
Use it
Test
Note 
A referenced AAR library is not shown in Android Studio. 
You can use the library, you get auto completion etc. 
But you can it inspect it in the project structure! 
For Support-Lib and some other stuff from google it‘s working. 
I‘m sure it will come in future. 
One point I want to address!
Hint 
Martin Liersch who is well known for his gradle build system talk is providing a maven repository where he places a lot of useful library projects as AAR artifacts. 
GitHub: https://github.com/Goddchen/mvn-repo 
Repo URL: https://github.com/Goddchen/mvn-repo/raw/master/
Hint 
The gradle project webpage includes a very good documentation. 
http://www.gradle.org/docs/current/userguide/userguide.html 
In the maven plugin chapters is a part about uploading artifacts to repositories. Also explaining using different transports like ssh to a remote repository. 
http://www.gradle.org/docs/current/userguide/maven_plugin.html# uploading_to_maven_repositories
Observe 
Without the android-maven plugin this solution would be much more complicated. 
You can find the project at gitHub 
https://github.com/dcendents/android-maven-plugin
Pull requests 
Most off the public library projects for android can be found on github. 
Nearly all are still using ADT and are not providing AAR artifacts. 
But most often there is a smart guy already done the work to port to android studio and make it easy to publish an aar. So look up the pull requests for your favorite lib and you will find a fork for android studio. 
Like stefanrusk did for andengine: 
https://github.com/stefanrusek/AndEngine/tree/GLES2
Hint 
In one of the last releases of Android Studio they added an import feature for aarpackages. 
When that happens? I don’t know… 
You can find it over: 
File -> New Module -> Import JAR or AAR package 
New way to define dependency in gradle.build 
artifacts.add("default", file('myedulibrary-0.1.aar')) 
In 0.9.x is not working, 
updated in 1.0 rc1 not tested
Hint 
Inspect an aarlibrary in your app project. 
There is trick to do that. 
1. Close all open files. 
2. Select your app module in project view 
3. switch to structure view 
Then you will see your aarlibrary expanded in the tree view.
Thank you 
Feel free to approach me for any question. 
r.mertins@bitforce-it.de 
G+: ReneMertinsHH

More Related Content

What's hot

An Introduction to Eclipse Che - Next-Gen Eclipse Java IDE
An Introduction to Eclipse Che - Next-Gen Eclipse Java IDEAn Introduction to Eclipse Che - Next-Gen Eclipse Java IDE
An Introduction to Eclipse Che - Next-Gen Eclipse Java IDEKubeAcademy
 
Introduction to Eclipse Che / EclipseCon 2014
Introduction to Eclipse Che / EclipseCon 2014Introduction to Eclipse Che / EclipseCon 2014
Introduction to Eclipse Che / EclipseCon 2014Florent BENOIT
 
React Native - Getting Started
React Native - Getting StartedReact Native - Getting Started
React Native - Getting StartedTracy Lee
 
Moderne Android Builds mit Gradle
Moderne Android Builds mit GradleModerne Android Builds mit Gradle
Moderne Android Builds mit Gradleinovex GmbH
 
13 practical tips for writing secure golang applications
13 practical tips for writing secure golang applications13 practical tips for writing secure golang applications
13 practical tips for writing secure golang applicationsKarthik Gaekwad
 
Eclipse Che: The Next-Gen Eclipse IDE - Bordeaux jug 2016
Eclipse Che: The Next-Gen Eclipse IDE - Bordeaux jug 2016Eclipse Che: The Next-Gen Eclipse IDE - Bordeaux jug 2016
Eclipse Che: The Next-Gen Eclipse IDE - Bordeaux jug 2016Florent BENOIT
 
Ciao: Continuous Integration for Apps on OpenStack
Ciao: Continuous Integration for Apps on OpenStackCiao: Continuous Integration for Apps on OpenStack
Ciao: Continuous Integration for Apps on OpenStackEverett Toews
 
Write microservice in golang
Write microservice in golangWrite microservice in golang
Write microservice in golangBo-Yi Wu
 
Intro to react native
Intro to react nativeIntro to react native
Intro to react nativeModusJesus
 
Deploy your app with one Slack command
Deploy your app with one Slack commandDeploy your app with one Slack command
Deploy your app with one Slack commandFabio Milano
 
Designing Auto Generated Codes
Designing Auto Generated CodesDesigning Auto Generated Codes
Designing Auto Generated CodesHiroshi Kikuchi
 
"I have a framework idea" - Repeat less, share more.
"I have a framework idea" - Repeat less, share more."I have a framework idea" - Repeat less, share more.
"I have a framework idea" - Repeat less, share more.Fabio Milano
 
Genymotion with Jenkins
Genymotion with JenkinsGenymotion with Jenkins
Genymotion with JenkinsVishal Nayak
 
Continuous Integration for your Android projects
Continuous Integration for your Android projectsContinuous Integration for your Android projects
Continuous Integration for your Android projectsSergii Zhuk
 
Deploy Laravel on Heroku
Deploy Laravel on HerokuDeploy Laravel on Heroku
Deploy Laravel on HerokuEric Johnson
 
JavaOne 2016: The Deploy Master: From Basic to Zero Downtime, Blue/Green, A/B...
JavaOne 2016: The Deploy Master: From Basic to Zero Downtime, Blue/Green, A/B...JavaOne 2016: The Deploy Master: From Basic to Zero Downtime, Blue/Green, A/B...
JavaOne 2016: The Deploy Master: From Basic to Zero Downtime, Blue/Green, A/B...Rafael Benevides
 

What's hot (20)

React Native
React NativeReact Native
React Native
 
An Introduction to Eclipse Che - Next-Gen Eclipse Java IDE
An Introduction to Eclipse Che - Next-Gen Eclipse Java IDEAn Introduction to Eclipse Che - Next-Gen Eclipse Java IDE
An Introduction to Eclipse Che - Next-Gen Eclipse Java IDE
 
Introduction to Eclipse Che / EclipseCon 2014
Introduction to Eclipse Che / EclipseCon 2014Introduction to Eclipse Che / EclipseCon 2014
Introduction to Eclipse Che / EclipseCon 2014
 
React Native - Getting Started
React Native - Getting StartedReact Native - Getting Started
React Native - Getting Started
 
Moderne Android Builds mit Gradle
Moderne Android Builds mit GradleModerne Android Builds mit Gradle
Moderne Android Builds mit Gradle
 
13 practical tips for writing secure golang applications
13 practical tips for writing secure golang applications13 practical tips for writing secure golang applications
13 practical tips for writing secure golang applications
 
Eclipse Che: The Next-Gen Eclipse IDE - Bordeaux jug 2016
Eclipse Che: The Next-Gen Eclipse IDE - Bordeaux jug 2016Eclipse Che: The Next-Gen Eclipse IDE - Bordeaux jug 2016
Eclipse Che: The Next-Gen Eclipse IDE - Bordeaux jug 2016
 
ReactJS
ReactJSReactJS
ReactJS
 
Ciao: Continuous Integration for Apps on OpenStack
Ciao: Continuous Integration for Apps on OpenStackCiao: Continuous Integration for Apps on OpenStack
Ciao: Continuous Integration for Apps on OpenStack
 
Write microservice in golang
Write microservice in golangWrite microservice in golang
Write microservice in golang
 
Intro to react native
Intro to react nativeIntro to react native
Intro to react native
 
Deploy your app with one Slack command
Deploy your app with one Slack commandDeploy your app with one Slack command
Deploy your app with one Slack command
 
Designing Auto Generated Codes
Designing Auto Generated CodesDesigning Auto Generated Codes
Designing Auto Generated Codes
 
"I have a framework idea" - Repeat less, share more.
"I have a framework idea" - Repeat less, share more."I have a framework idea" - Repeat less, share more.
"I have a framework idea" - Repeat less, share more.
 
Genymotion with Jenkins
Genymotion with JenkinsGenymotion with Jenkins
Genymotion with Jenkins
 
React native
React nativeReact native
React native
 
Continuous Integration for your Android projects
Continuous Integration for your Android projectsContinuous Integration for your Android projects
Continuous Integration for your Android projects
 
Deploy Laravel on Heroku
Deploy Laravel on HerokuDeploy Laravel on Heroku
Deploy Laravel on Heroku
 
JavaOne 2016: The Deploy Master: From Basic to Zero Downtime, Blue/Green, A/B...
JavaOne 2016: The Deploy Master: From Basic to Zero Downtime, Blue/Green, A/B...JavaOne 2016: The Deploy Master: From Basic to Zero Downtime, Blue/Green, A/B...
JavaOne 2016: The Deploy Master: From Basic to Zero Downtime, Blue/Green, A/B...
 
Nativescript with angular 2
Nativescript with angular 2Nativescript with angular 2
Nativescript with angular 2
 

Similar to Get started with AAR archives

How to migrate SourcePro apps from Solaris to Linux
How to migrate SourcePro apps from Solaris to LinuxHow to migrate SourcePro apps from Solaris to Linux
How to migrate SourcePro apps from Solaris to LinuxRogue Wave Software
 
Alfresco DevCon 2018: SDK 3 Multi Module project using Nexus 3 for releases a...
Alfresco DevCon 2018: SDK 3 Multi Module project using Nexus 3 for releases a...Alfresco DevCon 2018: SDK 3 Multi Module project using Nexus 3 for releases a...
Alfresco DevCon 2018: SDK 3 Multi Module project using Nexus 3 for releases a...Martin Bergljung
 
Maven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable ResultsMaven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable ResultsSteve Keener
 
Composer the Right Way - MM16NL
Composer the Right Way - MM16NLComposer the Right Way - MM16NL
Composer the Right Way - MM16NLRafael Dohms
 
Open event (show&tell april 2016)
Open event (show&tell april 2016)Open event (show&tell april 2016)
Open event (show&tell april 2016)Jorge López-Lago
 
Internal Android Library Management (DroidCon SF 2016, Droidcon Italy 2016)
Internal Android Library Management (DroidCon SF 2016, Droidcon Italy 2016)Internal Android Library Management (DroidCon SF 2016, Droidcon Italy 2016)
Internal Android Library Management (DroidCon SF 2016, Droidcon Italy 2016)Kelly Shuster
 
RubyMotion Inspect Conference - 2013. (With speaker notes.)
RubyMotion Inspect Conference - 2013. (With speaker notes.)RubyMotion Inspect Conference - 2013. (With speaker notes.)
RubyMotion Inspect Conference - 2013. (With speaker notes.)alloy020
 
TDC2018FLN | Trilha Containers - Kubernetes para usuarios Docker.
TDC2018FLN | Trilha Containers - Kubernetes para usuarios Docker.TDC2018FLN | Trilha Containers - Kubernetes para usuarios Docker.
TDC2018FLN | Trilha Containers - Kubernetes para usuarios Docker.tdc-globalcode
 
Dockercon EU 2014
Dockercon EU 2014Dockercon EU 2014
Dockercon EU 2014Rafe Colton
 
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...Docker, Inc.
 
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for ClojureLeiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for ClojureJohn Stevenson
 
Architecting the Future: Abstractions and Metadata - CodeStock
Architecting the Future: Abstractions and Metadata - CodeStockArchitecting the Future: Abstractions and Metadata - CodeStock
Architecting the Future: Abstractions and Metadata - CodeStockDaniel Barker
 
Writing Android Libraries
Writing Android LibrariesWriting Android Libraries
Writing Android Librariesemanuelez
 
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...Paul Withers
 
Introduction to new technologies in drupal 8
Introduction to new technologies in drupal 8Introduction to new technologies in drupal 8
Introduction to new technologies in drupal 8naxoc
 

Similar to Get started with AAR archives (20)

Maven Introduction
Maven IntroductionMaven Introduction
Maven Introduction
 
How to migrate SourcePro apps from Solaris to Linux
How to migrate SourcePro apps from Solaris to LinuxHow to migrate SourcePro apps from Solaris to Linux
How to migrate SourcePro apps from Solaris to Linux
 
Alfresco DevCon 2018: SDK 3 Multi Module project using Nexus 3 for releases a...
Alfresco DevCon 2018: SDK 3 Multi Module project using Nexus 3 for releases a...Alfresco DevCon 2018: SDK 3 Multi Module project using Nexus 3 for releases a...
Alfresco DevCon 2018: SDK 3 Multi Module project using Nexus 3 for releases a...
 
Maven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable ResultsMaven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable Results
 
Composer the Right Way - MM16NL
Composer the Right Way - MM16NLComposer the Right Way - MM16NL
Composer the Right Way - MM16NL
 
Javascript mynotes
Javascript mynotesJavascript mynotes
Javascript mynotes
 
Open event (show&tell april 2016)
Open event (show&tell april 2016)Open event (show&tell april 2016)
Open event (show&tell april 2016)
 
Internal Android Library Management (DroidCon SF 2016, Droidcon Italy 2016)
Internal Android Library Management (DroidCon SF 2016, Droidcon Italy 2016)Internal Android Library Management (DroidCon SF 2016, Droidcon Italy 2016)
Internal Android Library Management (DroidCon SF 2016, Droidcon Italy 2016)
 
TorqueBox
TorqueBoxTorqueBox
TorqueBox
 
RubyMotion Inspect Conference - 2013. (With speaker notes.)
RubyMotion Inspect Conference - 2013. (With speaker notes.)RubyMotion Inspect Conference - 2013. (With speaker notes.)
RubyMotion Inspect Conference - 2013. (With speaker notes.)
 
TDC2018FLN | Trilha Containers - Kubernetes para usuarios Docker.
TDC2018FLN | Trilha Containers - Kubernetes para usuarios Docker.TDC2018FLN | Trilha Containers - Kubernetes para usuarios Docker.
TDC2018FLN | Trilha Containers - Kubernetes para usuarios Docker.
 
Dockercon EU 2014
Dockercon EU 2014Dockercon EU 2014
Dockercon EU 2014
 
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
 
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for ClojureLeiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
 
Architecting the Future: Abstractions and Metadata - CodeStock
Architecting the Future: Abstractions and Metadata - CodeStockArchitecting the Future: Abstractions and Metadata - CodeStock
Architecting the Future: Abstractions and Metadata - CodeStock
 
Android presentation - Gradle ++
Android presentation - Gradle ++Android presentation - Gradle ++
Android presentation - Gradle ++
 
Versions
VersionsVersions
Versions
 
Writing Android Libraries
Writing Android LibrariesWriting Android Libraries
Writing Android Libraries
 
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
 
Introduction to new technologies in drupal 8
Introduction to new technologies in drupal 8Introduction to new technologies in drupal 8
Introduction to new technologies in drupal 8
 

Recently uploaded

Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Hasting Chen
 
Philippine History cavite Mutiny Report.ppt
Philippine History cavite Mutiny Report.pptPhilippine History cavite Mutiny Report.ppt
Philippine History cavite Mutiny Report.pptssuser319dad
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...Sheetaleventcompany
 
Microsoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AIMicrosoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AITatiana Gurgel
 
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...henrik385807
 
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...NETWAYS
 
Motivation and Theory Maslow and Murray pdf
Motivation and Theory Maslow and Murray pdfMotivation and Theory Maslow and Murray pdf
Motivation and Theory Maslow and Murray pdfakankshagupta7348026
 
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...Salam Al-Karadaghi
 
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...Pooja Nehwal
 
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Kayode Fayemi
 
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdfOpen Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdfhenrik385807
 
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdfCTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdfhenrik385807
 
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptxMohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptxmohammadalnahdi22
 
SaaStr Workshop Wednesday w: Jason Lemkin, SaaStr
SaaStr Workshop Wednesday w: Jason Lemkin, SaaStrSaaStr Workshop Wednesday w: Jason Lemkin, SaaStr
SaaStr Workshop Wednesday w: Jason Lemkin, SaaStrsaastr
 
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesVVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesPooja Nehwal
 
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...NETWAYS
 
Russian Call Girls in Kolkata Vaishnavi 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Vaishnavi 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Vaishnavi 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Vaishnavi 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...NETWAYS
 
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝soniya singh
 
George Lever - eCommerce Day Chile 2024
George Lever -  eCommerce Day Chile 2024George Lever -  eCommerce Day Chile 2024
George Lever - eCommerce Day Chile 2024eCommerce Institute
 

Recently uploaded (20)

Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
 
Philippine History cavite Mutiny Report.ppt
Philippine History cavite Mutiny Report.pptPhilippine History cavite Mutiny Report.ppt
Philippine History cavite Mutiny Report.ppt
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
 
Microsoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AIMicrosoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AI
 
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
 
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...
 
Motivation and Theory Maslow and Murray pdf
Motivation and Theory Maslow and Murray pdfMotivation and Theory Maslow and Murray pdf
Motivation and Theory Maslow and Murray pdf
 
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
 
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
 
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
 
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdfOpen Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
 
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdfCTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
 
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptxMohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
 
SaaStr Workshop Wednesday w: Jason Lemkin, SaaStr
SaaStr Workshop Wednesday w: Jason Lemkin, SaaStrSaaStr Workshop Wednesday w: Jason Lemkin, SaaStr
SaaStr Workshop Wednesday w: Jason Lemkin, SaaStr
 
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesVVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
 
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...
 
Russian Call Girls in Kolkata Vaishnavi 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Vaishnavi 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Vaishnavi 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Vaishnavi 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
 
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
 
George Lever - eCommerce Day Chile 2024
George Lever -  eCommerce Day Chile 2024George Lever -  eCommerce Day Chile 2024
George Lever - eCommerce Day Chile 2024
 

Get started with AAR archives

  • 1. Get started with AAR archives How to create and work with the new AAR archive format using gradle and android studio
  • 2. René Mertins Senior Java Architect with more then 10 years experience. Architect of the apponsormonetization platform. Email: r.mertins@bitforce-it.de g+: +ReneMertinsHH www.apponsor.com www.bitforce-it.de
  • 3. WTF is AAR? -Introduced I/O 2013 -Library project packaging format -AAR is Android ARchive
  • 5. Benefits 1.Never handle complete library projects any more 2.No need to publish a library in source
  • 6. For distributors -Provide precompiled -Optimized and obfuscated for best performance -Be more sure that no one changes what shouldn‘t changed -Easer publishing and distribution over maven
  • 7. For developers -reference like support lib or play services -Clean project structure -Online update if remote repository
  • 8. Actual situation -Full copies of lib projects in source -Reference by file path -Build every time with your app -Difficult to optimize and obfuscate -Difficult to manage different lib versions
  • 9. Actual situation -Full copies of lib projects in source -Reference by file path -Build every time with your app -Difficult to optimize and obfuscate -Difficult to manage different lib versions
  • 10. Actual situation -Full copies of lib projects in source -Reference by file path -Build every time with your app -Difficult to optimize and obfuscate -Difficult to manage different lib versions
  • 11. The idea compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar‚ compile 'com.jeremyfeinstein.slidingmenu.lib:slidingmenu:1.3@aar' -Library projects are separated from app projects -Published as desired in to AAR -App developer only declare dependencies
  • 12. Good to know Or how we failed the first time
  • 13. Creating AAR is easy -Create lib project -Call „bundleRelease“
  • 14. But now? -Place in project structure? Fail -Gradle include? Fail -Gradle file dependency? Fail
  • 15. The trick -Provide as maven repo like google does -Publish into maven repo is easy with gradle -Reference AAR in access able repositories -New trick, import
  • 16. The trick -Provide as maven repo like google does -Publish into maven repo is easy with gradle -Reference AAR in access able repositories -New trick, import
  • 17. The trick -Provide as maven repo like google does -Publish into maven repo is easy with gradle -Reference AAR in access able repositories -New trick, import
  • 18. A working example Decide what‘s next: live coding or slides ?
  • 19. Start a library Use the project wizard to create an initial android library project.
  • 20. Add something useful I added a static method which returns „Hello [name]! How are you?“
  • 21. Tweak gradle -Add the android-maven plugin -Apply adroid-maven and maven plugin -Define maven meta data -Define upload archive task
  • 22. Use gradle tasks -Call bundleReleaseto create AAR in build folder -Call uploadArchivesto upload the AAR to your locale repository
  • 23. review That’s the repository created by gradle task „uploadArchives“
  • 24. A new app Create a simple app to test our library.
  • 25. Define dependency -Apply the maven plugin -Define your locale repository -Setup the dependency to the new library
  • 27. Test
  • 28. Note A referenced AAR library is not shown in Android Studio. You can use the library, you get auto completion etc. But you can it inspect it in the project structure! For Support-Lib and some other stuff from google it‘s working. I‘m sure it will come in future. One point I want to address!
  • 29. Hint Martin Liersch who is well known for his gradle build system talk is providing a maven repository where he places a lot of useful library projects as AAR artifacts. GitHub: https://github.com/Goddchen/mvn-repo Repo URL: https://github.com/Goddchen/mvn-repo/raw/master/
  • 30. Hint The gradle project webpage includes a very good documentation. http://www.gradle.org/docs/current/userguide/userguide.html In the maven plugin chapters is a part about uploading artifacts to repositories. Also explaining using different transports like ssh to a remote repository. http://www.gradle.org/docs/current/userguide/maven_plugin.html# uploading_to_maven_repositories
  • 31. Observe Without the android-maven plugin this solution would be much more complicated. You can find the project at gitHub https://github.com/dcendents/android-maven-plugin
  • 32. Pull requests Most off the public library projects for android can be found on github. Nearly all are still using ADT and are not providing AAR artifacts. But most often there is a smart guy already done the work to port to android studio and make it easy to publish an aar. So look up the pull requests for your favorite lib and you will find a fork for android studio. Like stefanrusk did for andengine: https://github.com/stefanrusek/AndEngine/tree/GLES2
  • 33. Hint In one of the last releases of Android Studio they added an import feature for aarpackages. When that happens? I don’t know… You can find it over: File -> New Module -> Import JAR or AAR package New way to define dependency in gradle.build artifacts.add("default", file('myedulibrary-0.1.aar')) In 0.9.x is not working, updated in 1.0 rc1 not tested
  • 34. Hint Inspect an aarlibrary in your app project. There is trick to do that. 1. Close all open files. 2. Select your app module in project view 3. switch to structure view Then you will see your aarlibrary expanded in the tree view.
  • 35. Thank you Feel free to approach me for any question. r.mertins@bitforce-it.de G+: ReneMertinsHH