Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in MIDLET basics

 
Rishi Tyagi
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic