Developing Nokia Asha apps on Linux
This article explains how to use the Nokia Asha SDK 1.0 under Linux with WINE.
It is fully possible to develop Java ME and Nokia Asha Web Apps on Linux.
The Web Apps development environment is available as a native application for Linux (.deb package for Ubuntu/Debian) and does not require anything extra.
While the Nokia Asha SDK is not available in a native Linux form, we can use the toolchain and emulator via Wine from native IDEs like Netbeans or Eclipse on Linux (thus there is no speed overhead in the IDE itself). This is only possible on 32-bit i386 Linux environments.
The method used here is also applicable to previous versions of the Series 40 SDKs on Linux, but the integration scripts will need to be adapted for the different paths.
To start with you need to install some software on your Linux system.
Install, in order:
First you need to have Wine installed on your Linux system. How that is done depends on your distribution, under Ubuntu you can do it via the Ubuntu Software Center.
If you prefer the console, on deb-based systems just enter from the command line:
sudo apt-get install wine
Check the Wine download page for instructions and packages for other distributions or newer version of Wine. The approach has been verified on Wine 1.4 and Wine 1.6
The new Asha SDK needs a JRE. Remember to install the (32bit) Windows version of the JRE from here. If you're running Ubuntu and have installed Wine, just double-click the JRE exe file.
The terminal equivalent is
Now you can install the Nokia Java SDKs, available from here. Always use the offline installers.
Under Ubuntu, you can double-click the Nokia Asha SDK installer just as you did the JRE. On the final page, uncheck launch Nokia IDE for Java (at this stage it will not function). Depending on your Linux environment, you should have the emulator icons set up on your desktop. Now you should be able to start the emulator as any other program.
Running Java ME apps in the emulator/SDK
To run a .JAR of a Java ME application, you can use the Open menu option (your native Linux filesystem is under the Z: drive). Note that the emulator automatically uses the .JAD file present in the same directory as the .JAR file.
Enabling the SDK for IDE usage
Java defines the mechanism for how SDKs and emulators are identified and invoked by SDKs. In order for this to work with the Linux IDEs, these two scripts need to be added to the SDK install. Extract and copy them to the bin directory of the SDK. If you already have the Full Touch (Developer Platform 2.0) SDK, you can enable it the exact same way, just use these two scripts.
Plaintext clipboard-friendly version:
cd ~/.wine/drive_c/Nokia/Devices/Nokia_Asha_SDK_1_0/bin cp ~/Downloads/emulator . cp ~/Downloads/preverify . chmod +x emulator preverify
This should be enough to make our SDK install fully functional. By invoking the emulator script, we can verify if everything is installed correctly.
Plaintext clipboard-friendly version:
~/.wine/drive_c/Nokia/Devices/Nokia_Asha_SDK_1_0/bin/emulator -version 2> /dev/null ~/.wine/drive_c/Nokia/Devices/Nokia_Asha_SDK_1_0/bin/emulator -Xquery 2> /dev/null
This setup can be used for development from a native Netbeans install, for instructions see this article.
Series 40 Web apps
The Web Apps development environment is available as a set of native Linux applications. Everything should work fine under Linux "out of the box" - you can follow the instructions in the documentation for installation and configuration.
Testing your web apps can be done directly in the IDE, using local or cloud based preview. These are not perfect emulations of the Nokia Browser on the real devices.
Alternatively, the device emulators that come with the Java ME SDKs have the real native browsers installed. To test the Web Apps under the device emulators, copy & paste the URL given by the Web Tools when deploying and use the Open url... option in the emulators.
Now you should be able to develop and test Java ME apps under Linux with the Nokia Asha (and Series 40) device emulators! Enjoy.