×

Discussion Board

Page 1 of 3 123 LastLast
Results 1 to 15 of 32
  1. #1
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    61

    How to hide J2ME application in background

    Hi

    How to hide application in background

    1. Can we keep the application running in the background?
    2. Can pause app be used for hiding application

    I am using CLDC1.1 and MIDP2.0 and target devices are Nokia and Blackberry


    Regards,
    Geetanjali

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

    Re: How to hide J2ME application in background

    Quote Originally Posted by gittu View Post
    1. Can we keep the application running in the background?
    Maybe. Some devices support background execution. Some do not.

    Quote Originally Posted by gittu View Post
    2. Can pause app be used for hiding application
    There is no specific function for putting your app into the background. The usual technique is:

    Code:
    Display.getDisplay(theMidlet).setCurrent(null);
    You might also want to check out the BlackBerry Developer Zone.

    Graham.

  3. #3
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    61

    Re: How to hide J2ME application in background

    Code:
     if (Command == oCommand) {
                Display display = Display.getDisplay(this);
                display.setCurrent(null);
            }
    Using above code application goes in background on both Nokia and Blackberry
    I read on forums somewhere that its not possible on s40 devices? why is that?

    and how to bring the application in forground?

    Using Push registry, application comes in foreground but this event is very rare.How to achieve this?

    Geetanjali

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

    Re: How to hide J2ME application in background

    A device's ability to run an application in the background depends on its ability to multitask. Therefore, more expensive, PDA-type devices are more likely to support background execution than lower-cost devices.

    You might be able to bring an application to foreground like:

    Code:
    private Display display = Display.getDisplay(this);
    private Displayable previousDisplayable;
    
    public void toBack() {
        previousDisplayable = display.getCurrent();
        display.setCurrent(null);
    }
    
    public void toFront() {
        display.setCurrent(previousDisplayable);
    }
    Note that this will not work on all devices. You will need to test it on your target devices.

    Graham.

  5. #5
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    61

    Re: How to hide J2ME application in background

    Thanks a lot will try it

    Geetanjali

  6. #6
    Registered User
    Join Date
    Mar 2013
    Posts
    14

    Re: How to hide J2ME application in background

    WHERE TO PUT THIS CODE USING EXAMPLE PLEASE HELP!!

  7. #7
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,430

    Re: How to hide J2ME application in background

    Hi swapnilsrk! Welcome to Nokia Developer Discussion Boards!!

    First of all, please dont hijack into someone else's thread. If you you have a question, start a new thread. What is the problem you are trying to solve ?

    Regards
    Gopal
    Twitter : @balagopalks
    Linkedin : @balagopalks

  8. #8
    Registered User
    Join Date
    Mar 2013
    Posts
    14

    Re: How to hide J2ME application in background

    i need to run my j2me application as background process so please help me with example

  9. #9
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,430

    Re: How to hide J2ME application in background

    Which Device are you targeting ? I hope you have read the discussion above.

    Regards
    Gopal
    Twitter : @balagopalks
    Linkedin : @balagopalks

  10. #10
    Registered User
    Join Date
    Mar 2013
    Posts
    14

    Re: How to hide J2ME application in background

    i want run my application on nokia multimedia phones

  11. #11
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,430

    Re: How to hide J2ME application in background

    Most of the current Series 40 and Symbian and Windows Phones are Multimedia Phones - Please specify, so that we can answer you better.

    Regards
    Gopal
    Twitter : @balagopalks
    Linkedin : @balagopalks

  12. #12
    Registered User
    Join Date
    Mar 2013
    Posts
    14

    Re: How to hide J2ME application in background

    actually our project is based on lbs(location based service) and we have developed a j2me application. from this j2me application we will send the co-ordinate to our server. but we want our application run in background so we able to send the co-ordinate to our server at specified interval

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

    Re: How to hide J2ME application in background

    To repeat Gopal's question... on what device(s) will you run the application?

    For example, if the devices you have in mind are Series 40 devices, they will not run a Java application in the background, so there is no way to do what you want.

    On the other hand, if they are Series 60 devices, they will. Use the code given in the earlier post in your MIDlet.

    It's really important to know what device(s) you're using so people can help you.

    Graham.

  14. #14
    Registered User
    Join Date
    Mar 2013
    Posts
    14

    Re: How to hide J2ME application in background

    thank you sir for your reply, this is our BE project so we probably going to check this app on s60, I just want to know where i put this code.

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

    Re: How to hide J2ME application in background

    If we're talking about this fragment of code...

    Code:
    private Display display = Display.getDisplay(this);
    private Displayable previousDisplayable;
    
    public void toBack() {
        previousDisplayable = display.getCurrent();
        display.setCurrent(null);
    }
    
    public void toFront() {
        display.setCurrent(previousDisplayable);
    }
    The "this" reference in the code is the MIDlet instance, so this code goes in your MIDlet class (or elsewhere, if you make the appropriate change).

    Graham.

Page 1 of 3 123 LastLast

Similar Threads

  1. J2me polish background image problem
    By poojs in forum Mobile Java General
    Replies: 5
    Last Post: 2009-05-29, 11:06
  2. [moved] J2me polish background image problem
    By poojs in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2009-05-25, 11:42
  3. RunL is not executed when my application is in background
    By symsta in forum Symbian User Interface
    Replies: 1
    Last Post: 2008-09-13, 14:29
  4. Change background image in Theme from J2ME application
    By kl0f in forum Mobile Java General
    Replies: 2
    Last Post: 2007-09-17, 08:57
  5. Replies: 0
    Last Post: 2006-06-08, 09:04

Posting Permissions

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