Sorry, you need to enable JavaScript to visit this website.


Mayloon is an Android to HTML5 porting tool. It is designed to reduce the cost of migrating applications from Android to HTML5 platforms (such as Tizen). It does this by translating the application's Java source code to JavaScript and reusing the application's resources (images, layouts, etc).

Jumpstart an HTML5 application using MayLoon in 2 hours

Jun 09, 2013


Last week, we MayLoon team have received a third party application named "Transformer". "Transformer" is an Android application based on Android API level 10. We want to try to convert it to HTML5 application with MayLoon.

As the first step, I imported the "Transformer" project into Eclipse and built it with ADT and ran it successfully in the Android Emulator to check its original UI and behavior in Android.

The second step, I converted "Transformer" to a MayLoon project by clicking the covert menu provided by MayLoon Eclipse plug-in. Unfortunately, there are some Java compile errors in the converted project: one missing class and several missing APIs.

The third step, I ported the missing APIs from the Android 2.3.3r1 source code, and also the missing class to MayLoon framework. With this work, there are no compiler errors in the project and it builds successfully in MayLoon. Oh, sounds like a big step forward.

After that, I began to try the generated application in HTML5 supported browser, Chrome. The bad news was that "Transformer" failed to launch. I used the debugger "Developer Tools" provided by Chromium to identify the problems. After several rounds of debugging, two issues were identified: one is the Java-to-JavaScript compiler bug, it can't handle Class static member initialization well; the other is the SQLite feature is not supported in MayLoon now. So in order to workaround fast, for the compiler bug, I initialized the static member in the Class constructor; for the SQLite bug, I just provided the data need as hard-code in "Transformer" while not reading it from SQLite database.

After workaround the two issues, I tried to re-launch the "Transformer". Guess what, the "Transformer" launched successfully! I saw the main UI in the web, almost same as in Android Emulator! It only took me 2 hours to show the main UI with our MayLoon tool, really cool and exciting!

To make the “Transformer” work well with the right functionality, we still have to fix several issues: 1. several bugs are found during the enabling. 2. the major feature SQLite is missing in MayLoon. Anyway, the result of 2 hours has greatly inspired me and made me confident to move on.

Last but not least, I want to emphasize that MayLoon’s mission is to speed-up the migration from Android to HTML5 application. We will try to make the porting as easy as possible but not assuming full automation.