Securing J2ME Application

Leave a comment


Most of the mobile devices available in the market has Java support. The most important thing about Java mobiles or J2ME is that the applications created using J2ME has to be more secured and compact to install it in devices.

Following are the important point to check before testing the applications in any Java mobiles.

1. Application Signing

  • If our application needs any file to be read or write from device it has to be signed to avoid, that device keep on asks for the permission.
  • Some devices does not allow the unsigned application to install.
  • Once the application is signed and before installing it in a device we have to make sure that particular root certificate is there in the device.
  • Thawte and Verisign are the popular certificates available in maximum devices.

2. Obfuscation

  • Obfuscating the code not only gives security to the code but also reduces the size of the final jar file.
  • Obfuscating level may be from 1 to 9. Most of the devices accept level 8 obfuscation but it’s mandatory for Nokia high end devices to be obfuscated using level 9. If the obfuscation level is lesser than 9 Nokia high end devices throws “Authorization Failed” error while trying to install.
Advertisements

J2ME Basics

Leave a comment


J2ME is widely used platform for all java phones.Even though J2ME market has gone down most of the device manufacturers are targeting low-cost devices with Java platform.  Below are the steps to start J2ME development.

1. Download the Java ME platform SDK3.0 from the below link and install it(for windows).
http://www.oracle.com/technetwork/java/javame/downloads/sdk30-jsp-139759.html
2. Once the installation is done once can do J2ME project both in Java ME SDK ide or through Eclipse pulsar.
3. Eclipse pulsar is the best IDE for midlet development. In J2ME the projects are widely called as midlets. In eclipse import the J2ME by Windows -> Preferences -> Java ME -> Device Management and import it by selecting the J2ME SDK install location.
4. Once it is imported select the suitable phone model and configuration from the displayed list.


5. Now the set up is ready to do a J2ME project.
Now one can start the project by creating a new midlet project and can execute it as ‘Run as – > Emulated Java ME JAD’. Before executing the midlet the respective midlet should get added in to the JAD file of project Application Descriptor.

J2ME – Nokia S60 – Connect to agent problem

3 Comments


Recently I installed Nokia s60 3rd edition in my system.Created a sample Hello Midlet project from eclipse pulsar and tried to execute this midlet in Nokia s60 emulator.But it keep on throwing the following error

“Failed to initiate session
Caught exception
java.lang.NullPointerException
at com.symbian.tools.j2me.sei.emulator.session.RemoteSession$SocketTransport
.getInputStream(RemoteSession.java 50)
at com.symbian.tools.j2me.sei.emulator.session.RemoteSession.”

Atlast the connect to agent fails. I tried to solve this through the following solutions from Nokia forum but no success.

1. Preferences->Java->Debug->Debugger timeout to 120000
Preferences->Java->Debug->Launch timeout to 120000

2.Change the port where IDE and emulator communicates from 110011 to another port 110012 in the   “MIDP Debugging” tab accessing the “Tools->Preferences” menu bar of the emulator.

If any one had faced the same issues and got succeed Please post us the solution.

LWUIT – The Light Weight User Interface Toolkit for J2ME

1 Comment


The Light Weight User Interface Toolkit (LWUIT) for J2ME is developed by Sun and provides a wrapper around the default J2ME LCD UI which does lot of things in the background so that application will get consistent and rich  look and feel across all J2ME platforms.

About license

LWUIT library as such can be freely used in any commercial applications. When the source come out you will be able to change it but you will need to publish the LWUIT sources which you changed (not your application!) based on the GPL+CPE license terms.

You can download it here

http://java.sun.com/javame/technology/lwuit/

Using Perst Library in BlackBerry(J2ME based) devices

Leave a comment


In order to use Perst library in blackberry application (CLDC MIDP platform), perst-rms.jar library has to be referenced and not perst.jar.

Before referring an external jar file to a blackberry application, a procedure called “preverify” needs to be performed, which will be produce a .jar file by the same name on which you perform the “preverify” procedure. This is explained in the following link

http://getablogger.blogspot.com/2009/09/how-to-include-external-jar-file-in.html

Setting up J2ME development environment

Leave a comment


Setting up J2ME environment

1) Install Eclipse Pulsar for Mobile Java Developers from

http://www.eclipse.org/downloads/

2) After installation, please use help section of the eclipse to find out how to create MIDlet suite because the information given there is well structured and easy to follow.

Happy J2ME coding !!!