03-04-2010 04:04 PM
Wow, I can't believe that I missed that his method was outside main XD.
03-10-2010 01:08 PM
I've been able to store the infos I needed to be stored into the BlackBerry and also had these infos ouputed into the console window.
But I'm still not able to view my "Hello World" into that console. I tried to debug the line in error with breakpoints but when it comes to that lines I have an error in the "problems" console.
Here is a printscreen of the errors I have. Considering my lack of knowing into JAVA/BlackBerry dev. I really have no idea what this could be. I searched out on the Web but without success.
Thanks for all the support you're giving me.
03-10-2010 01:15 PM - edited 03-10-2010 01:19 PM
Look at the screenshot you provided. Notice that under the "Problems" tab there are two things listed, the second one says "Warning: Ecrire() not invoked". Since this is the method that prints "Hello, World" and you never call that method "Hello World" will never be printed. Here's the code you would need
public class Example extends UiApplication
public static void main(String args)
//Beginning of program
Example app = new Example();
public Example() //Constructor
public void ecrire()
I'll try to go through it. The main method is the first one you'll see in that code. This is what starts the program (you must always have a main method somewhere in your program). From there it calls the constructor of the class when we type "new Example()". That executes the constructor, the constructor then calls the method ecrire() which prints "Hello, World". The enterEventDispatcher() method is specific to BlackBerry.
I'd really recommend trying to learn just Java first and then go into BlackBerry development once you've got the hang of that.
03-10-2010 01:27 PM
Thanks a lot!
Yeah, you're right. I never developped in Java before and I usually developp in PHP and it's really not the same thing.
Thanks again for your support!
Not a problem. The area where you're having problems is that PHP starts executing at the top of the file and works its way down. This does not work in Java: all code must be in methods and their position in the file does not matter. Have you done any object oriented programming with PHP? If you have it might be possible to go directly into BlackBerry development but if not I would definitely learn Java by itself first. Alternatively if you really want to develop for BlackBerry you can develop web applications for the BlackBerry.
03-10-2010 01:29 PM
There are many Java tutorials available if you need to brush up. No shame in inexperience