Mono for Android 4.0 comes with a VS plug-in, incremental build, incremental deployment, installer with all packages needed, Google Maps integration, and support for Java 7. Miguel de Icaza explains how incremental build and deployment works, and how much they help.
Xamarin has announced the release of Mono for Android 4.0, enabling .NET/C# developers to create applications for Android smartphones and tablets. This version supports all the new features introduced in Ice Cream Sandwich, and it comes with a number of new features:
- A Visual Studio plug-in for Android development
- An incremental builder which is reducing build times by 40%
- Incremental deployment support reducing the deployment time “from minutes to seconds”
- An installer that packages together all the pieces necessary for Android development on Mono: JDK, Android SDK, GTK#, MonoDevelop and Mono for Android.
- Google Maps integration
- Java 7 support
InfoQ has talked to Miguel de Icaza, CTO at Xamarin, to find out more details about this latest release of Mono for Android.
InfoQ: Would you like to detail a bit Xamarin's incremental build?
Miguel de Icaza: In the past, we treated the entire build process as an opaque box. Our new setup splits the build process in stages, and does this taking advantage of Microsoft's MSBuild compilation system. By partitioning the work and surfacing the internal workings of the build process the MSBuild tooling can only rebuild the components that are necessary (this also benefits from our new incremental uploading). The partitioning now handles code changes differently than code changes that require Java code to be generated and from changes to resources (artwork, audio, images, localization). This table shows the benefits of are the results of various scenarios, from full builds to incremental builds as measured using the sample JetBoy app:
|
||
|
1.2.0 |
1.9.0 |
First Build: |
8.66s |
8.19s |
Code Changes: |
5.78s |
1.71s |
Code Changes Requiring New Java Stubs: |
5.78s |
2.50s |
Resource Changes: |
8.18s |
6.10s |
InfoQ: What about incremental deployment? How does it work?
Miguel de Icaza: In the past, Mono for Android used the same pattern that Java on Android does when building applications for an Android device: we would build the software, package it all up and upload the result to the emulator or device for execution. In Mono's case during development we would upload the shared Mono runtime to the device, to avoid repeatedly uploading the same code over and over. But this still meant that every time the user made a change to his code, we compiled the code, packaged the code, signed the code, uploaded the package to Android, and asked Android to perform a package installation. This entire process can take a long time and can drive even the most Zen developer insane.
Our new fast development setup shortcuts this process at various points: only the modified code is recompiled, and only the modified code is uploaded to the device. We upload the resulting delta to Android, skipping packaging, skipping signing and skipping the request to Android to install the resulting package. Instead our new software packages are designed to be upgraded in-place. So only the first deployment goes through packaging and signing. Any subsequent builds merely get the changed code uploaded, reducing the turn-around time to deploy the software. This table shows the benefits based on the various scenarios as measured by the JetBoy sample app:
|
||
|
Normal |
Fast Deployment |
Full build and install: |
15.6s |
15.6s |
No changes, build and install: |
1.8s |
2.5s |
Resource change, build and install: |
10.8s |
10.8s |
Code change, build and install: |
14.7s |
3.9s |
InfoQ: What are the main advantages/disadvantages of developing using the VS plug-in vs. MonoDevelop?
Miguel de Icaza: The benefit of MonoDevelop is that it is bundled with the product, so it comes at no extra charge and developers can get started right away. But it does not have all the features that Visual Studio has.
Visual Studio is a very complete IDE, but to use it with Mono for Android, users need to get the Professional edition, the free Express edition does not work (since Express does not allow plugins). But if the user has Visual Studio, the entire set of tools that are part of VS are at their disposal, as well as a large set of plugins and extensions that developers typically use with it, including popular tools like Resharper and in many organizations it also gives them integration with their own bug tracking systems, source code repositories and other team facilities that are part of VS.
Many users really want VS for Resharper alone.
InfoQ: What is the status with Java 7?
Miguel de Icaza: Java 7 broke some programs, so we had to fix MonoTouch for Android to work on systems where the user had upgraded their Java installation to 7.0. We do not directly expose any Java 7 features, as C# is strictly a superset of Java, making our feature set already larger.