Friday, May 7, 2010

Add External JAR in j2me-polish Project


To use any external jar in a j2me-polish project following steps need to be taken:

  • Copy jar file in j2me-polish/import/ folder
  • Add jar file in project libraries
  • Update build.xml file by adding attribute 'binarylibraries="jarname1.jar;jarname2.jar"' inside < build > tag. (Multiple jars can be defined by placing semi-colon between jars)

rizzz86


Tuesday, May 4, 2010

Class.forName("classname").newInstance()

Don't do this foolish mistake again :|

I was trying to get the class instance using Class.forname(...) but continuosly getting IllegalAccessException.

At the end I found that the class I am trying to call has a private constructor in it. So it cannot be possible to create an instance of class with private constructor.


rizzz86

Thursday, April 22, 2010

Maven j2me-Archetype

I am using Netbeans6.7 for mobile project development and want to make that project a 'maven project'. I have maven configured on my machine.

To make maven based j2me project I have created a new project from File > New Project > Maven > Maven Project > j2me Archetype (2.0.4). The project created successfully and showing the properties of maven as well . . .  BUT !!

I cannot able to view the properties of mobile project (i.e. Platform Type, Device Profile and Configuration, Midlet Information etc). To execute that project it requires a class with main() method. So I have posted all that on forum and finally got the following answer:

j2me development is not supported for maven projects in netbeans :(

rizzz86

Thursday, April 15, 2010

JSON source for J2ME (mobile applications)


Javascript Object Notation (JSON) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. I am trying to use it in for mobile application development.

Today I was looking for a JSON source code for Java Micro Edition (J2ME). After lots of googling I have found it from the following link:


https://meapplicationdevelopers.dev.java.net/source/browse/meapplicationdevelopers/demobox/mobileajax/lib/json/src/org/json/me/



rizzz86