aspose file tools*
The moose likes Java Micro Edition and the fly likes Problem in MIDLET basics Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Problem in MIDLET basics" Watch "Problem in MIDLET basics" New topic
Author

Problem in MIDLET basics

Rishi Tyagi
Ranch Hand

Joined: Feb 14, 2002
Posts: 100
Hi all,
I am just confused about the behaviour and the correct use of the methods
pauseApp()
destroyApp(boolean unConditional)
notifyDestroyed()
notifyPaused()
Is there anybody who can tell me the correct use of these methods and the significance in midlet life cycle and when they invoked.
Waiting for response.......
Regards,
Rishi
Debbie Argulkar
Ranch Hand

Joined: Jul 26, 2002
Posts: 43
Hi Rishi,
I would explain but here is a link that does a better job of explaining the significance of these functions in the MIDlet lifecycle.
http://www.onjava.com/pub/a/onjava/excerpt/j2menut_3/index3.html
Regards,
Debbie
sing
Ranch Hand

Joined: Nov 29, 2001
Posts: 121
I add some,
pauseApp()- Midlet is about to be placed into paused state.
notifyPaused()- Midlet is requesting to be paused.
destroyApp(boolean unConditional)- Midlet is about to be shut down. It will release all resources that are still in use.
notifyDestroyed()- Midlet is requesting to be shut down. It tell application manager that the Midlet is safe to be shut down.
Rishi Tyagi
Ranch Hand

Joined: Feb 14, 2002
Posts: 100
Thanks Debbie Argulkar & Steffy Sing for the help extended.
Here i am discussing the actual problem why i got confused.
Now what i think about these methods is as follows :-
1- when application is about to be started or has been paused by notifyPaused() method then it is in paused state.
2- Now in the starting of the application and whenever it will be resumed after paused state startApp() method will be called.
3- If we want to resume the application then resumeRequest() method should be called.
4- whenever we want to pause the application then we will use notifyPaused() and in this case pauseApp() method should be called to save any data which is to be saved to retain the application state.
5- when we want to exit from the application or in other way we want to destroy the midlet then we should call notifyDestroyed() method and in response to that destroyApp() should be called to release the resourse application is using.
Now I tried with these methods but found that
1-When we call notifyDestroyed() method it destroys the midlet but never calls the destroyApp() method.
2- When we call notifyPaused() method it never calls the pauseApp() method.
3- if we call the notifyPaused() method and after that again want to activate the midlet then it calls the destroyApp() method and automatically destroys the midlet.

May be i am doing something wrong here but this is why i have been confused about the correct use of these methods.
I will be highly obliged if anybody can clear my concepts about the MIDlet basics.
Thanks in advance for the help.
Waiting for the response
Regards,
Rishi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in MIDLET basics