Friday, April 28, 2006

emulator issues

has anyone had this error before when trying to run the emulator: (the emulator had worked at the beginning of the session)

java.lang.NoClassDefFoundError: TestMIDlet
at com.sun.midp.midlet.MIDletState.createMIDlet(+14)
at com.sun.midp.midlet.Scheduler.schedule(+52)
at com.sun.midp.main.Main.runLocalClass(+29)
at com.sun.midp.main.Main.main(+88)

Anyone know what going on here?

Thursday, April 20, 2006

MoSoSo resources...

I just wanted to forward on to you a list of "useful resources" compiled by the participants of the Mobile Social Software workshop at CHI this year. As you guys start to think about your final reports, you might find some of these helpful. A lot are overlap from the list I put together on the course home page, but many are new.

Monday, April 17, 2006

Stylus Event and Key Events

This is how you can read stylus events, i.e. get the x,y coordinates of where the pointer is pressed and how to create a key event, i.e. read what button the user has pressed:

In order to draw stuff on screen you'll either use Canvas, LWT or GameCanvas. As LWT and GameCanvas both extend Canvas, you can just implement a key and stylus listener.

Just implement the following methods in your class that draws stuff on screen, i.e. extends an interface mentioned above: (this is an extract from our code, you can implement your own handling)

//this method will be called if the stylus touches the screen at x,y:
protected void pointerPressed(int x, int y) {
//do something with the received x,y coordinates
current.actionPerformed(new Message(Message.STYLUS, x,y));
}

//this method will be called if the user presses a key
protected void keyPressed(int keyState){

//determine whether the input is something we can use or not.
boolean flag = true;

switch(keyState){
case -3:
keyState = LEFT_PRESSED;
break;
case -4:
keyState = RIGHT_PRESSED;
break;
case -1:
keyState = UP_PRESSED;
break;
case -2:
keyState = DOWN_PRESSED;
break;
case -5:
keyState = FIRE_PRESSED;
break;
default:
flag = false;
}
//if the data is good, perform the according action
if(flag){
current.actionPerformed(new Message(Message.JOYSTICK, keyState));
}
}

Thursday, April 13, 2006

Google Calendar

For those looking for a calendar with a nice open API, google just launched Google Calendar today. It provides iCal and XML feeds for your calendar and lets you subscribe to other people's calendars as well.

Wednesday, April 12, 2006

EclipseME setup and other common problems

Hey everyone, since so many people had problems getting EclipseME to work I'm posting a troubleshooter here.

Tuesday, April 11, 2006

Fullscreen Application

Is there any way to make a Java application full screen? I.e. hide the standard phone icons on top and the grey bar on the bottom?

Monday, April 10, 2006

calendar on A780?

does anyone know how to access calendar on A780? I know that there is a program called calendar on it, but I was wondering if there is any JAVA API that allows developers to access calendar functions on the phone.

Wednesday, April 05, 2006

Detecting Stylus Event?

Does anyone have some sample code of how to get the stylus position on the touch screen if the user taps on the screen? I only found out how to use the joystick and other buttons so far.