Writing J2ME Application in Linux

April 30, 2008 at 2:23 am (Mobile, Programming, Uncategorized)

If you’re going to create a mobile game application better use j2me.. But if you’re mobile application runs in a background better used symbian c++.
Quick Start for setting up your workspace..
1. Install eclipse in synaptic manager for your IDE. Why choose eclipse? Simple and easy to use.
2. You need to have the Java Development Kit (JDK) and the Sun Java Wireless Toolkit (WTK) installed on your system. Click here for installation tutorial
3. Install JDK Sun Java Standard Edition (SE) Downloads .
4. After setting up all the installers, you can now create a simple Hello World.

Creating a project:
1 Choose File – > New -> Project
2. New Poject window will appear. Select J2ME Midlet suite then click Next. Type the name of your project. Example HelloWorld Select which Device your going to use. Then click Finish.
3. On the project explorer pane, right click the name of your project.Select New – > Package. Type the name of your package.
4. After creating a package, right click it, select New -> File . Type your filename for example “HelloWorld.java”

Type this source code.
Create the file src/HelloWorld.java with the following code:

// Sample adapted from http://developers.sun.com/mobility/midp/articles/wtoolkit/
package com.hello
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class HelloWorld
extends MIDlet
implements CommandListener
{
private Form mMainForm;
public HelloWorld()
{
mMainForm = new Form(“HelloWorld”);
mMainForm.append(new StringItem(null, “Hello, World!”));
mMainForm.addCommand(new Command(“Exit”, Command.EXIT, 0));
mMainForm.setCommandListener(this);
}
public void startApp()
{ Display.getDisplay(this).setCurrent(mMainForm); }
public void pauseApp() {}
public void destroyApp(boolean unconditional) {}
public void commandAction(Command c, Displayable s)
{ notifyDestroyed(); }
}

5. You can now run your HelloWorld midlet.
6. Creating the jar file. Right click the name of your project . Select J2ME then Create Package..

Permalink 3 Comments

Keep Moving Forward

April 30, 2008 at 12:42 am (Uncategorized)

The first lesson in my work.. Keep Moving Forward..
The incident happened when I checked- in the svn ( svn commit -m”checkin tester program”). By the way, what is svn/ subversion? “Subversion is used for version control when developing a program or system. It helps to keep track of your versions”. I used the copy for different program. When I checked-in my project, I forgot that there is hidden folder .svn. The backup copy is also updated and the tags are broken.. What a big mistake I have done. I’mm afraid that it can damage the working copy in our trunk.. My boss told me that it’s ok to make a mistake, at least you learned. He also told me about the movie “Meet the Robinsons” and lesson on this movie is “Keep Moving Forward”.. Thanks to svn.. It can revert the working copy..

Permalink 2 Comments

My First Post on My Own Blog

April 29, 2008 at 9:02 am (Uncategorized) ()

Hi! This is my first time to post a comment.. Going straight if you have some questions related to computer programming, Im willing to help. Just post your question here or email me at carmelita_mendoza2006@yahoo.com. Basically I can help you in some language like PHP, Python, C++, Java, J2ME, Visual Basic. I can also help in linux operating system. So what can I say.. Feel free to post your question..

Permalink Leave a Comment