Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
Posts: 5
Registered: ‎11-23-2008
My Device: Not Specified

Can't find app in BB 9500 Sim

Hi all,

 

I installed the BB Component Pack 4.7.0.39 and BB JDE Plug-in for Eclipse 1.0.0.50 in my Eclipse environment 3.4.1.

I will test the samples of developer documentation like "HelloWorld". So I chose in my Eclipse "Run As - Black Berry Simulator" and chose the "9500 configuration". But i can't find the HelloWorld app on the simulator?!



/**
* HelloWorld.java
* Copyright (C) 2001-2003 Research In Motion Limited. All rights reserved.
*/

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 Java Applications that provide a UI
* must extend the Ui class.
*/
public class HelloWorld extends Ui
{
    public static void main(String[] args)
    {
        //Create a new instance of the BlackBerry Java® Application
        //and start the BlackBerry Java 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 and provides
//behaviour similar to that of other BlackBerry Java 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!"));
    }
    //To display a dialog box to a BlackBerry smartphone user with the text
    //"Goodbye!" when the BlackBerry smartphone user closes the BlackBerry Java Application, override the onClose() method.
    public boolean onClose()
    {
        Dialog.alert("Goodbye!");
        System.exit(0);
        return true;
    }
}


 

I tried the svgcldcdemo too, but the the same behaviour. Has anybody an idea what can be wrong?

 

best regards,

Blitzpilot

Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: Can't find app in BB 9500 Sim

Check "Downloads" icon on the workspace

 

New Developer
Posts: 5
Registered: ‎11-23-2008
My Device: Not Specified

Re: Can't find app in BB 9500 Sim

Hi tbilisoft,

 

Downloads is emtpy. The debug out shows the following if i load "File -> Load Java Programm -> HelloWorld.cod"


VM:+GC(f)w=21
VM:-GCt=7,b=0,r=0,g=f,w=21
VM:+RR
RX=10M,RF=10.1M,FF=46.7M,OF=395K,OS=20.1M,ON=96.9K,OR=0,FR=68,TR=54.9K,RR=0,IS=7.2K
RA=14.8M,RS=12.9M,RN=43.3K
TA=5.1M,TS=5M,TN=28K
PA=2.1M,PS=2.1M,PN=6.6K
R0=105.6M,1=420.6K,2=24K,3=71.4K,4=2.1M,7=57.7K,8=3K,9=13.7M,10=12.4K,11=5.8K,12=272.9K,13=29.6K,15=136.8K,20=3.2K,21=524,22=51.7K
VM:-RR
RX=10M,RF=10.4M,FF=46.3M,OF=395K,OS=20.1M,ON=96.9K,OR=0,FR=68,TR=54.9K,RR=0,IS=7.2K
RA=14.4M,RS=12.5M,RN=42.1K
TA=5.5M,TS=5.4M,TN=29.2K
PA=2.1M,PS=2.1M,PN=6.6K
R0=105.6M,1=420.6K,2=24K,3=71.4K,4=2.1M,7=57.7K,8=3K,9=13.4M,10=12.4K,11=5.8K,12=272.9K,13=29.6K,15=136.8K,20=3.2K,21=524,22=51.7K
VM:+GC(f)w=10
VM:-GCt=8,b=1,r=0,g=f,w=10
VM:+RR
RX=10M,RF=10.4M,FF=46.3M,OF=395K,OS=20.1M,ON=96.9K,OR=0,FR=68,TR=54.9K,RR=0,IS=7.2K
RA=14.4M,RS=12.5M,RN=42.1K
TA=5.5M,TS=5.4M,TN=29.2K
PA=2.1M,PS=2.1M,PN=6.6K
R0=105.6M,1=420.6K,2=24K,3=71.4K,4=2.1M,7=57.7K,8=3K,9=13.4M,10=12.4K,11=5.8K,12=272.9K,13=29.6K,15=136.8K,20=3.2K,21=524,22=51.7K
VM:-RR
RX=10M,RF=10.8M,FF=46M,OF=395K,OS=20.1M,ON=96.9K,OR=0,FR=68,TR=54.9K,RR=0,IS=7.2K
RA=14.1M,RS=12.2M,RN=39.5K
TA=5.8M,TS=5.7M,TN=31.8K
PA=2.1M,PS=2.1M,PN=6.6K
R0=105.6M,1=420.6K,2=24K,3=71.4K,4=2.1M,7=57.7K,8=3K,9=13M,10=12.4K,11=5.8K,12=272.9K,13=29.6K,15=136.8K,20=3.2K,21=524,22=51.7K
VM:+CR
VM:TI2Rv=59
VM:-CR=0

 



 

