×

Discussion Board

Results 1 to 15 of 16

Hybrid View

  1. #1
    Registered User
    Join Date
    Nov 2012
    Location
    Lahore, Pakista
    Posts
    58

    Pausing and Resuming j2me application and it's working

    Through posts I came to know that in pauseApp() method of j2me should be the code for releasing resources so that it may no affect the phone battery, etc. What I want to know is that how can I make my application to start working from the same point from where it was paused?
    I have a j2me application which receives chunks of Messages from server and then operates (decodes into proper formate) and writes that data as contacts into the device memory. Everything works fine if there is no interruption, but as I receive a call and application is processing (writing contacts) it stops there, no matter if I reject the call or so, it doesn't move further from there. What I want to do is to make it work the same way as it was before call. How can I do so? I need logic to perform it, what sources do I need to release in pauseApp() and how to reset them back when call is ended? Need that idea, thanks

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Pausing and Resuming j2me application and it's working

    OK... you do not need to do anything.

    There is no point in adding code to pauseApp(), as no Nokia device ever calls pauseApp().

    If you are having a problem after a call, I would imagine that your network code is throwing an exception (which you are swallowing) because it can't open a connection during a call (or because its connection is forcibly closed), and leaving the code in a state where it cannot continue.

    Make sure you catch IOExceptions in your netwok code and handle them usefully.

    Graham.

  3. #3
    Registered User
    Join Date
    Nov 2012
    Location
    Lahore, Pakista
    Posts
    58

    Re: Pausing and Resuming j2me application and it's working

    Quote Originally Posted by grahamhughes View Post
    OK... you do not need to do anything.

    There is no point in adding code to pauseApp(), as no Nokia device ever calls pauseApp().

    If you are having a problem after a call, I would imagine that your network code is throwing an exception (which you are swallowing) because it can't open a connection during a call (or because its connection is forcibly closed), and leaving the code in a state where it cannot continue.

    Make sure you catch IOExceptions in your netwok code and handle them usefully.

    Graham.
    You mean to say all I can do is to show caught exception and terminate process there (which is actually already terminated by the OS) and ask user to restart the process and I have nothing to do? In short no way to process how I want it?

    But if I remember I use to receive SMS during my normal call procedure, that means phone does that in normal behaviour, then why not in application? Any particular reason?

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Pausing and Resuming j2me application and it's working

    Quote Originally Posted by saqibatiq View Post
    You mean to say all I can do is to show caught exception and terminate process there
    No... I mean you need to catch the exception so that the process does not terminate.

    Do you know what exception is being thrown and from where?

    Quote Originally Posted by saqibatiq View Post
    But if I remember I use to receive SMS during my normal call procedure, that means phone does that in normal behaviour, then why not in application?
    Is your application receiving SMS?

    Graham.

  5. #5
    Registered User
    Join Date
    Nov 2012
    Location
    Lahore, Pakista
    Posts
    58

    Re: Pausing and Resuming j2me application and it's working

    Quote Originally Posted by grahamhughes View Post
    No... I mean you need to catch the exception so that the process does not terminate.

    Do you know what exception is being thrown and from where?
    Well I guess below info may give answer of your question!!!

    Quote Originally Posted by grahamhughes View Post
    Is your application receiving SMS?

    Graham.
    Yes my application receives SMS what I mentioned as [MESSAGES FROM SERVER] in my post. So it may clear now that how can I keep my process continue after resume. And it doesn't throw any exception because process doesn't terminates but it just stands over there and waits for time out (which I actually handled)

  6. #6
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Pausing and Resuming j2me application and it's working

    How are you waiting for a message? By using MessageConnector.receive(), or a MessageListener? Perhaps the specific fragment of code would help...

    I'm guessing you are using receive(), in which case either it returns a Message object, or it throws an Exception...

    I need to know more about what is happening in your code.

    Oh, would also be useful to know what device you are running this on.
    Last edited by grahamhughes; 2013-04-09 at 20:49.

Similar Threads

  1. Please help: Resuming application in the background
    By B.Adams in forum [Archived] Flash Lite on Nokia Devices
    Replies: 1
    Last Post: 2011-05-21, 05:06
  2. pausing j2me app when using platformrequest
    By vempatisurya in forum Mobile Java General
    Replies: 4
    Last Post: 2010-09-28, 14:21
  3. Resuming a background midlet application
    By yuenfatt in forum Symbian C++
    Replies: 0
    Last Post: 2009-02-23, 04:08
  4. pausing and resuming games
    By ayushv2005 in forum Mobile Java Games
    Replies: 5
    Last Post: 2008-06-15, 19:53
  5. Pausing/resuming full screen midlet
    By dubick in forum Mobile Java General
    Replies: 0
    Last Post: 2002-11-15, 11:03

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •