Skip to main content

Custom App for T-Mobile Wing?

3 replies [Last post]
brent_allsop
Offline
Joined: 2007-09-06
Points: 0

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
terrencebarr
Offline
Joined: 2004-03-04
Points: 0

For running a MIDlet in the background check the MIDP "Push Registry". It allows you to set a timer that periodically wakes up your MIDlet.

As for the emulator question: Not all phone manufacturers provide emulators. Not sure about the situation with the Wing.

-- Terrence
Terrence Barr
Evangelist, Java Mobile & Embedded Community
Sun Microsystems, Germany
www.mobileandembedded.org

brent_allsop
Offline
Joined: 2007-09-06
Points: 0

Well, I finally got some midlets to build and run on my wing using sun’s netbeans system.
Fun!!

I never did find an emulator for the wing. That would sure make things easier.
But I’m just developing basic stuff on the high level interface, and that seems to be working.

The question I have now is, I’m trying to develop a background process that will always run on my wing, that will check a web site status every 5 minutes or so.

The current MIDlet I’ve developed works great until you try to switch out of java and go back to normal phone mode. All the java MIDlet stuff suspends and doesn’t run till you reactivate it.
I hope I can find a way to get a java MIDlet to run in the background!?
Maybe I can somehow escape the MIDlet environment and run raw java?
Any other posobilities?

Any pointers?

Thanks

Brent Allsop

karlward
Offline
Joined: 2007-09-11
Points: 0

According to the MIDP2 specification, there may be another way to put a MIDlet into the "background". You may pass null to Display.setCurrent(). According to the spec;

"The application may pass null as the argument to setCurrent(). This does not have the effect of setting the current Displayable to null; instead, the current Displayable remains unchanged. However, the application management software may interpret this call as a request from the application that it is requesting to be placed into the background."

So, depending on the device, this may or may not work. I am assuming that when the spec talks about placing a MIDlet in the background, it means to say that no displayable is set - in affect the MIDlet has no ownership of the device's screen.

You could use this along with a thread in a waiting state, perhaps waiting for 5 minutes or so at a time, and on each run polling your server. Under certian conditions the thread could use Display.setCurrent() to once again display a Displayable.