08-15-2008 11:57 AM
I created 3 projects in one workspace, a background app, an UI entry point app, and a resource project. The UI entry point contains only an image file serving as the application icon and with the property of "Arguments passed..." set as "gui". I also set its home screen position as 1. I set all 3 projects active and clicked Go to debug, but only the background app was seen auto-started on the simulator. There is no icon shown on the home screen to serve as an alternate entry point. What stupid mistakes have I possibly made? Thanks to anyone providing help!
BTW, the "Alternate entry point for: " drop box is grey, though filled by the IDE with the correct background app's name.
08-15-2008 01:57 PM - edited 08-15-2008 01:58 PM
Does your entry point with an icon have the "System module" option checked in its project properties? If so, no icon would be shown.
Also, what BlackBerry simulator are you using? The icons can show up in different places in different themes. For example, in the BlackBerry Bold simulator they show up under the Downloads folder.
08-15-2008 03:22 PM
Thanks for your quick reply!
I didn't have "system module" checked for the entry app. The simulator I use comes within JDE 4.3, device profile 8130.
I ever tried simulating solely my background app as a normal application (not auto-start I mean), and the icon appeared on top of the list on the main screen when I set the position to be 1. Now there is nothing, even within the application folder. I don't see any "download" folder on 8130. I'm quite new to BlackBerry development and never knew about Bold simulator or "themes"...
08-15-2008 03:29 PM - edited 08-15-2008 03:30 PM
Please try running clean.bat in the BlackBerry simulator directory to reset it to its default state (wait for the window to close). Then Clean, Build and run your application.
If you don't see it check to see if your cod file is located in the simulator directory.
Is this happening to all applications or just this one. If you build any of the samples do they show up in the BlackBerry Simulator?
Themes control the look of the BlackBerry. You can change them under Options, Theme on the BlackBerry.
08-15-2008 05:44 PM
Hi, Mark,
Thanks for keep updating me. I ran the clean.bat, cleaned and rebuilt all the projects, then I saw two warnings: No entry points found and No dfinition found for exported static routine: .main(String[]). How can I have it found?
As I mentioned in my original post, the dropoff box in the entry application properties panel is always grey, is this an indication that this option is inactive?? I couldn't find any way to configure it.
I don't see any .cod files of my projects in the simulator folder if I use Windows Explorer directly to browse to C:\Program Files\Research In Motion\BlackBerry JDE 4.3.0\simulator. But if I click file-> Load Java Program in the simulator to browse, I do see them there. My machine is Vista, not sure if this is the reason...
Nice weekend to you and everybody here!
08-18-2008 10:12 AM
We could have a couple of issues here. A problem with the BlackBerry JDE or an issue with your application.
Can you try to build some of the sample applications included with the BlackBerry JDE and see if they appear in the BlackBerry Simulator?
Are you working with a BlackBerry CLDC application or are any of your projects a MIDlet?
Can you post your main entire method?
08-19-2008 11:25 AM
Yeah, I've tried the sample application and seen its icon on the simulator. And it could be executed normally.
Below are my "code", a mixture of the slightly modified sample Helloworld project and lines pasted by others in this forum. I am still learning.
/* * HelloTest.java * * © <your company here>, 2003-2007 * Confidential and proprietary. */ package HelloTest; import HelloTest.resource.*; import net.rim.device.api.ui.*; import net.rim.device.api.ui.component.*; import net.rim.device.api.ui.container.*; import net.rim.device.api.i18n.*; import net.rim.device.api.system.*; import net.rim.device.api.collection.util.*; /** * */ public class HelloTest extends UiApplication { /** * Entry point for application. public static final long APP_ID = 0xf46f5a7867d69ff0L; public static void main(String[] args) { HelloTest theApp=null; RuntimeStore runtimeStore = RuntimeStore.getRuntimeStore(); boolean isGui= (args != null && args.length > 0 && args[0].equals("gui")); if (isGui) { // check if the thread is already on synchronized (runtimeStore) { theApp = (HelloTest)runtimeStore.get(APP_ID); } } if (theApp != null ) { //bring the thread foreground if already on theApp.requestForeground(); } else { // code to launch the background thread theApp = new HelloTest(isGui); synchronized(runtimeStore) { runtimeStore.put(APP_ID, theApp); } theApp.enterEventDispatcher(); } } public HelloTest(boolean isGui) { // Push the main screen instance onto the UI stack for rendering. this.pushScreen(new HelloTestScreen(isGui)); } } /*package*/ final class HelloTestScreen extends MainScreen implements HelloTestResResource { private static ResourceBundle _resources = ResourceBundle.getBundle(BUNDLE_ID, BUNDLE_NAME); public void hide() { UiApplication.getUiApplication().requestBackground
(); } void exit() { RuntimeStore runtimeStore = RuntimeStore.getRuntimeStore(); runtimeStore.remove(HelloTest.APP_ID); System.exit(0); } private MenuItem _hideMenu = new MenuItem("Hide", 110,10) { public void run() { hide(); } }; private MenuItem _exitMenu = new MenuItem("Exit", 110, 10) { public void run() { exit(); } }; protected void makeMenu (Menu menu) { menu.add(_hideMenu); menu.add(_exitMenu); } /** * HelloTestScreen constructor. */ public HelloTestScreen(boolean isGui) { super(DEFAULT_MENU | DEFAULT_CLOSE); // Add a field to the title region of the screen. We use a simple LabelField here. The ELLIPSIS option truncates // the label text with "..." if the text is too long for the space available. setTitle(new LabelField(_resources.getString(HELLOTEST_TITLE), LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH)); // Add a read only text field (RichTextField) to the screen. The RichTextField is // focusable by default. In this case we provide a style to make the field non-focusable. add(new RichTextField(_resources.getString(HELLOTEST_CONTE NTSTRING),Field.NON_FOCUSABLE)); Menu menu = new Menu(); makeMenu(menu); } /** * Overrides onClose() in superclass Screen. * @return True if the screen closes; otherwise, false. */ public boolean onClose() { // Display a farewell message before closing application. Dialog.alert(_resources.getString(HELLOTEST_EXITST RING)); RuntimeStore runtimeStore = RuntimeStore.getRuntimeStore(); runtimeStore.remove(HelloTest.APP_ID); System.exit(0); return true; } }
How can I specify the main() as an entry point to avoid the two warnings? BTW, I couldn't paste the screen shot of the properties panel of the alternate entry point project, which does not contain any code.
Thank you~~~
08-19-2008 11:27 AM
08-19-2008 03:16 PM
08-19-2008 05:12 PM