我想使用 J2ME 在移动设备后台运行应用程序,而无需在移动设备中使用任何 GUI?

发布于 2024-12-19 08:39:45 字数 78 浏览 2 评论 0原文

我正在开发一个网络应用程序,我想在没有任何 GUI 的情况下在后台运行 J2ME MIDP 应用程序,因此构建该应用程序的任何方式都是这样的。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

探春 2024-12-26 08:39:45

尝试将

当前显示设置为空。因此屏幕上不会运行任何表单或警报。但是您的代码将在后台运行。

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

display.setCurrent(null);

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);
羞稚 2024-12-26 08:39:45

只需在任何事件上添加一行代码即可,例如单击按钮

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

并通过

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

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

一向肩并 2024-12-26 08:39:45

是的,这段代码工作得很好,

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

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

这就像,让一个按钮可以在单击它后调用隐藏函数,或者你在构造函数中调用这个隐藏函数,这样它就会在应用程序启动时隐藏自己,你可以在 appStart 中保留 unHide 语句吗() 因此,如果您按 Tab 键打开该程序,它将再次取消隐藏应用程序。

注意:您说您正在使用网络应用程序,但是当移动屏幕关闭时,某些移动设备会关闭互联网连接。请检查这个。如果您找到任何解决方案,最好在这里分享。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文