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
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
Maybe. Some devices support background execution. Some do not.
There is no specific function for putting your app into the background. The usual technique is:
You might also want to check out the BlackBerry Developer Zone.Code:Display.getDisplay(theMidlet).setCurrent(null);
Graham.
Using above code application goes in background on both Nokia and BlackberryCode:if (Command == oCommand) { Display display = Display.getDisplay(this); display.setCurrent(null); }
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
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:
Note that this will not work on all devices. You will need to test it on your target devices.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); }
Graham.
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
i need to run my j2me application as background process so please help me with example
Which Device are you targeting ? I hope you have read the discussion above.
Regards
Gopal
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
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
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.
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.
If we're talking about this fragment of code...
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).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); }
Graham.