Difference between revisions of "Lab BlackBerry Example"

From CDOT Wiki
Jump to: navigation, search
(2)
Line 4: Line 4:
  
 
'''Step 1.'''  
 
'''Step 1.'''  
 +
 
File->New->Others->BlackBerry Project
 
File->New->Others->BlackBerry Project
 
''Note: If you want really to learn how to build a BB app, then in the wizard choose the Empty Application option.''
 
''Note: If you want really to learn how to build a BB app, then in the wizard choose the Empty Application option.''
Line 18: Line 19:
 
     }
 
     }
 
}
 
}
 +
</source>
 +
--------
 +
 +
'''Step 2.'''
 +
 +
In the main method create a new instance of the application and make the currently running thread the application's event dispatch thread.
 +
<source lang="java">
 +
    MyApp theApp = new MyApp();
 +
    theApp.enterEventDispatcher();
 
</source>
 
</source>

Revision as of 21:25, 26 February 2011

This lab example allows you to understand the process of building a BlackBerry application using Java Plug-in for Eclipse

Step 1.

File->New->Others->BlackBerry Project Note: If you want really to learn how to build a BB app, then in the wizard choose the Empty Application option. The structure of BB project will be defined, but as the level on code generation, one will get only an empty Java app, with a code similar with this:

package mypackage;

public class MyApp{
    /**
     * Entry point for application
     * @param args Command line arguments (not used)
     */ 
    public static void main(String[] args){
    }
}

Step 2.

In the main method create a new instance of the application and make the currently running thread the application's event dispatch thread.

    MyApp theApp = new MyApp();
    theApp.enterEventDispatcher();