BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/)
-   Developer Forum (http://www.blackberryforums.com/developer-forum/)
-   -   Built HelloWorld App; No Errors; But Can't get it to run in Simulator (http://www.blackberryforums.com/developer-forum/205620-built-helloworld-app-no-errors-but-cant-get-run-simulator.html)

doni49 09-28-2009 06:29 PM

Built HelloWorld App; No Errors; But Can't get it to run in Simulator
 
I downloaded and built the HelloWorld App (finally got it to build without errors after a lot of effort).

But when I try to "Run" it using the simulator, it never appears in the device's home screen. I did create an icon (80x80) and assign it to the project and set it to position 1 on the home screen.

I'm lost.

Dougsg38p 09-28-2009 07:15 PM

What simulator are you using?

Did you check the "downloads" folder?

Did you make your project "Active" (only the active project is copied to the simulator).

doni49 09-28-2009 07:45 PM

Quote:

Originally Posted by Dougsg38p (Post 1479877)
What simulator are you using?

Did you check the "downloads" folder?

Did you make your project "Active" (only the active project is copied to the simulator).

:cry:

No--I didn't realize I needed to make it "active". I just did and the errors are back. I guess it wasn't compiling after all.

This is what I get when it does try to build....
Quote:

Executing rapc for the project HelloWorld at Mon Sep 28 19:15:45 EDT 2009.
C:\Program Files\Eclipse\plugins\net.rim.eide.componentpack4. 5.0_4.5.0.16\components\bin\launcher.exe C:\Program Files\Eclipse\plugins\net.rim.eide.componentpack4. 5.0_4.5.0.16\components\bin\rapc.exe -quiet import="C:\Program Files\Eclipse\plugins\net.rim.eide.componentpack4. 5.0_4.5.0.16\components\lib\net_rim_api.jar" codename=..\HelloWorld\HelloWorld ..\HelloWorld\HelloWorld.rapc -sourceroot=D:\Users\Don\workspace\HelloWorld\src D:\Users\Don\workspace\test\homicon.jpg D:\Users\Don\workspace\HelloWorld\bin
Warning!: No entry points found
Warning!: No definition found for exported static routine: .main(String[])
rapc executed for the project HelloWorld
BTW--I'm using Eclipse. And the simulator I'm running is Tour 9630.

Dougsg38p 09-28-2009 10:41 PM

Sounds like you app does not have a public main() routine?

doni49 09-30-2009 09:55 PM

Quote:

Originally Posted by Dougsg38p (Post 1479999)
Sounds like you app does not have a public main() routine?

That's what I thought too. And being new, I'm not sure whether this is right or not. I created a NEW workspace called "HelloWorld". Then created a NEW project called "HelloWorld". Then created and attached a new java file called HelloWorld.jaava. That file contains the following code:
Code:

/**
 * HelloWorld.java
 * Copyright (C) 2001-2003 Research In Motion Limited. All rights reserved.
 */
package com.rim.samples.helloworld;

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.system.*;

/*
 * BlackBerry applications that provide a user interface
 * must extend UiApplication.
 */
public class HelloWorld extends UiApplication
{
        public static void main(String[] args)
        {
                //create a new instance of the application
                //and start the application on the event thread
                HelloWorld theApp = new HelloWorld();
                theApp.enterEventDispatcher();
    }
        public HelloWorld()
        {
                //display a new screen
                pushScreen(new HelloWorldScreen());
        }
}

//create a new screen that extends MainScreen, which provides
//default standard behavior for BlackBerry applications
final class HelloWorldScreen extends MainScreen
{
        public HelloWorldScreen()
        {

                //invoke the MainScreen constructor
                super();

                //add a title to the screen
                LabelField title = new LabelField("HelloWorld Sample", LabelField.ELLIPSIS
                                | LabelField.USE_ALL_WIDTH);
                setTitle(title);

                //add the text "Hello World!" to the screen
                add(new RichTextField("Hello World!"));
        }

        //override the onClose() method to display a dialog box to the user
        //with "Goodbye!" when the application is closed
        public boolean onClose()
        {
            Dialog.alert("Goodbye!");
            System.exit(0);
            return true;
        }
}
new HelloWorldScreen;

Once I know it builds, then I'll start working on understanding how to add other functions.

sahil_khanna 10-01-2009 12:56 AM

Create a new project and use the following code. Initially, set a breakpoint on the first statement HelloWorld theApp = new HelloWorld(); and debug the application. Also avoid using image at the first go.

Code:

/**
 * HelloWorld.java
 * Copyright (C) 2001-2003 Research In Motion Limited. All rights reserved.
 */
package com.rim.samples.helloworld;

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.system.*;

/*
 * BlackBerry applications that provide a user interface
 * must extend UiApplication.
 */
public class HelloWorld extends UiApplication
{
        public static void main(String[] args)
        {
                //create a new instance of the application
                //and start the application on the event thread
                HelloWorld theApp = new HelloWorld();
                theApp.enterEventDispatcher();
        }
       
        public HelloWorld()
        {
                //display a new screen
                pushScreen(new HelloWorldScreen());
        }

//create a new screen that extends MainScreen, which provides
//default standard behavior for BlackBerry applications
final class HelloWorldScreen extends MainScreen
{
        public HelloWorldScreen()
        {

                //invoke the MainScreen constructor
                super();

                //add a title to the screen
                LabelField title = new LabelField("HelloWorld Sample", LabelField.ELLIPSIS
                                | LabelField.USE_ALL_WIDTH);
                setTitle(title);

                //add the text "Hello World!" to the screen
                add(new RichTextField("Hello World!"));
        }

        //override the onClose() method to display a dialog box to the user
        //with "Goodbye!" when the application is closed
        public boolean onClose()
        {
            Dialog.alert("Goodbye!");
            System.exit(0);
            return true;
        }

        }
}


doni49 10-01-2009 10:12 PM

Thanks--when I did that, a dialog box popped up that had the following message.

Quote:

The "net_rim_speech_data_en_us.debug" file is missing. Please choose the missing file.
Followed by these additional messages.....
Quote:

The "net_rim_speech_data_en_us-1.debug" file is missing. Please choose the missing file.
Quote:

The "net_rim_speech_data_en_us-2.debug" file is missing. Please choose the missing file.
Quote:

The "net_rim_speech_data_en_us-3.debug" file is missing. Please choose the missing file.
Quote:

The "net_rim_speech_data_en_us-4.debug" file is missing. Please choose the missing file.
Quote:

The "net_rim_speech_data_en_us-5.debug" file is missing. Please choose the missing file.
Quote:

The "net_rim_speech_data_en_us-6.debug" file is missing. Please choose the missing file.
Quote:

The "net_rim_speech_data_en_us-7.debug" file is missing. Please choose the missing file.
Quote:

The "net_rim_speech_data_en_us-8.debug" file is missing. Please choose the missing file.
Quote:

The "net_rim_speech_data_en_us-9.debug" file is missing. Please choose the missing file.
Quote:

The "net_rim_speech_data_en_us-10.debug" file is missing. Please choose the missing file.
Quote:

The "net_rim_speech_data_en_us-11.debug" file is missing. Please choose the missing file.
Quote:

The "net_rim_speech_data_en_us-12.debug" file is missing. Please choose the missing file.
Quote:

The "net_rim_speech_data_en_us-13.debug" file is missing. Please choose the missing file.
Quote:

The "net_rim_speech_data_en_us-14.debug" file is missing. Please choose the missing file.
Quote:

The "net_rim_speech_data_en_us-15.debug" file is missing. Please choose the missing file.
Quote:

The "net_rim_speech_data_en_us-16.debug" file is missing. Please choose the missing file.
Quote:

The "net_rim_speech_data_en_us-17.debug" file is missing. Please choose the missing file.
Quote:

The "net_rim_speech_data_en_us-18.debug" file is missing. Please choose the missing file.
Quote:

The "net_rim_speech_data_en_us-19.debug" file is missing. Please choose the missing file.
Quote:

The "net_rim_speech_data_en_us-20.debug" file is missing. Please choose the missing file.
Quote:

The "net_rim_speech_data_en_us-21.debug" file is missing. Please choose the missing file.

pritesh_bb 10-01-2009 11:31 PM

Quote:

Originally Posted by doni49 (Post 1481767)
Thanks--when I did that, a dialog box popped up that had the following message.



Followed by these additional messages.....

chk ur package structure...der might be problems with packages...as u said u have created .java in helloworld project...and u have mentioned package "com.rim.samples.helloworld"...


Thanks,
Pritesh

sahil_khanna 10-01-2009 11:54 PM

This behavior occurs when some files of the same or different workspace, related to applications loaded in the simulator, are either relocated or deleted. You just need to click "Don't ask again" to proceed further. This wont affect the functionality of the "Hello World" app, neither on the simulator nor on the real device.

doni49 10-02-2009 11:17 PM

Thanks all. But still no good. I thought maybe the installation was corrupted somehow so I completely uninstalled Eclipse, Java--all the stuff related to BB development that I had installed and then reinstalled everything from scratch.

When I try to debug the code that sahil_khanna posted, I get the error messages that I previously posted. If I do press "don't ask", it eventually just tells me that it "Some debug information is missing. Not all applications may be debuggable." Then as I was writing this, I noticed that all of the files it previously said it had trouble loading had the word "debug" in them. Then it finishes loading the simulator. But HelloWorld never shows up anywhere on the simulated BB.

So I closed the simulator and tried again--this time RUNNING it instead of DEBUGGING. But even though HelloWorld still doesn't show up on the BB, there are no error messages in Eclipse.

sorayathomas 10-03-2009 09:04 AM

When you say "doesn't show up in the simulator" - do you mean you can't find the app icon, or that when you run it nothing happens?

One other idea is to switch simulators Run -> Run Configurations... -> Simulator tab -> Profile Dropdown: choose something different -> Apply,Run

doni49 10-03-2009 09:26 AM

Quote:

Originally Posted by sorayathomas (Post 1482548)
When you say "doesn't show up in the simulator" - do you mean you can't find the app icon, or that when you run it nothing happens?

There's no icon. I thought that maybe I was just overlooking the icon--so I went in to the project properties and turned on "Auto Run at Startup". It still doesn't run.

Quote:

Originally Posted by sorayathomas (Post 1482548)
One other idea is to switch simulators Run -> Run Configurations... -> Simulator tab -> Profile Dropdown: choose something different -> Apply,Run

I tried letting it use "default"--which when it loaded was an 8300--and was greeted with a new error message dialog:

Title = "API Failure (DE372)"
Message = "API Mismatch Apps: 115, OS: 96.0)"

And the simulator shuts down.

doni49 10-03-2009 08:24 PM

1 Attachment(s)
I ran it with the debug option and copy/pasted everything from the Output window. That output is attached. Can someone PLEASE take a look and help me decipher this?

Thanks.

sorayathomas 10-04-2009 03:33 PM

Had a look at the dump, but I'm not that experienced. Somewhat similar to what I see, though I don't get the "...who has NO tunnels open - defocus NOT called" message. I don't know if that's significant.

One other idea is to try and open it from the simulator directly - you can launch a simulator if you can find the path, eg:
C:\Program Files (x86)\Research In Motion\BlackBerry Smartphone Simulators 4.6.0\4.6.0.267 (8220-OrangeFR)\8220-OrangeFR.bat

File -> Load Java Program...

... and then choose your hello world .cod file

doni49 10-06-2009 10:19 PM

Thanks all!

Still not sure what was wrong, but I started over again with a new workspace and new source files.

It now builds and shows up in the simulator--AND I CAN RUN THE APP IN THE SIMULATOR TOO!

Now to start working on some real apps!


All times are GMT -5. The time now is 11:09 AM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.