I reinstalled the components, but the problem still exists Man Sad

 

best regards,

Blitzpilot

Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: Can't find app in BB 9500 Sim

Let's clarify the situation to find out the real source of the problem.

 

  1. Turn off JDE and Eclipse
  2. Open simulator folder and run clean.bat
  3. Run eclipse and try to build and run the project

When device simulator starts inspect the simulator folder for HelloWorld.cod and HelloWorld.debug files.

If eclipse generates different filenames - look at filename.cod and filename.debug files in simulator folder.

 

If there are no such files - the eclipse plugin did not set up properly JDE path or something like this.

New Developer
Posts: 5
Registered: ‎11-23-2008
My Device: Not Specified

Re: Can't find app in BB 9500 Sim

Hi tbilisoft,

 

thanks for your quick answer. I am sorry for my late reply.

 

I turned off JDE and Eclipe. I ran clean.bat. I ran the project and the JDE starts with standard configuration. I found HelloWorld.cod .cso .debug in the simulator folder. But there is no application in the downloads folder or something else.

There are any environment variables to set?

 

best regards,

Blitzpilot

Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: Can't find app in BB 9500 Sim

Nope, there are no environment vars to resolve this issue.

 

Try to write a simple "Hello World" application instead of the standard "Hello world" app which uses libs and resources from samples folder. Just a simple app without screens and menus. With one main class and one System.out.println("Hello world"); inside.

 

To view the app output use JDE and "Output"window

 

It can be opened in JDE via menu: View-Output

New Developer
Posts: 5
Registered: ‎11-23-2008
My Device: Not Specified

Re: Can't find app in BB 9500 Sim

Back to the roots :-)

However, I wrote a simple class with System.out.println statement. Unbelievable, but now I found an icon in the downloads folder. Thx, a step forward - but what can be the problem with original HelloWorld?

 

best regards,

Blitzpilot

 

Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: Can't find app in BB 9500 Sim

HelloWorld in samples folder is not an independent application.

 

It depends on another classes/apps and resources located in other folders.

 

Probably there is a problem with correct dependencies when the HelloWorld app deployed to the simulator.

 

And due to this fact the simulator may hide its icon as an incorrect one.

New Developer
Posts: 5
Registered: ‎11-23-2008
My Device: Not Specified

Re: Can't find app in BB 9500 Sim

I agree with you. Thanks for your time.

Where i have to create my project (folder, files) for the example?

 

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

 

Sorry, i haven't wrote Java programs since 2 years. I can't remember how to structure packages etc.

 

best regards,

Blitzpilot

Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: Can't find app in BB 9500 Sim

  1. Create a separate folder.
  2. In JDE create a new workspace in that folder.
  3. Add a project to this new workspace
  4. Open project properties and specify your app name and other properties
  5. Add a png file to the project
  6. Select png-file properties and check "Use as app icon". This image will be the application icon. It is recommended to use 28x28 png image. It fits to the most of device models.
  7. Add source files to your project
  8. Compile and enjoy

Below there are some useful links for you:

 

http://na.blackberry.com/eng/developers/
http://na.blackberry.com/eng/developers/resources/developer_labs.jsp
http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/customview.html?func=...

 

Good luck Smiley Happy