J2ME, How to minimize a program ?

B

Boki

Hi All,

How to minimize a program ? ( not End a program )

When a J2ME program is running, I hope my user can exit the program for a
while to do other funtions of phone and back to my program when she/he want.

Do we have this command support?

Thank you very much!

Best regards,
Boki.
 
A

Anton Spaans

Boki said:
Hi All,

How to minimize a program ? ( not End a program )

When a J2ME program is running, I hope my user can exit the program for a
while to do other funtions of phone and back to my program when she/he want.

Do we have this command support?

Thank you very much!

Best regards,
Boki.
Hi Boki,

It is not possible to specifically allow for that.
It depends on your phone and the resources available to your phone and your
phone will decide what to do.

E.g. Suppose your J2ME program is running. A phone-call comes in. Based upon
the amount of resources available (e.g. how much memory left, etc) your
phone may decide to close your J2ME program all-together or it may decide to
put your J2ME program into the background.

For example, Series 60 phones have the ability to switch between tasks
(holding down the menu-button for more than 1 sec). Using this button, the
user can switch between (J2ME) processes.

-- Anton.
 
F

Frank

Anton said:
Hi Boki,

It is not possible to specifically allow for that.
It depends on your phone and the resources available to your phone and your
phone will decide what to do.

E.g. Suppose your J2ME program is running. A phone-call comes in. Based upon
the amount of resources available (e.g. how much memory left, etc) your
phone may decide to close your J2ME program all-together or it may decide to
put your J2ME program into the background.

I'd think MIDlet.notifyPaused() was ment for exactly this kind of
situation? Granted, it may not be implemented and working as intended on
all systems, but it's certainly in the API.
There's also the pauseApp() callback, which lets you know when your app
is suspended from external events.
 
B

Boki

Hi
Thank you so much for the information I didn't know.


But, for Sony Ericsson cells, we can press back button ( like the
symbol of inverse Enter ) to exit ( not destroy ) program.

For SmartPhone - P910i, we can run other funtion very easily ( we don't
have to implement it )

I found a cheat method that could do this.

public Form f;
.....
.....
// Do not new a Form for f

display.setCurrent(f); // minimum program :p


// I don't know why, the compiler pass it, and we can find it is work on
cells.Best regards,Boki."Anton Spaans" <aspaans at(noSPAM) smarttime
dot(noSPAM) com> ¼¶¼g©ó¶l¥ó·s»D:[email protected]...
 
B

bokiteam

Thank you so much for the information I didn't know.


But, for Sony Ericsson cells, we can press back button ( like the
symbol of inverse Enter ) to exit ( not destroy ) program.

For SmartPhone - P910i, we can run other funtion very easily ( we don't
have to implement it )

I found a cheat method that could do this.

public Form f;
.....
.....
// Do not new a Form for f

display.setCurrent(f); // minimum program :p


// I don't know why, the compiler pass it, and we can find it is work
on cell.
 
D

Darryl Pierce

Anton said:
It is not possible to specifically allow for that.

Of course it is! It's in the specification: MIDlet.notifyPaused() does
exactly what he's asking.
 
A

Anton Spaans

Darryl Pierce said:
Of course it is! It's in the specification: MIDlet.notifyPaused() does
exactly what he's asking.

But what if your phone does not call this 'notifyPaused()' callback method?
Instead, your phone may be very low on resources and decides to close your
J2ME program all together (e.g. when an incoming call must be handled)

I agree; *if* your midlet's notifyPaused() is called, then you can handle
some code to clean up some resources to go into 'minimized' state.
 
D

Darryl Pierce

Anton said:
But what if your phone does not call this 'notifyPaused()' callback method?

Then the handset's not up to the specification, since it's supposed to
do just that.
Instead, your phone may be very low on resources and decides to close your
J2ME program all together (e.g. when an incoming call must be handled)

Then in that case the phone must call MIDlet.destroyApp(boolean).
I agree; *if* your midlet's notifyPaused() is called,

It's MIDlet.pauseApp(). MIDlet.notifyPaused() is how the application
tells the handset that it wants to be paused.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top