Profile

Cover photo
Fernando Cejas
Works at Tuenti
Attended Universidad Católica Argentina
Lives in Barcelona
697 followers|161,209 views
AboutPostsPhotosYouTube

Stream

Fernando Cejas

Shared publicly  - 
1
Add a comment...

Fernando Cejas

Shared publicly  - 
 
Nice to know
4
1
Sergio Muriana's profile photo
Add a comment...

Fernando Cejas

Shared publicly  - 
 
Remote execution ahahha
3
Alberto Gutierrez Juanes's profile photo
 
J jajajja
Add a comment...

Fernando Cejas

Shared publicly  - 
 
 
Today’s #AndroidDev #Protip from +Stephan Linzner is about improving Gradle build performance.

Gradle, the new build system for Android projects, has been designed for scalability and efficiency. However, there are a few things you, as a developer, can do to significantly improve the performance of Gradle.

1. Incremental Builds. Gradle supports full incremental builds out of the box, which means that it only runs tasks that are not up to date and skips others. Gradle looks at the inputs and outputs of each task to see if any build artifacts have changed and only runs a task if necessary—this significantly increases build performance.

2. Gradle Daemon. [0] The Gradle daemon is a great way to speed up your builds, which is extremely useful when you have to build your application repeatedly. The basic idea is to fork a “daemon” process [1] which can be reused on subsequent builds, rather than launching a new JVM on every build.

The good news is that Android Studio always keeps a Gradle daemon around for you. However, if you build from the command line, you need to tell gradle that you want to use the Gradle daemon. You can use command line arguments [2] to interact with Gradle daemon, but the easiest way is to add a daemon property to your gradle.properties file:

org.gradle.daemon=true

It is also good practice to set this property in $HOME/.gradle/gradle.properties rather than putting it in project root. The reasoning behind this is that you want to avoid using the Gradle daemon on your build servers, where startup time is less important than memory consumption.

3. Parallel Project Execution. [3] Parallel execution can make a significant difference if you are building a very complex project with many sub-projects (for example, Android library projects). Gradle has an in-development Parallel Mode which enables parallel execution of sub-projects that are decoupled. “Decoupled” means that these projects do not access each other's project model. Cross project configurations are a good example of this. Any use of the allprojects {} and subprojects {} closures will result in the projects being coupled. Android Studio does not use Parallel Mode by default, but you can enable it in Preferences > Compiler > Gradle.

Again, if you are using the command line you need to explicitly tell Gradle that you want to use Parallel Mode. To enable it, add the parallel property to your gradle.properties file:

org.gradle.parallel=true

4. Disable pre-dexing on build servers. When running your build on a build server, you may always want to start with a clean build. But this means that you cannot take advantage of Gradle’s incremental nature. To improve incremental builds, the Android Gradle Plugin uses an optimization that pre-dexes all dependencies at first compilation. While this optimization makes subsequent builds faster it makes the first build slower. As this is not what you want, it makes sense to disable pre-dexing to improve performance by setting the preDexLibraries property of the Android Gradle Plugin  to false [4]:

project.android.dexOptions.preDexLibraries=false

For more details on how to disable pre-dexing only on your build server, refer to this tip from +Xavier Ducrohet  goo.gl/2G6hcj

With Android projects becoming increasingly complex and modular development practices becoming more popular, build performance is critical. Only a few seconds per build can make a big difference in productivity.

Do you have any other tips and tricks? Please let us know in the comments.

[0] Gradle Daemon - http://goo.gl/fVoeGC
[1] This process will automatically expire after 3 hours
[2] Gradle Command Line - http://goo.gl/UrDjOA
[3] Parallel Project Execution - http://goo.gl/QuAPoK
[4] Advanced Build Customization - http://goo.gl/3QiCil

#AndroidTools
4
2
Javier Martin's profile photoSanti Iglesias's profile photo
Add a comment...
 
Love them! Penguin Fail - Best Bloopers from Penguins Spy in…: http://youtu.be/Tcx6YyXvvRI
1
Add a comment...
Have him in circles
697 people

Fernando Cejas

Shared publicly  - 
 
Hahaha smart bunny!
 
Maybe it's cheating, but he still won my heart.
http://9gag.com/gag/a8WXYb6?ref=gp

#bunny  #rabbit #smart #cute   #awwclub   #aww   #animals   #GIF  
3
Add a comment...
 
It's recommend to change your password after #heartbleed #nightmare . Here is a list of websites affected: http://mashable.com/2014/04/09/heartbleed-bug-websites-affected/ #ssl  
Heartbleed: A look at which companies have issued a security patch to fix the Heartbleed bug.
1
Add a comment...
 
Remember: Having a strong test suite that covers your code is a precondition for refactoring. #refactoring #testing #test #Developer
4
Add a comment...
 
Blog Post: Unit testing asynchronous methods with #mockito http://goo.gl/tGdKeb #unitTesting #testing #Developer #test #testers #mocks

Sometimes we have to test methods that use callbacks, meaning that they are asynchronous by definition. These methods are not easy to test and using Thread.sleep(milliseconds) method to wait for the response is not a good practice and can convert your tests in non-deterministic ones (I have seen this many times to be honest).

To deal with this you can use Mockito doAnswer and ArgumtentCaptor. Check the article for full example. 
2
1
Cristian Garcia's profile photo
Add a comment...

Fernando Cejas

Shared publicly  - 
 
 
Don't judge me, it's back leg day..
#lol #dog #fitness #gif

via http://xeeme.com/BOUCHAC
1
1
Ivo Encarnação's profile photo
Add a comment...
People
Have him in circles
697 people
Work
Occupation
Mobile Software Engineer and GDG Organizer
Employment
  • Tuenti
    Mobile Software Engineer, present
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
Barcelona
Previously
Las Parejas - Rosario
Story
Tagline
GDG Barcelona Organizer. Agile, Android and technology fan. Creator of NFC Actions Android App. Working at @tuenti
Introduction
Software engineer working at @tuenti.  GDG Barcelona Organizer. Agile methodologies, programming and technology geek.

Hobbies: programming, technology, music, sports, travelling, ;)
Bragging rights
Have a lot of gadgets
Education
  • Universidad Católica Argentina
    Software Engineer
Basic Information
Gender
Male
Looking for
Friends, Networking
Other names
Penano