I need my J2ME app to run in the background and still allow the user to use his mobile without problem. the app still needs to process some events in the background.
I would also like to allow the user to stop the app if he wants to.
How can I accomplish this?
These include mobile phones, pagers,wireless devices and set-top boxes among others. What is a J2ME Configuration? A configuration defines the minimum Java technology that an application developer can expect on a broad range of implementing devices.
You can open "Option" menu on the top of the page and drag and drop, minimize, go full screen, or close the app here This feature is not applicable to all apps.
Hold down the Windows key and press the number key corresponding to the icon of the open app you want to minimize. The Windows + 1 shortcut minimizes File Explorer, Windows + 2 for Mozilla Firefox, Windows + 3 can be used to minimize Weather, and so on. The same shortcuts can also be used to restore the app window.
Minimizing an app means hiding its window from your desktop, without closing the app. When an app window is minimized, you can restore it to its former state, in other words, bring it back to view, by clicking or tapping on its button from the taskbar.
Running a midlet in the background but still processing is not specified in the j2me standard i think. Normaly at the moment your midlet is moved to background the paused method should be called.
But not every vendor implements it that way. Symbian keeps your program running as if there was no change when minimized. At least on the N80 and N90.
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. For in background :-
private Display display = Display.getDisplay(this);
private Displayable previousDisplayable;
public void toBack() {
previousDisplayable = display.getCurrent();
display.setCurrent(null);
}
And foreground :-
public void toFront() {
display.setCurrent(previousDisplayable);
}
But Be aware that every device not supports that features.(Works on Nokia s60, SonyEricsson, but not on Nokia s40, Samsung and some others).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With