Download presentation
Presentation is loading. Please wait.
1
v0.01 © 2009 Research In Motion Limited Introduction to Java Application Development for the BlackBerry Smartphone Trainer name Date
2
736-01827-123 © 2009 Research In Motion Limited Revision history Document versionDateUpdated byDescription of revision 0.1Angela-Jo GriffinInitial content creation
3
© 2009 Research In Motion Limited Agenda In this course, you will cover the following topics: –Introduction to Java® application development for mobile devices –Understanding Java APIs for mobile devices –Developing a user interface for mobile devices –Push technology for Java applications –Introduction to threading and background processing –Network communication for mobile devices –Testing and debugging an application API application programming interface
4
© 2009 Research In Motion Limited Developing a user interface for mobile devices
5
© 2009 Research In Motion Limited Developing a user interface for mobile devices Objectives –Describe MIDP –Describe the BlackBerry® CLDC application –Explain the best practices for successful mobile device UIs –List and explain the components of the BlackBerry® smartphone UI CLDCConnected Limited Device Configuration MIDPMobile Information Device Profile UIuser interface
6
© 2009 Research In Motion Limited Developing a user interface for mobile devices Objectives –Explain how to create a basic UI for a mobile application for a mobile device such as a BlackBerry smartphone –Describe how to evaluate a mobile device UI
7
© 2009 Research In Motion Limited Introduction to the BlackBerry smartphone user interface
8
© 2009 Research In Motion Limited Introduction to the BlackBerry smartphone user interface The main structure for a BlackBerry smartphone UI is the Screen object. Select your UI APIs according to the type of application you want to create. –For a BlackBerry Java Application, use the BlackBerry UI APIs. –To use MIDlets, use the MIDP UI APIs. JVMJava® Virtual Machine
9
© 2009 Research In Motion Limited Introduction to the BlackBerry smartphone user interface BlackBerry applications –A BlackBerry® Application is an application that uses the BlackBerry APIs, as well as the CLDC APIs and possibly the MIDP APIs. –A BlackBerry API application extends the UiApplication class and starts with a standard main() method.
10
Introduction to the BlackBerry smartphone user interface Advantages of using the BlackBerry APIs –BlackBerry UI APIs provide more functionality and flexibility than the standard javax.microedition.lcdui APIs that you use to create MIDlets. –Applications can run background threads after the application closes. –Applications can start automatically in the background when the device turns on. –Applications can use IPC APIs to exchange information with other applications. –Developers can create library modules that BlackBerry API applications can import. IPCinterprocess communication
11
Introduction to the BlackBerry smartphone user interface Advantages of using the BlackBerry APIs –Applications can access trackball and trackwheel events. –Applications can access touch screen events on a BlackBerry smartphone with a touch screen. –Applications can use data from the accelerometer on a BlackBerry device. –Applications can integrate with BlackBerry® Browser, BlackBerry® Maps, and other applications. –Applications can change the icon that displays on the Home screen on a BlackBerry smartphone.
12
Introduction to the BlackBerry smartphone user interface Disadvantages of using the BlackBerry APIs: –BlackBerry API applications can run only on a BlackBerry smartphone.
13
© 2009 Research In Motion Limited Best practices for successful mobile device UIs
14
© 2009 Research In Motion Limited Best practices for successful mobile device UIs Limitations of mobile devices –small screen size –slow processor speeds –wireless networks have a longer latency period than standard LANs –small amount of available memory –short battery life –display one screen at a time
15
© 2009 Research In Motion Limited Best practices for successful mobile device UIs Best practice guidelines –Use or extend existing UI components where possible –Follow the standard navigation model –Support and extend user tasks in useful ways –Stay focused on users' immediate task –Verify that available menu actions are relevant –Minimize steps to complete tasks
16
© 2009 Research In Motion Limited Best practices for successful mobile device UIs Best practice guidelines –Allow users to undo commands –Make effective use of the small screen
17
© 2009 Research In Motion Limited Components of the BlackBerry smartphone UI
18
The BlackBerry UI is a three-level hierarchy. –Screen class net.rim.device.api.ui.Screen –Manager class net.rim.device.api.ui.Manager –Field class net.rim.device.api.ui.component
19
Components of the BlackBerry smartphone UI –The Screen class provides Standard screen layout Default menu Standard behavior for user input –The BlackBerry smartphone displays screens One at a time By pushing and popping them off of the display stack
20
Components of the BlackBerry smartphone UI –The Manager class provides the ability to arrange components on a BlackBerry smartphone screen in standard ways. –A manager specifies Location and layout of fields it contains Scrolling Focus change between fields –Every screen must contain at least one manager.
21
Components of the BlackBerry smartphone UI –The Field class provides the fundamental functionality for all field components. –A field is a rectangular region that displays output to a user. –A field can also handle input. –Field components provide standard UI elements for date selection, options, check boxes, lists, text fields, labels, and progress bar controls.
22
© 2009 Research In Motion Limited Screens
23
Screen objects: –The Screen object is the main structure for a BlackBerry smartphone UI. –The UI APIs initialize simple Screen objects. –You can add fields and a menu to a screen. –Display the screen by pushing it on to the UI stack.
24
Screens To create a screen, do the following: 1.Import the following classes net.rim.device.api.ui.Screen net.rim.device.api.ui.container.FullScreen net.rim.device.api.ui.container.MainScreen 2.Extend the Screen class or one of its subclasses, FullScreen or MainScreen.
25
Screens Other screen considerations include: –Application screens –Dialog boxes –Progress indicators –Menus
26
Screens Application screen: –The BlackBerry smartphone can have multiple applications open at once, but users can only view one screen at a time. –If multiple screens are open, the BlackBerry smartphone organizes the screens in a stack. –The screen at the top of the stack is the active screen.
27
Screens Application screen elements: –The title bar appears at the top of the screen. –Scroll bars allow users to view content that extends beyond the viewing area. –The context menu contains a list of available actions within the current context. –The full menu contains all the available actions for the application.
28
Screens Dialog boxes: –Prompt users for information that the application requires to complete a user-initiated task. –Inform users of urgent information or the status of important actions. –Warn users of unexpected or potentially destructive conditions or situations.
29
Screens Progress indicators: –Indicate the status of an operation Definite progress indicators—horizontal bar fills from left to right as an operation progresses. Indefinite progress indicators—use a message or graphic that does not indicate percent complete or time remaining.
30
Screens Menus: –The Application Menu Item API, in the net.rim.blackberry.api.menuitem package, allows you to add menu items to BlackBerry Java Applications. –The ApplicationMenuItemRepository class allows you to add or remove menu items from BlackBerry Java Applications.
31
Screens Menus: –You can create a Full menu, which includes all the actions that users can perform in the application Context menu, or short menu, which contains a list of the most common available actions that users can perform within the current context
32
© 2009 Research In Motion Limited Managers
33
Managers include: –HorizontalFieldManager –VerticalFieldManager –FlowFieldManager –DialogFieldManager
34
Managers HorizontalFieldManager : –Lays out fields from left to right in a single row –Can provide horizontal scrolling for fields that do not fit on the screen –Can provide vertical scrolling for fields that are taller than the screen
35
Managers VerticalFieldManager : –Lays out fields in a single vertical row –Can provide vertical scrolling for fields that do not fit on the screen –Can provide horizontal scrolling for fields that are wider than screen
36
Managers FlowFieldManager : –Lays out fields in a horizontal, then vertical flow. Fields are positioned from left to right –Places any fields that do not fit in the allotted horizontal space on the next line below, beginning from the left –Supports both horizontal and vertical scrolling
37
Managers DialogFieldManager : –Handles an icon, a message, and a special area, which can hold a list of user-specified custom fields. –Uses a VerticalFieldManager to lay out the fields in the user area. –A VerticalFieldManager lays out its icon in the top left corner, and its message label in the top left corner.
38
Managers Nested managers: –Managers are an extension of the Field class. –If you nest one manager into another manager, you can create various field layouts on the screen. –If you select managers that enable scrolling, you can also control how a user interacts with the fields on the screen.
39
© 2009 Research In Motion Limited Fields
40
Fields provide standard UI elements for controls: –Buttons –Check boxes –Drop-down lists –List boxes –Option buttons –Text fields –Search fields –Tree views
41
Fields Traditional field –Button –Check box –Date –Dialog box –Drop-down list BlackBerry field –ButtonField –CheckboxField –DateField –PopupScreen –NumericChoiceField or ObjectChoiceField
42
Fields Traditional field –Radio button –Text –Text label –List BlackBerry field –RadioButtonField –RichTextField, BasicEditField, EditField, PasswordEditField, or AutoTextEditField –LabelField –ListField
43
© 2009 Research In Motion Limited Drawing directly on the screen
44
Graphics class –There are two main areas where you can typically use the Graphics class: Field level Screen level –You can draw at the screen level to make use of animation or multimedia content in an application. © 2009 Research In Motion Limited
45
Drawing directly on the screen Graphics class –You perform the bulk of the work of the Graphics class in the paint method of the Field class. –A BlackBerry smartphone invokes the paint() method when a field, or part of the field, must be redrawn. –You can override the paint() method to create a custom field, or to modify an existing field. © 2009 Research In Motion Limited
46
Drawing directly on the screen Canvass class –To draw a circle or rectangle, extend the Canvas class and override its paint() method. © 2009 Research In Motion Limited
47
Drawing directly on the screen Drawing graphics within graphics –Vary the approach you take to create your graphics based on their usage pattern. –Create an image once and reuse it to save processing time. This approach is ideal for images that remain fairly constant. This approach is not optimal for highly dynamic content. © 2009 Research In Motion Limited
48
Evaluating a mobile device UI
49
© 2009 Research In Motion Limited Evaluating a mobile device UI –Review the best practices for designing applications for BlackBerry smartphones. –Preverify a BlackBerry Java Application with the Preverify tool. –Test applications on a BlackBerry Smartphone Simulator. –Test applications on a BlackBerry smartphone.
50
© 2009 Research In Motion Limited
51
Legal Disclaimer The following trademarks and/or registered trademarks of Research In Motion are referred to in this presentation: –BlackBerry® –Research In Motion® –RIM® The following BlackBerry products are referred to in this presentation: –BlackBerry® Enterprise Solution –BlackBerry® Enterprise Server The following third-party trademarks are referred to in this presentation: © 2009 Research In Motion Limited
52
Legal Disclaimer © 2009 Research In Motion Limited. All rights reserved. BlackBerry®, RIM®, Research In Motion®, SurePress™ SureType® and related trademarks, names and logos are the property of Research In Motion Limited and are registered and/or used in the U.S. and countries around the world. All other trademarks are the property of their respective owners. This documentation is provided "AS IS" and without condition, endorsement, guarantee, representation or warranty, or liability of any kind by Research In Motion Limited and its affiliated companies, all of which are expressly disclaimed to the maximum extent permitted by applicable law in your jurisdiction.
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.