Difference between revisions of "BlackBerry Concepts"

From CDOT Wiki
Jump to: navigation, search
(BlackBerry Development Environment using Eclipse IDE)
(UI)
Line 79: Line 79:
  
 
|}
 
|}
 +
 +
----------
 +
 +
=== Development Fundamentals ===
 +
 +
{| class="wikitable" border="0" cellpadding="6"
 +
! Steps !! Actions
 +
|-
 +
| [[File:7bb.png|left|600px]] || [http://www.blackberry.com/developers/docs/6.0.0api/index.html?net/rim/device/api/system/Application.html Package net.rim.device.api.ui ]
 +
 +
Provides fundamental functionality for constructing the user interface of a RIM Device application.
 +
 +
The members of this package are all abstract classes or interfaces
 +
 +
They are not intended for direct instantiation.
 +
 +
You should rather use (or extend) the classes in '''''net.rim.device.api.ui.component''''' and '''''net.rim.device.api.ui.container'''''.
 +
 +
 +
|-
 +
|-
 +
| [[File:ui_basic_arch.png|left|600px]] || There are three main UI primitives:
 +
* [http://www.blackberry.com/developers/docs/6.0.0api/net/rim/device/api/ui/Field.html Field]
 +
* http://www.blackberry.com/developers/docs/6.0.0api/net/rim/device/api/ui/Manager.html Manager]
 +
* [http://www.blackberry.com/developers/docs/6.0.0api/net/rim/device/api/ui/Screen.html Screen]
 +
 +
|-
 +
| [[File:6bb.png|left|600px]] || [http://www.blackberry.com/developers/docs/6.0.0api/net/rim/device/api/ui/UiApplication.html UiApplication]
 +
 +
Base class for all device applications that provide a user interface.
 +
 +
* A UI application maintains a stack of Screen objects.
 +
As it pushes screens onto the stack, it draws them on top of any other screens already on the stack.
 +
When the application pops a screen off the stack,
 +
it redraws the underlying screens as necessary.
 +
Only the screen on the top of the stack receives input events.
 +
 +
* Each screen may appear only once in the display stack.
 +
The application throws a runtime exception
 +
if you attempt to push a single screen onto the stack more than once.
 +
 +
Note that a UI application must follow rules similar
 +
to those of traditional Swing applications.
 +
 +
|}
 +
 +
----------

Revision as of 09:17, 22 February 2011


BlackBerry Development Environment using Eclipse IDE

This is a practical introduction to build BlackBerry applications.

(modified based on Alan Wong - January 13, 2011 presentation).


Steps Actions
1bb.png
The steps to install, configure and check your installation are defined at: Install, Configuration, Check
2bb.png
One can download the software for developing BlackBerry applications using Eclipse from: BlackBerry Java Plug-in for Eclipse

Note: You have to register as a developer prior to downloading process

3bb.png
The goals of the Project is to create an Application that:
  • run the application by adding it to the event dispatcher
  • create a Screen and push it onto the Screen stack
  • specify the title of a Screen
  • display text on the screen using a RichTextField
  • display a dialog box when the user closes the application

Configuring the Project

Steps Actions
4bb.png
<Properties ModelVersion="1.1.2">
  <General Title="Hello World Demo" Version="0.9" Vendor="Research In Motion Ltd." Description=""/>
  <Application Type="BlackBerry Application" MainMIDletName="" MainArgs="" HomeScreenPosition="0" StartupTier="7" IsSystemModule="false" IsAutostartup="false"/>
  <Resources hasTitleResource="false" TitleResourceBundleName="" TitleResourceBundleRelativePath="" TitleResourceBundleClassName="" TitleResourceBundleKey="" DescriptionId="">
    <Icons>
      <Icon CanonicalFileName="res\img\helloworld_jde.png" IsFocus="false"/>
    </Icons>
  </Resources>
  <Compile OutputCompilerMessages="false" ConvertImages="true" CreateWarningForNoExportedRoutine="true" CompressResources="false">
    <PreprocessorDefines/>
  </Compile>
  <Packaging OutputFileName="HelloWorldDemo" OutputFolder="deliverables" PreBuildStep="" PostBuildStep="" CleanStep="" GenerateALXFile="true">
    <AlxFiles/>
  </Packaging>
  <HiddenProperties>
    <ClassProtection/>
    <PackageProtection/>
  </HiddenProperties>
  <AlternateEntryPoints/>
</Properties>
5bb.png
This class extends the UiApplication class, providing a graphical user interface.
6bb.png
UiApplication

Base class for all device applications that provide a user interface.

  • A UI application maintains a stack of Screen objects.

As it pushes screens onto the stack, it draws them on top of any other screens already on the stack. When the application pops a screen off the stack, it redraws the underlying screens as necessary. Only the screen on the top of the stack receives input events.

  • Each screen may appear only once in the display stack.

The application throws a runtime exception if you attempt to push a single screen onto the stack more than once.

Note that a UI application must follow rules similar to those of traditional Swing applications.


Development Fundamentals

Steps Actions
7bb.png
Package net.rim.device.api.ui

Provides fundamental functionality for constructing the user interface of a RIM Device application.

The members of this package are all abstract classes or interfaces

They are not intended for direct instantiation.

You should rather use (or extend) the classes in net.rim.device.api.ui.component and net.rim.device.api.ui.container.


Ui basic arch.png
There are three main UI primitives:
6bb.png
UiApplication

Base class for all device applications that provide a user interface.

  • A UI application maintains a stack of Screen objects.

As it pushes screens onto the stack, it draws them on top of any other screens already on the stack. When the application pops a screen off the stack, it redraws the underlying screens as necessary. Only the screen on the top of the stack receives input events.

  • Each screen may appear only once in the display stack.

The application throws a runtime exception if you attempt to push a single screen onto the stack more than once.

Note that a UI application must follow rules similar to those of traditional Swing applications.