Difference between revisions of "Teams Winter 2011/team5/lab4/tutorial"
Abhatnagar (talk | contribs) (→Step 18 - Right click the package, and create a new Class, called MyScreen) |
Abhatnagar (talk | contribs) (→Step 6 - Click Next and leave the default Java settings as it is) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 18: | Line 18: | ||
Click next == | Click next == | ||
== Step 6 - Click Next and leave the default Java settings as it is == | == Step 6 - Click Next and leave the default Java settings as it is == | ||
+ | [[Image:step4.jpg]] | ||
+ | |||
== Step 7 - Click Next and select an Empty Application to start developing == | == Step 7 - Click Next and select an Empty Application to start developing == | ||
+ | [[Image:step5.jpg]] | ||
== Step 8 - Click Finish and on the Application Tab, enter the Title for your application == | == Step 8 - Click Finish and on the Application Tab, enter the Title for your application == | ||
+ | [[Image:step6.jpg]] | ||
== Step 9 - Expand the file structure in the Package Explorer window and examine the structure already created for you == | == Step 9 - Expand the file structure in the Package Explorer window and examine the structure already created for you == | ||
− | + | [[Image:step7.jpg]] | |
== Step 10 - src folder will contain your package(s) and all your application code files. == | == Step 10 - src folder will contain your package(s) and all your application code files. == | ||
+ | [[Image:step8.jpg]] | ||
== Step 11 - res folder is the resources folder which can contain additional resources your app might use - like images, audio or video files, or the app icon == | == Step 11 - res folder is the resources folder which can contain additional resources your app might use - like images, audio or video files, or the app icon == | ||
== Step 12 - Expand your src folder and double click the .java file to begin editing == | == Step 12 - Expand your src folder and double click the .java file to begin editing == | ||
− | == Step 13 - It will look like it does in the screenshot | + | == Step 13 - It will look like it does in the screenshot above. It will have to be edited to make it the start screen where you app starts == |
− | + | == Step 14 - This is done by extending UiApplication class, which will co-ordinate the screen that is currently on top of the screen stack == | |
− | the start screen where you app starts == | + | == Step 15 - We have also added some code to create a new instance of the application and make the currently running thread the application's event dispatch thread in the main function == |
− | == Step 14 - This is done by extending UiApplication class, which will co-ordinate the screen that is | + | == Step 16 - In the constructor of the App's main class file, we push a new screen onto the top of the screen stack == |
− | + | == Step 17 - The name of the new class created, which will be the first screen of the app is specificed int he pushScreen method == | |
− | currently on top of the screen stack == | ||
− | == Step 15 - We have also added some code to create a new instance of the application and make the | ||
− | |||
− | currently running thread the application's event dispatch thread in the main function == | ||
− | == Step 16 - In the constructor of the App's main class file, we push a new screen onto the top of | ||
− | |||
− | the screen stack == | ||
− | == Step 17 - The name of the new class created, which will be the first screen of the app is | ||
− | |||
== Step 18 - Right click the package, and create a new Class, called MyScreen == | == Step 18 - Right click the package, and create a new Class, called MyScreen == | ||
+ | [[Image:step9.jpg]] | ||
== Step 19 - MyScreen will be the first screen of the app and here we can configure a screen title and anything else we want to start the app with == | == Step 19 - MyScreen will be the first screen of the app and here we can configure a screen title and anything else we want to start the app with == | ||
+ | [[Image:step10.jpg]] | ||
== Step 20 - In this tutorial, we create a button, defined as an instance variable of the MyScreen class == | == Step 20 - In this tutorial, we create a button, defined as an instance variable of the MyScreen class == | ||
== Step 21 - We set the current class to be the listener for any changes in the state of this button and assign it a title == | == Step 21 - We set the current class to be the listener for any changes in the state of this button and assign it a title == | ||
== Step 22 - The button is added to the screen, which is a UiApplication object == | == Step 22 - The button is added to the screen, which is a UiApplication object == | ||
− | == Step 23 - In the field changed method, we push another screen into view when the button is pressed | + | == Step 23 - In the field changed method, we push another screen into view when the button is pressed == |
− | + | == Step 24 - The LocationTracker class is pushed into view and so it also extends the MainScreen class == | |
− | == | + | [[Image:step11.jpg]] |
− | == Step 24 - The LocationTracker class is pushed into view and so it also extends the MainScreen | + | == Step 25 - To get the location of the user in the LocationTracker class, we need to have a class that gets the users location == |
+ | == Step 26 - The MyLocationListener class implements LocationListener, so the class can be notified as the users location is updated == | ||
+ | [[Image:step12.jpg]] | ||
+ | == Step 27 - The locationUpdated method gets the latitude and the logitude of the user and saves then in two instance variables of the MyScreen class == | ||
+ | == Step 28 - In the LocationTracker class, we define some RichTextFields to output the collected value of the latitude and longitude == | ||
+ | [[Image:step13.jpg]] | ||
+ | == Step 29 - We also create a BitMap object and configure its weight and height using the methods defined in the BlackBerry docs == | ||
+ | == Step 30 - The BitMap object, SeparatorField object and RadioButtonField objects are added to the screen == | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Step 31 - We add a new button that will process the results of the radioButtons == | == Step 31 - We add a new button that will process the results of the radioButtons == | ||
− | == Step 32 - The button's field change listener method is coded to alert the user based on their | + | == Step 32 - The button's field change listener method is coded to alert the user based on their radiobutton value selected == |
− | |||
== Step 33 - Import all required packages and resolve anyother warnings suggested by Eclipse == | == Step 33 - Import all required packages and resolve anyother warnings suggested by Eclipse == | ||
− | == Step 34 - Once all errors are resolved, Click on Run, go to Run as and then BlackBerry Simulator | + | [[Image:step14.jpg]] |
+ | == Step 34 - Once all errors are resolved, Click on Run, go to Run as and then BlackBerry Simulator == | ||
+ | [[Image:step15.jpg]] | ||
+ | == Step 35 - Expand on the apps in the simulator, and select the app just created == | ||
− | + | [[Image:step16.jpg]] | |
− |
Latest revision as of 21:56, 15 April 2011
Contents
- 1 Step 1 - Download BlackBerry Plug-in for Eclipse and Simulator from here: http://us.blackberry.com/developers/javaappdev/
- 2 Step 2 - Download BlackBerry Plug-in for Eclipse and Simulator from here: http://us.blackberry.com/developers/javaappdev/
- 3 Step 3 - Unzip the package in a location like: .../eclipse/mobile/blackberry
- 4 Step 4 - Start Eclipse, and Go to File > New > BlackBerry Project
- 5 Step 6 - Click Next and leave the default Java settings as it is
- 6 Step 7 - Click Next and select an Empty Application to start developing
- 7 Step 8 - Click Finish and on the Application Tab, enter the Title for your application
- 8 Step 9 - Expand the file structure in the Package Explorer window and examine the structure already created for you
- 9 Step 10 - src folder will contain your package(s) and all your application code files.
- 10 Step 11 - res folder is the resources folder which can contain additional resources your app might use - like images, audio or video files, or the app icon
- 11 Step 12 - Expand your src folder and double click the .java file to begin editing
- 12 Step 13 - It will look like it does in the screenshot above. It will have to be edited to make it the start screen where you app starts
- 13 Step 14 - This is done by extending UiApplication class, which will co-ordinate the screen that is currently on top of the screen stack
- 14 Step 15 - We have also added some code to create a new instance of the application and make the currently running thread the application's event dispatch thread in the main function
- 15 Step 16 - In the constructor of the App's main class file, we push a new screen onto the top of the screen stack
- 16 Step 17 - The name of the new class created, which will be the first screen of the app is specificed int he pushScreen method
- 17 Step 18 - Right click the package, and create a new Class, called MyScreen
- 18 Step 19 - MyScreen will be the first screen of the app and here we can configure a screen title and anything else we want to start the app with
- 19 Step 20 - In this tutorial, we create a button, defined as an instance variable of the MyScreen class
- 20 Step 21 - We set the current class to be the listener for any changes in the state of this button and assign it a title
- 21 Step 22 - The button is added to the screen, which is a UiApplication object
- 22 Step 23 - In the field changed method, we push another screen into view when the button is pressed
- 23 Step 24 - The LocationTracker class is pushed into view and so it also extends the MainScreen class
- 24 Step 25 - To get the location of the user in the LocationTracker class, we need to have a class that gets the users location
- 25 Step 26 - The MyLocationListener class implements LocationListener, so the class can be notified as the users location is updated
- 26 Step 27 - The locationUpdated method gets the latitude and the logitude of the user and saves then in two instance variables of the MyScreen class
- 27 Step 28 - In the LocationTracker class, we define some RichTextFields to output the collected value of the latitude and longitude
- 28 Step 29 - We also create a BitMap object and configure its weight and height using the methods defined in the BlackBerry docs
- 29 Step 30 - The BitMap object, SeparatorField object and RadioButtonField objects are added to the screen
- 30 Step 31 - We add a new button that will process the results of the radioButtons
- 31 Step 32 - The button's field change listener method is coded to alert the user based on their radiobutton value selected
- 32 Step 33 - Import all required packages and resolve anyother warnings suggested by Eclipse
- 33 Step 34 - Once all errors are resolved, Click on Run, go to Run as and then BlackBerry Simulator
- 34 Step 35 - Expand on the apps in the simulator, and select the app just created
Step 1 - Download BlackBerry Plug-in for Eclipse and Simulator from here: http://us.blackberry.com/developers/javaappdev/
Step 2 - Download BlackBerry Plug-in for Eclipse and Simulator from here: http://us.blackberry.com/developers/javaappdev/
Step 3 - Unzip the package in a location like: .../eclipse/mobile/blackberry
Step 4 - Start Eclipse, and Go to File > New > BlackBerry Project
== Step 5 - Enter the Project Name and ensure the project specific JRE selected is BlackBerry JRE.
Click next ==