ReDex goes Open Source .. get your app optimized.
Shreyansh Bhavsar
Talent & Organization Development Leader | Building Leaders & High Performance Teams | People & Culture Transformation | Strategy & Process Excellence catalyst | Leadership Coach & Career Architect | Ex- Amazon
Is your Android Code Optimized? If not, optimize it now using ReDex
Optimizing a code is always a vital issue / requirement for any developer and when it comes to Android apps, it becomes a bottleneck for developers to make it optimized. Various tool and platforms are available to optimize an Android Code, But one of the eye catching tool which has been in the news now a days is ReDex. Facebook, originally built this tool to optimize their own Android App and they claimed that their new app with ReDex optimization is 25 % smaller in size and has 30% faster start time.
Now Facebook has open sourced this ReDex. This is a good news for Android Developers who are really interested to optimize their code, and who won’t be?!! If you know the compiling structure of Android source code, then it will be easy to understand the role of ReDex.
.dex file??
Android programs are compiled into .dex (Dalvik Executable) files, which are in turn zipped into a single .apk file on the device. . dex files can be created automatically by Android translating compiled applications written in the Java programming language. This is where optimization should be achieved using ReDex. Engineers from facebook worked on this .dex file and found some solutions to achieve optimization.
“ We organized our optimization pipeline as a series of stages, with the “original” .dex entering at the beginning of the pipeline and the “transformed” .dex exiting at the end. Each stage in the pipeline can be thought of as a stand-alone “optimization plugin” that snaps into place behind the previous stage, allowing us to chain multiple different, potentially unrelated transforms behind one another. “ - Facebook
Optimization includes various aspects like Reducing bytecodes, Minification and compression ,Inining of methods, and dead code elimination. ReDex can be used to achieve all of this in a go !!! If you are a serious Android developer and really want to improve your App’s performance, ReDex is for you.
ProGuard vs. ReDex
ReDex is conceptually similar to ProGuard, in that both optimize bytecode. ReDex, however, optimizes .dex bytecode, while ProGuard optimizes .class bytecode before it is lowered to .dex. Operating on .dex is sometimes an advantage: you can consider the number of virtual registers used by a method that is an inlining candidate, and you can control the layout of classes within a dex file. But ProGuard has many capabilities that ReDex does not (for example, ReDex will not remove unused method parameters, which ProGuard does).
You can find ReDex on GitHub and try it out on your apps.