如何在后台运行J2ME应用程序? [英] How to make a J2ME application run in Background?
问题描述
我有一个J2ME应用程序,它使用蓝牙并在对等移动设备中搜索文件并下载它。我希望让我的应用程序在后台运行,无论何时我接到电话,或者消息以及稍后几秒后恢复,有没有人就此工作请分享您的经验。有没有办法在后台运行Midlet?
I have a written a J2ME application which uses Bluetooth and search a file within the peer mobile and download it. I would like to make my application run in background , whenever I get a call , or message and later resume after few seconds , Has anybody worked on this please share your experience . Is there any way to run a Midlet in background ?
推荐答案
将j2me应用程序设置为后台使用midlet中的以下内容class:
to set a j2me app to the background use the following in your midlet class:
Display.getDisplay (this).setCurrent (null);
让屏幕恢复使用以下内容:
to get the screen back use the following:
Display.getDisplay (this).setCurrent (myCanvas);
myCanvas是你的画布实例化
Where myCanvas is your canvas instantiation
R
ps在隐藏midlet时,您仍然可以使用线程或计时器在后台执行操作。
p.s. You can still use a thread or timer to do things in the background while your midlet is hidden.
p.s.2:这不适用于所有型号。 (适用于诺基亚s60,SonyEricsson,但不适用于诺基亚s40,三星和其他一些产品。
p.s.2: this does not work on all models. (Works on Nokia s60, SonyEricsson, but not on Nokia s40, Samsung and some others.
这篇关于如何在后台运行J2ME应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!