File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java Micro Edition and the fly likes Event Generation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Event Generation" Watch "Event Generation" New topic

Event Generation

Nidheesh Puthalath
Ranch Hand

Joined: Sep 08, 2004
Posts: 30
Is it possible to generate custom events in J2ME.
I need to generate some events based upon some n/w activity(eg. a byte arrives in serial port).

thanks in advance


-------------------------<br />Thanks & Regards<br />Nidheesh.P(SCJP)
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

Um, I don't think you need to make custom events for Network activity. There are Timers, Registering Sockets to the phone to activate a Servlet when a "message" comes in. And having Connections be open listening for incoming traffic.

So what would you specifically want to have a custom event for?


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
Nidheesh Puthalath
Ranch Hand

Joined: Sep 08, 2004
Posts: 30
Thanx for the reply
I do not think timers can help me
considering the fact that my network activity is asynchronous.

Let me state the problem clearly.

I am connected to a microcontroller device throungh serial port. Depending upon some control bytes
coming in the serial port sent by tha MC, I need to initiate certain activities( this may include further network reading, server communicatin etc). I want to implement this in a callback fashion. So i thought of making some custom events specific to contorl bytes in the serial port and triggering them as they arrives. Apparently i will have listners for each of this events, that will initiate the actual work. But i do not know how this model can be implemented.

Appreciate if you could help. Any alternative model is also apreciated

thanks in advance

I agree. Here's the link:
subject: Event Generation
It's not a secret anymore!