如何运行后台服务应用程序,并UIApplication的同时 [英] How can run background service application and UIApplication same time

查看:150
本文介绍了如何运行后台服务应用程序,并UIApplication的同时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要运行后台服务应用程序,并UIApplication的同一时间。

I want to run background service application and UIApplication same time.

是否有可能在这两个同一个项目创建或需要单独创建单独的项目。

Is it possible to create both in same project or need to create separate separate project.

其实我如何打电话或在事件线程启动后台服务混淆。

Actually i am confuse in how call or start background service in Event Thread.

推荐答案

这是你可以设置为你的应用程序中的备选入口点:结果

This is how you can set up an alternate entry point for your application:

A-使用BlackBerry®Java®插件用于Eclipse®

有关原始应用程序创建项目后,创建一个备选入口点启动该应用程序的UI。

After creating the project for the original application, create an alternate entry point to launch the application UI.

1的BlackBerry_App_Descriptor.xml双击您的项目中。
结果2 - 核对系统模块和不显示黑莓手机主屏幕上的应用程序图标。
结果3单击备选入口点选项卡上。
结果4-单​​击Add按钮。
结果5输入为切入点标题,然后单击确定。
结果6指定将使用这种备选入口点(例如:GUI)启动应用程序的应用参数。
结果7继续执行共同步骤部分。
结果8修改原项目的main()方法如下:

1- Double click on BlackBerry_App_Descriptor.xml within your project.
2- Check off System Module and Do not display the application icon on the BlackBerry home screen.
3-Click on the Alternate Entry Point tab.
4- Click the Add button.
5- Enter a title for the entry point and click OK.
6- Specify the application argument that would launch the application using this alternate entry point (for example: gui).
7- Proceed to the Common Steps section.
8- Modify the main() method of the original project as follows:

public static void main(String[] args) {
     if ( args != null && args.length > 0 && args[0].equals("gui") ){
          // code to initialize the app
          theApp.enterEventDispatcher();
     } else {
          // code to launch the background thread }
     }
}

搜索结果

使用B-黑莓JDE

创建原始应用程序的项目之后,你将不得不以创建UI切入点另一个项目。假设要运行的线程在同一项目中的原始应用程序存在,请按照下列步骤操作:

After creating the projects for the original application, you will have to create another project for the UI entry point. Assuming that the thread to be run exists in the same project as the original application, follow these steps:

1右键单击该项目节点,然后选择属性。
结果2-在属性窗口中,选择应用程序选项卡。
结果3验证下列选项被选中:启动和系统模块自动运行(注册到系统的线程)。
结果4-创建相同的文件夹原始项目下的另一个项目。右键单击新的项目节点,然后选择属性。
结果5选择应用程序选项卡,并从项目类型下拉列表中选择备用CLDC应用程序入口点。作为附加的文件显示,从备用切入点下拉列表原来的项目(例如,trafficreporter)的名称。此外,指定将推出采用这种备选入口点(例如:GUI)应用程序的参数。
继续执行共同步骤部分。
结果6修改原项目的main()方法如下:

1- Right-click the project node and select Properties.
2- In the Properties window, select the Application tab.
3- Verify the following options are checked: Auto-run on startup and System module (to register the thread with the system).
4- Create another project under the same folder as the original project. Right-click the new project node and select Properties.
5- Select the Application tab and select Alternate CLDC Application Entry Point from the Project type drop-down list. As shown in the attached file, select the name of the original project (for example, trafficreporter) from the Alternate entry point for drop-down list. Also specify the arguments that would launch the application using this alternate entry point (for example: gui). Proceed to the Common Steps section.
6- Modify the main() method of the original project as follows:

public static void main(String[] args) {
     if ( args != null && args.length > 0 && args[0].equals("gui") ){
          // code to initialize the app
          theApp.enterEventDispatcher();
     } else {
          // code to launch the background thread }
     }
}

这篇关于如何运行后台服务应用程序,并UIApplication的同时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