BREW SDK® Overview Part 1

Transcription

BREW SDK® Overview Part 1
BREW SDK® Overview Part 1
Paul L. Anderson, Author and Lecturer
Anderson Software Group, Inc.
1
What Will We Do?
• BREW SDK Overview – Part 1
– Downloading the BREW SDK
– What’s in the BREW SDK?
– BREW® Documentation
– Example Applications
– BREW Header Files
– Using the Simulator
– Resource Editor
– MIF Editor
– Visual Studio Add-Ins
– BREW API Overview
2
Downloading the BREW SDK
• BREW Website
www.qualcomm.com/brew
• Register as a BREW Developer
– Access to free tools and services
– No cost registration
• Download the appropriate version
– Latest releases as well as previous versions
– Localized versions available
3
BREW SDK Tools Download
BREW SDK Tools
The BREW
MIF Editor
1.
2.
3.
The BREW
Resource
Editor
The BREW
Compressed
Image
Authoring
Tool
s
Utilitie
Some helpful
utility programs
Previously included in BREW SDK download
Separated from BREW SDK in Version 3.0.3
Works with all versions of BREW SDK
4
BREW Tools Overview
BREW SDK
Application
Development
Testing and
Commercialization
BREW Tools
Suite
BREW SDK Tools
Microsoft Visual
Studio® Add-Ins
Device
Environment
5
BREW Development Tools
les
Examp
The BREW
Simulator
Some nifty sample
programs to explore
The BREW
Compressed Image
Authoring Tool
r
Heade
Files
BREW Interface
definitions
The BREW MIF
Editor
s
Utilitie
Some helpful utility
programs
The BREW
Resource Editor
Docs
Helpful, in-depth
documentation
6
What’s in the BREW SDK
The BREW
Simulator
l es
Examp
Some nifty sample
programs to explore
r
Heade
Files
BREW Interface
definitions
Docs
Helpful, in-depth
documentation
7
Examples and Documentation
• Examples
– Small, easy to follow applets complete with source code to
get you started
– These applets illustrate the use of the BREW APIs™ in
working applications
• Documentation
– Complete on-line help files for each of the BREW SDK
components
– User guide that describes each of the sample applications
8
BREW Example Applications
• HelloWorld
• MediaPlayer
• NetDiagnostics
• RoadWarrior
• Whiteboard
les
p
m
a
x
E
Some nifty sample
programs to explore
9
BREW Documentation
• Sample Applications Guide
• API Reference Guide
• BREW Programming Concepts
• BREW SDK User Docs
Docs
Helpful, in-depth
documentation
10
BREW Header Files
• Located in
–
<BREW SDK DIR>/inc
• Header files provide
– The definition of each of the member functions
– Useful documentation
• Notes
– Each BREW interface has associated header file
– Each applet must include the header file of each interface
used by the applet
11
The Simulator*
• Simulates a selected handheld
device, allowing you to load test
applets and classes developed
in the BREW environment
• Different wireless device files
can be loaded easily so that you
can test your applet on many
different devices
• Simulated devices can have
different dimensions, color
capabilities, fonts, keypads,
amounts of available memory,
supported languages, and
other parameters
3.x
New Feature
*In previous versions of the BREW SDK, this was called the BREW Emulator
12
Simulator Overview
Properties Page
Device Interface
Provides the
look and feel of
the chosen
device. Display,
keys memory,
and other
features
simulated here
Easy control of
the settings
controlling the
session,
including
location of MIF
and Applet
directories
Device Details
Page
Navigation Keys
Use these for
navigating the
menus and
running apps
Online device
data sheet,
showing the
configuration
and capabilities
of the device
13
Changing Device for Testing
Choose the
device that
will run your
application.
(You can
change this
later if you like)
14
Application Location Flexibility
Select the
directory that
contains your
application’s
folder. Default
is examples
15
Running the App
Running the
app is just like
running it on a
device
16
Configuration of Events
• Control over applet and MIF location, serial
port emulation and network connectivity
• Emulate many device environment scenarios
including network and battery availability
• Simulate incoming phone calls to check for
appropriate application behavior
• Simulate incoming SMS, BREW-directed SMS
• Emulate incoming GPS data
• For more information, see the BREW SDK User
Docs online help
3.x
New Feature
17
Handset vs. Simulator Differences
• Speed
– Most often, the Simulator will run applications faster than the
real device
– Be sure to run performance tests on the real device at some
point in the development cycle
• Appearance
– Some slight visual differences exist between the Simulator
and the handset
– These include the exact positioning and look of annunciator
icons, as well as branding and aesthetic logos
18
Handset vs. Simulator Differences
• Memory
– The Device Details tab of the Simulator shows available
RAM (heap), stack, and EFS space that is simulated for the
device pack used
– The RAM setting can be changed to allow for a larger RAM
space during testing
– This additional RAM is not available on the device and care
should be taken when changing this setting
19
BREW SDK Tools
• Common tools to all BREW SDK
The BREW
Compressed Image
versions (after BREW 2.1.3)
Authoring Tool
• Separate download from
BREW SDK download page
s
Utilitie
Some helpful utility
programs
The BREW MIF
Editor
The BREW
Resource Editor
20
Parts of a BREW Application
MIF file
Application binary
file
Resource file
Viewed and tested in the
BREW Simulator
21
The Resource Editor
• Features
– Allows you to create external resources used in applications
– Dialogs, strings, images, and binaries
• You can also create controls for applications
– Menus, lists, date selectors, and timers
Resources are useful if you need
to create applications that will
run on a variety of wireless
devices or in different
languages
Resource file
22
MIF Editor
• Use MIF Editor to specify
–
–
–
–
–
Icons for your app used on the phone’s BREW menu
Copyright information
External extensions (libraries) that your application uses
Extensions (libraries) that your application exposes for others to use
Application’s unique ID (Class ID)
The MIF is the application
descriptor, providing an icon,
entry point, and other
application information
MIF file
23
BREW ClassIDs
• What is a ClassID?
– Each BREW application has a unique 32-bit ID that
identifies it anywhere in the world
– IDs are obtained for free from the BREW ClassID Generator
on the Developer Extranet
• How to you use ClassIDs?
– They can be created locally for trial and testing purposes
– That unique ID is then specified in your application’s MIF file
24
How the MIF and the App are Connected
User selects app by choosing icon
on the device provided by the MIF.
The MIF provides the ClassID to the
BREW Application Manager
requesting it to start
MIF
Icon
MIF Editor
Provides the ClassID
in both the .bid file
and the MIF
.bid is generated
either locally or by
the ClassID Generator
.bid
0xABCD1234
0xABCD1234
Source Code
Device
APP
#include the .bid file
and the ClassID is
embedded in the
application
25
BREW Compressed Image (BCI) Authoring Tool
• Allows you to store images
in a compressed form on
the handset
– Compressing the images
greatly reduces the size of
graphic images and increases
the speed at which they can be
loaded by the device
– The BCI Tool provides a means
for compressing and combining
standard Windows BMP, PNG,
JPEG, and JPG files to create
animations on the handset
26
Other BREW Utilities
• BREW 2Bit Tool
– converts 4-bit BMPs to 2-bit BMPs for image editing
• PureVoice™ Converter
– Converts (WAV) files to QUALCOMM PureVoice™ (QCP)
• NMEA Logger Tool
– Reads National Marine Electronics Association (NMEA)
messages from GPS or GNSS device
– GPS or GNSS data can then be simulated on the Simulator
– Live data recorded from a serial connection or from a file
27
BREW Visual Studio Add-Ins
Visual Studio
Add-Ins
Toolbar buttons for quick
access to BREW SDK tools
and creation of makefiles
Quickly and easily compile
your application right from
Visual Studio
28
Visual Studio Add-ins
• Features
– BREW Application Wizard automates the creation of a
BREW applet project
– Easily access each of the BREW SDK tools with custom
toolbar buttons
• Advantages
– Create your makefiles within the Visual Studio environment
– Compile your code for the ARM platform right from
Visual Studio
– Same functionality is available to .NET users
29
BREW API Overview
• Purpose of the BREW APIs
– To standardize the programming environment for portability
to multiple wireless products
– To minimize usage of system resources
– To shield application developers from having to deal directly
with device drivers, telephony, etc.
30
BREW API Reference Guide
• Useful Features
– Supplied with the BREW SDK as a Windows online
help library
– Comprehensive resource for all BREW interfaces, helper
functions, and data structures in hierarchical format
– Provides hyperlinks to related information for easy
navigation
31
API Interface Services
Services
Interfaces
System
IShell
Display and Graphics
IDisplay, IGraphics
Base Class
IBase
Applet
IApplet
Network
IDNS, INetMgr, ISocket,
ISSL
File system
IFileMgr, IFile
Controls (Menu, Date,
Time, Text, Hypertext)
IMenuCtl, IDateCtl,
ITimeCtl, ITextCtl,
IStatic, IHtmlViewer
32
API Interface Services (cont.)
Services
Interfaces
Database Management
IDBMgr, IDatabase,
IDBRecord
OEM Database
Management
IAddrBook, IAddrRec,
IRingerMgr
Tones and Sounds
ISound, ISoundPlayer
Media
IMedia, IMediaUtil
Dialog Controls
IDialog
Notification
INotifier
Image Drawing and
Animation
IBitmap, IDIB, IImage,
ISprite
33
API Interface Services (cont.)
Services
Interfaces
Web access
IWeb, IWebResp,
IWebUtil
Encryption
IRSA, ICipher
Data Hashing
IHash
Read/Readable Data
ISource, ISourceUtil,
IPeek, IGetLine
Geographic Location
IPosDet
Standard C Library
Functions
AEE Helper Functions
34
BREW API Data Structures
• How they are used
– Define format and content of application data passed to
BREW API functions and received by applications as output
from functions
– Type definitions are contained in BREW header files
shipped with BREW SDK
– Most are specific to a particular BREW interface
– Widely used data structures are found in AEE.h
35
API Data Structure Types
• Structures and unions
– Example: IGraphics shape-drawing functions
• Enumerated types
– Example: font types supported by IDisplay text-drawing
functions
• Constants
– Example: BREW menu, time, text and static text controls all
have a 32-bit variable used to store control properties, with
one bit per property
36
API Helper Functions
• How they are used
– String and utility functions, many others
– Subset of standard ANSI C library functions
– Applications must not invoke standard C or Windows
libraries
– Applications can call helper functions directly – no interface
pointer required
37
API Helper Functions
• Benefits
– Eliminate unnecessary linkage with standard C library for
less baggage
– Eliminate unnecessary static data in dynamic applications
thus making application portable
• Example
void *MEMCPY(void *dest, const void *src,
size_t count);
– Provides same functionality as memcpy() function in
standard C library; copies count bytes from src to dest
and returns a pointer to its first argument
38
To Be Continued
• Contact Info
– Anderson Software Group, Inc.
– Voice: 760.436.9163
– Email: [email protected]
– Website: www.asgteach.com
– C++ Textbook
• Questions/Answers
39