# MicroEmulator

MicroEmulator (also MicroEMU) — is a free and open-source platform independent J2ME emulator allowing to run MIDlets (applications and games) on any device with compatible JVM. It is written in pure Java as an implementation of J2ME in J2SE.

## History

In November 2001, MicroEmulator project has been created on SourceForge.
On 31 March 2006, MicroEmulator version 1.0 has been released.
In November 2009, project moved to code.google.com, and after Google closed it, development moved to GitHub.
On 10 January 2010, the last stable version 2.0.4 has been released.
On 24 May 2013, the last preview version 3.0.0-SNAPSHOT.112 has been released.
After 2014, MicroEMU technology has been acquired by All My Web Needs company and all the MicroEmulator's docs and binary builds has been removed from the official site.
All sources and binary previously released on SourceForge, Google Code and GitHub preserved as open-source, but development stalled since then.

## Features

* Supports loading MIDlet from JAD or JAR file (locally stored or remotely accessed via URL)
* Supports various Java APIs and JSRs (Java Specification Requests):
** MIDP 2.0 (JSR 118)
** CLDC 1.0 (JSR 30)
** CLDC 1.1 (JSR 139)
** Generic Connection Framework API (GCF)
** File Connection and PIM API (JSR 75)
** Bluetooth API (JSR 82)
** Wireless Messaging API (WMA, JSR 120)
** Multimedia API (MMAPI, JSR 135)
** Location API (LAPI, JSR 179)
** Record Management System API (RMS)
** LCDUI, Nokia and Siemens UI APIs
* Platform independent (Linux, Mac OS, Windows, etc.)
* Works with different GUI libraries (Swing, SWT, etc.)
* Supports insert PC clipboard text into MIDlet's text input fields (but not vice-versa; useful if need to input case sensitive text string or special characters in MIDlet)
* Supports control MIDlet via on-screen (virtual) or real keyboard keys, touch screen and mouse gestures, mouse scroll wheel and keys (also allows remap keys' scancodes, see "Skin, screen and window size configuration" section below)
* Screencast recording as GIF animation
* Record Store Manager (logs MIDlet's internal system calls to RMS API)
* Log console (logs for debugging MicroEmulator and MIDlet)
* Show mouse cursor position in MIDlet screen coordinate system
* Allows control network access and setup proxy for network connections
* Runs in headless mode
* Many CLI options

### JSR lib loading

By default MicroEmulator does not loads all distributed JSRs; user should load it per launch via custom commands instead.

#### File system access

By default, MicroEmulator does not loads JSR 75 lib, required to grant MIDlets an access to file system.
To grant file system access, config2.xml file (on Linux, in ~/.microemulator/ folder) should include the next code <extensions> block after </windows> tag:
MicroEmulator should run with loading JSR 75 lib. On Linux, launch command to add into microemulator.desktop file is:
On Windows, ; (semicolon) in command should be replaced with : (colon).
To load more libs, path to additional libs should be added each after each in a row into launch command.

### Java applet for Web

MicroEmulator allows conversion of any J2ME app into a Java applet, that could be placed on a web page. This feature is used for demonstrating apps and games demos on vendors sites, but it requires JVM and Java Web Start plugin to be installed on the user's PC or device.

### Skin, screen and window size configuration

MicroEmulator allows interface customization with skins called "devices" (see "Options > Select device..." menu) and distributed with few "devices":
* Default device — phone with 176x220 color display and antialiased font
* Minimum device color — small phone with 128x128 color display and non-antialiased font
* Minimum device — small phone with 128x128 monochrome display and non-antialiased font
* Large device — large phone with 240x320 color display and antialiazed font
* Resizable device — full window resizible color display with antialiased font (could be forced to full screen kiosk mode)
Each "device" skin consist of XML-files, that stores definitions of window size, keys layout and assignations (according scancodes), text rendering options, etc. Optionally, skin could include image textures for "device" background and keys animation on key click and key relax. All files of "device" skin should be packed into ZIP or JAR, and its possible to include few "devices" into single package.
Screen could be switched between portrait and landscape (rotated) orientation. Additionally its possible to show current MIDlet screen scaled (x2, x3 or x4) in a separate floating window.

## Limitations

* MicroEmulator lacks support for few Java APIs and JSRs often used in j2ME games (and implemented in other emulators and MicroEmulator forks):
** Mobile 3D Graphics API (M3G 1.0/1.1, JSR 184)
** Scalable 2D Vector Graphics API (SVG, JSR 226)
** Java bindings for OpenGL ES (JSR 239)
** Mobile 3D Graphics API 2.0 (M3G 2.0, JSR 297)
** Mascot Capsule 3D API
* Some MIDlets may require other JSRs, that are not availabale for MicroEmulator yet.
* For input Cyrillic characters it might require to use special "device" skin.

## Ports and forks
### Android

MicroEmulator has official support for the Android platform. It is also possible to convert J2ME MIDlet JAR-packages into standalone APK files.
J2ME Loader — is an enhanced fork of MicroEmulator for Android.
JL-Mod — is an enhaced fork of J2ME Loader with the Mascot Capsule 3D API support.

### iOS

MicroEmulator has been ported to iOS, but it requires to use iOS jailbreaking technique to install it on iPhone or other iOS device.

### Mac OS

MicroEmulator officially supports Mac OS, but there is also package in MacPorts repository.

### Maemo

MicroEmulator has an official support for Maemo platform, and there is custom MicroEmulator devices skins (themed to Nokia S60 smartphones with 240x320 and 640x360 displays) made for Nokia N900.
Here is a command to launch MicroEmulator on Maemo with JSR 75 lib loaded, to grant MIDlets file system access:

### MeeGo/Harmattan

KarinME — is a MicroEmulator front-end launcher for MeeGo/Harmattan platform, with a GUI written in QML.

### mpowerplayer SDK

mpowerplayer SDK — is a freeware enhanced fork of MicroEmulator, initially created for MacOS as J2ME MIDP 1.0 emulator, later become a platform independed J2ME MIDP 2.0 emulator with own implementation of M3G (JSR 184) and SVG (JSR 226).
WMA (JSR 120) has been implemented for mpowerplayer SDK as an open-source library.
Development stalled after mpowerplayer SDK version 2.0.1185 release in 2007. ZIP of latest distribution package available for download from archived official website on Wayback Machine.

## Usage
### MicroEmulator as Opera Mini sandbox

* Web applet with Opera Mini MIDlet running inside MicroEmulator has been placed on Opera official website.
* MicroEmulator used together with Opera Mini MIDlet to browse Internet via metered networks and slow mobile GPRS connection on netbooks (such as Asus Eee PC), low-end PCs and other mobile devices.
* In some countries mobile network operators provided free traffic or very lowcost plan with unlimited traffic for Opera Mini and some social networks and services via its J2ME clients (like Facebook, Yandex Maps, etc.). Use of MicroEmulator together with Opera Mini or other app with free traffic plan allowed to browse Internet fully free on PC (with USB modem attached) at home or on netbook on the go.

### MicroEmulator as J2ME SDK

* MicroEmulator, together with few MIDlets for programming directly on phone (J2ME SDK Mobile, Mobile BASIC, MIDletPascal [pl], etc.), could be used as a fully complete J2ME SDK: it is possible to write MIDlet source code, compile and preverify Java class files, package all files and resources of MIDlet project into JAR with JAD, and then run built MIDlet for test and debug without even leaving MicroEmulator window. The only external dependency is a JVM installed on PC or device to run Microemulator itself.
* MicroEmulator could be used as alternative to Sun's and Oracle's JavaME emulators for various desktop Java IDE's. For Eclipse, there was initially an open source bridge plugin known as EclipseME, but Eclipse 1.7 and onward got its own bridge plugin.
* MicroEmulator available as org.microemu plugin for Apache Maven build automation tool.

## Publications

* J2ME Building Blocks for Mobile Devices: White Paper on KVM and the Connected, Limited Device Configuration (CLDC) (PDF), Palo Alto, CA: Sun Microsystems, Inc., 19 May 2000
* Stefan, Haustein (14 July 2004), "ME4SE: A Pure Java Emulation of the Mobile Information Device Profile (MIDP)" (PDF), Siemens JavaTalks 2004 (Slides)
* Kroll, Michael (31 May 2007), J2ME Software Entwicklung und Fehlersuche (PDF) (Dipl.-Inf.(FH)) (in Swiss German), Michael Kroll Consulting & Solutions
* Smith, Micahel(tm) (2008), Browsers on the move: 2007-05 to 2008-06 (PDF) (Slides), W3C
* Tavares, Andre Luiz Camargos; Valente, Marco Tulio (2008-03-16). "A remote display system for Java-based mobile applications". Proceedings of the 2008 ACM symposium on Applied computing. ACM. pp. 1918–1922. doi:10.1145/1363686.1364150. ISBN 978-1-59593-753-7.
* Delwadia, Vipul (2009). RemoteME: Experiments in Thin-Client Mobile Computing (Thesis thesis). Victoria University (New Zealand).
* Virkus, Robert (18 September 2009). "Programming J2ME / Java ME Apps". Mobile Developer's Guide To The Galaxy (PDF). Bremen: Enough Software GmbH + Co. KG. pp. 14–22. Archived from the original (PDF) on 2 October 2009.
* Virkus, Robert (15 October 2009). "Programming J2ME / Java ME Apps". Mobile Developer's Guide To The Galaxy (PDF) (2nd Extended ed.). Bremen: Enough Software GmbH + Co. KG. pp. 21–29.
* Vávra, David (10 June 2009). GPS game for mobile framework Locify (PDF) (BA Thesis thesis). Czech Technical University in Prague.
* Fotouhi-Ghazvini, Faranak (20 March 2012), "Mobile Learning using Mixed Reality Games and a Conversational, Instructional and Motivational Paradigm", . (PhD Thesis), University of Bradford
* Padmanaban, Yogesh (2013). Learning API mappings for programming platforms (Thesis). New Brunswick: Rutgers University - Graduate School.
* Gokhale, Amruta; Ganapathy, Vinod; Padmanaban, Yogesh (May 2013). "Inferring likely mappings between APIs". 2013 35th International Conference on Software Engineering (ICSE). pp. 82–91. doi:10.1109/ICSE.2013.6606554. ISBN 978-1-4673-3076-3.
* Virkus, Robert (February 2015). "Java ME (J2ME)". Mobile Developer's Guide To The Galaxy (15th ed.). Bremen: Enough Software GmbH + Co. KG. pp. 82–90. ASIN B00BS6RIKU. Archived from the original (PDF) on 29 September 2015.
* Phong, Cao, Porting J2ME Apps to Nokia X Using J2ME Android Bridge

## Video

* MicroEmu (J2ME emulation) on Linux on YouTube
* Alan Bazan. J2ME Emulator playlist on YouTube (in Spanish)