RSS

Search Engine

Wednesday, September 8, 2010

The story behind Opera Mini on Google Android

Introduction

This article takes a look at one of Opera's latest and greatest projects - the creation of an Opera Mini version that will run on Google's Android open mobile development platform. Over the course of the article, we'll explain why we created it, how, challenges we faced, and how you can try it out for yourself. We'd like to encourage you to try it out, and give us as much feedback as you possibly can. Enjoy!

Why did we do it?

When we first heard about Google Android, we were very excited about the possibilities it presents, and thought it would be very cool to make Opera Mini available on it, plus it would give mobile developers a better choice of browsers to make available on handsets. But it goes beyond just cool factor - one of Opera's central doctrines is providing the best internet experience on any device - the Android platform is another missing piece of the puzzle for us to fill in.

There are also practical reasons - the Opera Mini browser renders web pages that have been transcoded to the binary OBML format, meaning much smaller downloads and a faster browsing experience on mobiles, than would be provided by other browsers (the Android WebKit-based browser component has a switch in the public API allowing the use of a transcoding proxy that transcodes web pages to a simpler form of HTML. Whether this is as small and fast as Opera Mini's OBML remains to be seen.)

How did we do it?

How did we do it? We decided to use the existing Opera Mini code base (even the binary package) instead of creating a separate port, to save on resourses. We created a special wrapper that translates Java ME (mostly MIDP) API calls into Android API calls. The tool used was MicroEmulator - this is an open source (LGPL) implementation of Java ME that runs on top of Java SE. The lead Opera Mini Android developer is also the lead developer of MicroEmulator, so it was an inspired choice! The Android platform is similar to Java SE, with the exception of several libraries normally included in Java SE (like AWT/Swing - these are excluded because they would likely be too heavy to fit into the embedded environment.) It is therefore fairly simple to port MicroEmulator to run inside Android environment. The only major task was to replace the AWT/Swing graphics backend of MicroEmulator with Android specific APIs.

Issues we faced

This section details the issues we faced when making the Opera Mini port over to Android:

  1. First, the Android platform is a very fresh set of APIs. There is not much information available on the web, and the community around Android is just forming, so sometimes it is difficult to find an answer if something during development is not going very well and you have questions. Other people involved in Android development are very willing to help others, however

  2. Next, you need to consider that Android is not a finished product yet - for example, the last SDK update changed a large number of the APIs, so as we fixed existing issues, new problems appeared; the most serious being performance degradation of the emulator, which we are currently working on

  3. We still have no access to any hardware that will run Android. It is currently impossible to say how fast Opera Mini will run on real devices

  4. Integration between the Eclipse IDE and the Android SDK is seamless, making for a nice coding experience. The Android emulator however runs inside QEMU, which is a bit to slow even on fast desktops. This is quite annoying and we hope it will improve in the next SDK updates


Try it yourself!

As mentioned above, there is currently no hardware available that will run Android, but you can still try the Opera Mini Android version out using the Android SDK and emulator. Here's how (these steps are basically the same on any platform that runs the SDK):

  1. Download and install latest version of Android SDK

  2. Obtain the Opera Mini for Android package

  3. Once you have installed the Android SDK, start the Android emulator that comes with it (this can be found at {Android home}/tools/emulator

  4. Transfer and install the Opera Mini package into the emulator - you can do this with the following command line input - {Android home}/tools/adb install OperaMini.apk

Opera Mini should now appear in the emulator Applications folder.

0 comments:

Post a Comment