Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / April 2005

Tip: Looking for answers? Try searching our database.

J2ME,  How to minimize a program ?

Thread view: 
Boki - 14 Apr 2005 10:35 GMT
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.
Anton Spaans - 14 Apr 2005 16:09 GMT
> Hi All,
>
[quoted text clipped - 9 lines]
> 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.
Frank - 14 Apr 2005 18:09 GMT
>>Hi All,
>>
[quoted text clipped - 22 lines]
> 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.
Boki - 14 Apr 2005 18:47 GMT
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:C-ydnQbEe4wQGsPfRVn-jw@speakeasy.net...

>> Hi All,
>>
[quoted text clipped - 30 lines]
>
> -- Anton.
bokiteam@ms21.hinet.net - 14 Apr 2005 19:07 GMT
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.
Darryl Pierce - 16 Apr 2005 11:51 GMT
> 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.

Signature

Darryl L. Pierce <mcpierce@gmail.com>
Visit my homepage: http://mcpierce.multiply.com
"By doubting we come to inquiry, through inquiry truth." - Peter Abelard

Anton Spaans - 18 Apr 2005 14:18 GMT
> > 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.

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.

> --
> Darryl L. Pierce <mcpierce@gmail.com>
> Visit my homepage: http://mcpierce.multiply.com
> "By doubting we come to inquiry, through inquiry truth." - Peter Abelard
Darryl Pierce - 22 Apr 2005 22:38 GMT
>>>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.
>
> 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.

Signature

Darryl L. Pierce <mcpierce@gmail.com>
Visit my homepage: http://mcpierce.multiply.com
"By doubting we come to inquiry, through inquiry truth." - Peter Abelard

Darryl Pierce - 16 Apr 2005 11:32 GMT
>      How to minimize a program ? ( not End a program )

MIDlet.notifyPaused().

Signature

Darryl L. Pierce <mcpierce@gmail.com>
Visit my homepage: http://mcpierce.multiply.com
"By doubting we come to inquiry, through inquiry truth." - Peter Abelard



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.