The Source for Java Technology Collaboration

Home » java.net Forums » Mobile & Embedded » ME General Help

Thread: JME support for touch screen and vibration

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 3 - Last Post: Nov 19, 2007 8:48 AM by: terrencebarr Threads: [ Previous | Next ]
rogersilva

Posts: 7
JME support for touch screen and vibration
Posted: Nov 5, 2007 8:10 AM
  Click to reply to this thread Reply

Hi all, How are you?
I need to develop a application for mobile phone, and it is going to use the mobile touch screen and vibration features.
Does somebody know if there is an JME API, or JSR that provides access/control to Mobile's touch screen and vibration features?
Does somebody know if it is feasible to do it using JME?

I appreciate any help you can give,
thanks in advance,
Roger

terrencebarr

Posts: 544
Re: JME support for touch screen and vibration
Posted: Nov 6, 2007 3:51 AM   in response to: rogersilva
  Click to reply to this thread Reply

Hi,

For touchscreen support check the MIDP Canvas class methods pointerpressed(), etc.

For vibration support see the MIDP Displayable class (example: http://wiki.forum.nokia.com/index.php/How_to_vibrate_phones_from_Java_ME)

Hope this helps,

-- Terrence

rogersilva

Posts: 7
Re: JME support for touch screen and vibration
Posted: Nov 13, 2007 11:43 AM   in response to: terrencebarr
  Click to reply to this thread Reply

Hi,
thanks a lot for helping.
I need to include the behavior described bellow to all Item subclasses:
pointerPressed(int x, int y)
pointerReleased(int x, int y)
pointerDragged(int x, int y)

I've tried to create a CustomItem for each Item subclass with an attribute that It represents, for instance:
class Test extends CustomItem{
Item obj;

protected void paint(Graphics arg0, int arg1, int arg2) {
obj.paint() // ?
}

}

However, I don't know which Item's class method to call in order to paint it.
Please, Do you have any idea on how I can do that??

thanks in advance,
Roger

terrencebarr

Posts: 544
Re: JME support for touch screen and vibration
Posted: Nov 19, 2007 8:48 AM   in response to: rogersilva
  Click to reply to this thread Reply

Sorry for the slow reply. I was hoping someone else could answer this.

The paint method in Item is package protected so you cannot call it directly. It is called from the MIDP subsystem on the paint thread as needed. This means that you can't use an Item as part of a CustomItem. A CustomItem contains elements that you implement yourself and you can paint yourself.

-- Terrence




 XML java.net RSS