As you can see, We see the name of our application on the screen. Click "Launch" button to start our midlet.
We see now the "Hello World" text which is contained in the helloForm form :). You can change this text, or add new one from Form Designer, by double clicking helloForm object from the Flaw Designer.
Debugging The Application
The "Debug" button is located on the right side of "Run" button. When clicked, the IDE and Emulator starts working in debug mode, so our breakpoints will be hit. We can place breakpoing in the same way we do in other IDE-s. Just clicking the left side of source editor will make the midlet to break when application reaches that line, after that we will be able to debug our code step-by-step.
In debug mode, a set of new buttons appear on the IDE. This buttons are:
"Finish Debugger Session": Halts application execution instantly.
"Pause": Pauses application execution, so after we can resume it.
"Continue": Continues application execution.
"Step Over": When a breakpoint is hit, we use this button to step over a function instead of entering in. So we will debug only the code we need.
"Step Into": When a breakpoint is hit, we can use this button to enter in a function and debug it's body.
"Step Out": This button is useful when we accidentally stepped into an undesired function, we can step out imediatelly.
"Run to cursor": This button can be used to skip execution of some fragments of code and to continue from the place where our cursor is located.
"New watch": This function is very useful. We can create a watch on a variable, so we will be able to see the value of this variable during application execution. We can see all the watches from "Watches" tab in the bottom of the screen.
This functions only works in debug mode.
Launching The Application
Because starting debugger takes time, sometimes it's useful to just launch our midlet without debugging. To do so, just click on the "Run" button located at the left side of the "Debug" button. The emulator will launch again but none of the breakpoints will be hit.
Building The Project
You can also build the executable file without debugging or launching it. To do so simply click "Build main project" menu item from the "Build" menu. Our executable will be written in %Project Folder%\dist. File name will be the name of the project and file extention is "jar". You may install this jar file on your cell phone and check how it performs :). There's also one build option called "Clean and Build Main Project". Sometimes when you change the source code of your project, it doesn't reflect on the executable after building. In this situation this build option will fix your problem.
Setting The Main Screen
Main screen is a screen object which is displayed when our application starts. You can change main screen from the Flaw Designer. In the Flaw Designer put another Form object on and name the new form "AnotherForm". Then locate the "Start Point" point on the screen and drag it to the newly created form(See image below).
Now play a bit with debugging. Change a text on the helloForm and AnotherForm screens. If you don't practice yourself, my help will be helpless :).










1 comments:
Well said.
Post a Comment