The Closure Compiler
Running your scripts through the Google Closure Compiler really makes a difference. Code will be smaller. For this reason, compiled code will parse quicker on the mobile device. Additionally, Closure Compiler provides other benefits in regards to code optimization.
Creating Android Applications with Phonegap/Apache Cordova
Although Phonegap is a very powerful tool for developing multi-platform applications, debugging support for your PhoneGap applications is not as well-developed as for native Apps or pure web apps.
The main hurdle is that the code to debug is on your mobile device or simulator, not your browser. This makes it difficult to synchronize breakpoints or retrieve stack traces. Console logging can help somehow but not as much as in Web browsers. With that in mind, wouldn’t it be better if errors were caught before debugging? That’s why you want to use this tool, as it does exactly that.
Benefits of using the Closure Compiler
In short, using the Closure Compiler brings the following benefits to the development toolset:
Summing up, the Closure Compiler helps you find syntax errors during development (rather than during testing) and identify potentially buggy code patterns. This makes it a very valuable tool in Phonegap/Cordova application. development. In addition, the Closure Compiler meets or exceeds the compression factors of other code minification tools. This improves startup and running times of your applications, making your code highly efficient.