Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Do I Minimize a J2ME App?

Tags:

java

java-me

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?

like image 461
Attilah Avatar asked Jul 05 '09 16:07

Attilah


People also ask

What is a J2ME configuration?

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.

How to minimize/close/close the app?

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.

How do I minimize the size of an app window?

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.

What does it mean when an app is minimized?

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.


2 Answers

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.

like image 89
Janusz Avatar answered Sep 23 '22 19:09

Janusz


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).

like image 23
Arpit Kulsreshtha Avatar answered Sep 25 '22 19:09

Arpit Kulsreshtha