Nauman Khalid
Nauman Khalid

Reputation: 862

I want to run the application in background of mobile without any GUI in mobile using J2ME?

I am developing the network application in which I want to run my J2ME MIDP application in background without any GUI so that is any way to construct the application is such manner.

Upvotes: 1

Views: 967

Answers (3)

Pavan Kumar
Pavan Kumar

Reputation: 21

Yes this code works Good,

display = Display.getDisplay(this);
public void startApp()
{
    display.setCurrent(form);
}
public void pauseApp()
{

}
public void hide()
{
    Display.getDisplay (this).setCurrent (null);
}

This is will work like, make a button can after clicking it call hide Function, or you call this hide function in constructor so it will hide itself when app start, can you keep unHide statement in appStart() so if you Tab the program then it will unHide app again.

NOTE: you said you are working on Network app, but some mobile will turn off the Internet Connection, when the Mobile screen Turn Off. please check this. and If you found any solution It will be Good to share here.

Upvotes: 1

Nauman Khalid
Nauman Khalid

Reputation: 862

it easy just have a code of line on any event for example in the click of button

Display.getDisplay (this).setCurrent (null);

and return back the control via

Display.getDisplay (this).setCurrent (mycanvas);

Upvotes: 1

Lucifer
Lucifer

Reputation: 29672

try this

set your current Display to null. so there will not be any form or alert running on the screen. But however your code will be running in the background.

Display display = Display.getDisplay(this);  // here 'this' points to Midlet

display.setCurrent(null);

Upvotes: 3

Related Questions