Over a million developers have joined DZone.

JRebel for Android 2.0 Now Available!

DZone 's Guide to

JRebel for Android 2.0 Now Available!

Time flies and software keeps getting better. This is a universally good thing.

· Mobile Zone ·
Free Resource

Time flies and software keeps getting better. This is a universally good thing.

Today, I’m excited to announce a significant milestone in the development of JRebel for Android. JRebel for Android has reached the 2.0 status. This is the first major release we have introduced since the release of JRebel for Android v1.0 in December last year.

We have been listening to your feedback and turned it into features that will help JRebel for Android make your development process faster and simpler. Literally hundreds of fixes and improvements have been added in the v2.0 release.

In this post I want to shed some light on the main features we’ve added since v1.0 and why we think it’s a really big deal.

Incremental Java compilation with annotation processor support

Incremental Java compilation is the single most important addition to JRebel for Android 2.0.
If you tried JRebel for Android before, you know that it works beautifully.

With incremental compilation now enabled in JRebel for Android, the build process only captures those parts of the code that are changed. Leveraging the incremental compiler results in significantly faster builds and working with JRebel for Android is a whole new experience.

Expanding on the above, compiling an Android project can be a rather long process, especially if you include all the annotation processing for libraries like Daggers, Butterknife, Icepick and others that must be accounted for in the build.

To give you a taste of the benefits for incremental Java compilation, here’s an example.

We used an internal test project for incremental compiler testing. It’s quite large, consisting of 4706 application classes, 14497 Android resources, 84 libraries, Dagger 2, Butterknife, and others, with 7971 library classes in total.

The screenshots below show the difference in build times with JRebel for Android with incremental compilation enabled and disabled.

Image title

To obtain these profiles we changed a single line of code in this rather large app and measured the time it took to build the project.

Notice how the :app:compileFreeLegacyFatDebugWithJavaWithJavac task, which is where the compilation happens, took 12.8 seconds. JRebel for Android completed the incremental compilation within under 1.6 seconds. That’s an 8x time difference. You should expect similar gains with your projects. Naturally, your mileage may vary. For a better understanding of the benefits, it can bring you, check out this blog post with more benchmark details.

One of the more difficult efforts was integrating all the libraries containing an annotation processor to work with the incremental compiler in JRebel for Android.

So far, we have added support for the following libraries:

  • Butter Knife
  • Parceler
  • Icepick
  • Dagger
  • Dagger2
  • AutoValue
  • Greenrobot eventbus
  • Dart
  • Henson
  • Deeplink
  • Epoxy

When using these, definitely give JRebel for Android a try. You can only win. 

Zero Configuration and IntelliJ IDEA

Getting started with JRebel for Android is far simpler with the 2.0 release. You only need the JRebel for Android plugin installed in your Android Studio or IntelliJ IDEA. Yes indeed, we have added IntelliJ IDEA to our supported list of IDEs. Just like before, the plugin is available from the Jetbrains repositories. Grab it from Android Studio / IntelliJ IDEA > Preferences > Plugins > Browse repositories… > Search “JRebel for Android”.Image title

JRebel for Android no longer needs to add the Gradle plugin to your build.gradle file to work. Your project files will need zero modification.

Optimized Heap Memory Utilization

We’ve taken a critical look into how much memory JRebel for Android uses when running and have made some serious optimizations. Our testing data shows that JRebel for Android memory overhead is now reduced by around 3x. Below is comparison between JRebel for Android v1.0 and v2.0 after garbage collection in the Android Device Monitor for the same app we tested above:Image title

In the above screenshot, v1.0 is on the top and v2.0 is on the bottom and as you can see the memory usage is reduced from ~96mb to ~34mb. Again, this is nearly a 3x difference!

Changes to Licensing

We have revised the licensing options based on your feedback. The JRebel for Android v2.0, Individual license now includes multidex, JNI linking, and debugger integration. Now you can debug everything!

In addition, the Business license now exclusively includes incremental compiler with support for annotation processors. The larger your project is, the more benefit you’ll see from incremental compilation.

We are really happy to introduce these increases in JRebel for Android functionality in v2.0! More developers can leverage JRebel for Android without restrictions to the technologies they are using and at the same time speed up their Android development.

android ,jrebel ,mobile ,intellij

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}