BlackBerry Java APIs

Download Report

Transcript BlackBerry Java APIs

Introduction to Developing Wireless
Applications for BlackBerry Handhelds
Thank You
Reminder:
• Please be sure to complete your
session evaluation forms and place
them in the box outside the room. We
appreciate your feedback.
Research In Motion
(RIM)
•
•
•
•
Founded in 1984
First wireless data developer in NA – 1988
First wireless data handheld shipped in 1997
BlackBerry wireless handheld launched in January 1999
– Mobitex and DataTAC wireless paging networks
– Two-way, packet switched, push-based email
– Integration with Microsoft® Exchange and Lotus™ Domino®
• BlackBerry extended to 2.5G wireless networks world-wide in
2002
• GSM/GPRS, CDMA 1X, iDEN
• Voice & Data Converged handheld
BlackBerry Solution
• Leading wireless email solution for mobile professionals
• More than just a handheld PDA
–
–
–
–
Wireless handheld
Desktop software
Enterprise server software
Wireless network service (airtime) & Enterprise connectivity
• True end-to-end solution for the enterprise to increase
productivity and provide wireless access to critical
corporate data anytime, anywhere
BlackBerry Handhelds
for 2.5G Wireless
Networks
• Wireless Email
– Integrated with existing corporate systems
– End-to-end Triple-DES encryption
– PUSH
• Personal Information Management (PIM)
– Contacts, Calendar, Tasks, Memo Pad
• Cellular Phone
– GSM phone
– SMS text messaging with other GSM devices
• Web Browser
– BlackBerry Browser developed by RIM
• Open Java development platform
BlackBerry Handhelds
for 2.5G Wireless
Networks
• All BlackBerry handhelds on GPRS, CDMA
1X, and iDEN networks are based on a Java 2,
Micro Edition (J2ME) Operating Environment
• All BlackBerry applications (Email, Phone,
Calendar, etc.) are written in Java!
BlackBerry Handhelds for
2.5G Wireless Networks
• Application developers can leverage:
– Java SDK to develop a custom client application
– BlackBerry handheld browser for browserbased applications
– 2.5G wireless networks
– HTTP connectivity to the enterprise customer’s
Corporate Intranet or the public Internet
– BlackBerry end-to-end security and PUSH
capabilities for enterprise applications
BlackBerry Wireless Data
Platform for the
Enterprise
Email
Server
GPRS
HTTP(S)
iDEN
BlackBerry
Enterprise Server
Corporate
Network
Application
& Web Servers
Firewall
CDMA 1X
End-to-end 3DES Encryption for ALL data
Pull & Push Capability for ALL Data
HTTP(S) Access to Servers on intranet
for browser and J2ME applications
BlackBerry Wireless Data
Platform for the
Enterprise
• Applications can utilize the BlackBerry Enterprise Server’s
Mobile Data Service (MDS) feature to securely establish
HTTP connections behind the corporate firewall
–
–
–
–
Allows the reuse of the existing wireless connections
Secure, available pipe for browser or custom application data
Supports pull- and push-based content
BlackBerry appears as a standard client on the intranet, just like a PC!
• MDS is an open gateway that can be used by:
– BlackBerry Browser
– Custom J2ME Applications developed by the Enterprise
– 3rd Party ISV/SI Solutions
Leveraging the Platform:
Toolsets Available
• Browser / Server Model
– Client = BlackBerry Browser
– Prosumer & Hosted Applications
• Browser connects directly to the Internet via wireless gateway
• Data content is hosted by 3rd Party on Internet
– Enterprise Applications
• Browser connects to corporate intranet via BlackBerry Enterprise Server
• Corporate data content is hosted by the end customer behind the firewall,
and formatted as WML/HTML pages
• Data can also be pushed to the handheld for pro-active updates
Leveraging the Platform:
Toolsets Available
• Custom Client / Server Model
– Client = Custom Java Application on BlackBerry Handheld
– Prosumer Applications
• Application connects to the Internet/intranet via the BlackBerry
Enterprise Server or a Carrier-hosted gateway
• Data content is hosted by 3rd Party on Internet/intranet
– Enterprise Applications
• Application connects to corporate intranet via BlackBerry Enterprise
Server
• Corporate data content is hosted by the end customer behind the firewall,
can be formatted in any way (Plain Text, XML, etc.)
• Data can also be pushed to the handheld for pro-active updates
Leveraging the Platform:
Summary
• Browser-Based Solutions
– Development
• Simpler and cheaper to develop & deploy
• Develop server-side code only, Based on familiar web technologies
– Limitations
• Useless when out of coverage
• Navigating through web pages can be tedious and slow
• Java Client-Based Solutions
– Development
• Java 2, Micro Edition (including BlackBerry-specific APIs)
• Customizable user interface and application behavior
• Persistent data storage, useful out of coverage and quicker access to data
– Limitations
• Resource-intensive development and testing required
Developing Browser-Based
Solutions for BlackBerry
BlackBerry Browser
Development
• Client is the BlackBerry Browser
– Standard “web page-based” user interface and navigation
– Able to display data formatted in standard mark-up
• WML 1.3, WML Script 1.2
• WBMP, PNG, GIF image types
• cHTML (subset of HTML)
– Support for Pull- and Push-based Content (depends on gateway being
used!!)
BlackBerry Browser:
Server-Side Development
• Can use any standard tools to publish the content on Internet
or intranet web servers
– Static Content:
• cHTML or WML pages
– Dynamic Content:
• Java Server Pages (JSPs) or Active Server Pages (ASPs)
• Perl Script
• Enterprise customers running BlackBerry Enterprise Server
can also write server-side PUSH applications
BlackBerry Browser:
PUSH
• BlackBerry-defined push types:
– “Channel Push”
• Push an icon to the ribbon along with a web page to the cache
• The icon acts as a permanent ‘channel’ to the referenced URL
– “Message Push”
• Push a message to the users inbox that automatically launches the
browser to a specified page (cached or not)
– “Cache Push”
• Push a page to the browser’s cache, but do not notify the user
BlackBerry Browser:
PUSH
Pushing a Web Page:
Server App:
Message
Push:
Channel
Push:
URL = “http://myBesServer.myCo.net:8300/[email protected]&PORT=7874”;
myHttpConnection.setRequestProperty("x-rim-push-type", “browser-message”);
myHttpConnection.setRequestProperty(“content-location", “http://localhost/mySfa/inventory.wml”);
Developing J2ME Applications
for BlackBerry
BlackBerry Java
Development
• In a custom client/server solution, the client is a custom
BlackBerry Java application, compiled with the BlackBerry
JDE
• BlackBerry JDE v3.2.1
–
–
–
–
Released in 2002
Based on Java 2, Micro Edition: MIDP & CLDC 1.0
Full featured IDE with Simulators & Optimization tools
Includes BlackBerry Java API extensions
•
•
•
•
Robust & customizable User Interface APIs
System Interfaces (Trackwheel, Event listeners, etc.)
Extended Utilities
Support for PUSH-based wireless applications
BlackBerry Java APIs:
CLDC & MIDP
The standard J2ME API libraries include:
javax.microedition.lcdui
User interface library (Screens, Fields, etc.)
javax.microedition.rms
Record Management System (data storage)
java.io
Standard java input/output library
java.lang
Standard java extended language library
java.util
Standard java utilities library
javax.microedition.io
J2ME-specific input/output library (HttpConnection)
BlackBerry Java APIs:
RIM Extensions
BlackBerry Java API Extensions:
net.rim.device.api.system
BlackBerry system-level library (Event Listeners, Radio Info)
net.rim.device.api.ui
Fundamental user interface library (Screen Managers, Fields)
net.rim.device.api.ui.container
UI objects that contain other elements (MainScreen, PopupScreen)
net.rim.device.api.ui.component
UI objects that reside within a container (EditField, ListField)
net.rim.device.api.util
Extended utilities library
net.rim.device.api.i18n
Internationalization support (enables support for multiple languages)
J2ME Environment for
BlackBerry
Java Applications
APIs for BlackBerry
(UI, System, Utilities, etc.)
J2ME APIs
(MIDP & CLDC)
Java Virtual Machine
BlackBerry Handheld (Radio, LCD, RAM, Keyboard etc.)
RIM Integrated Development Environment
Workspace view
Full Featured
Editor
Class Browser
Powerful Debugger
Comprehensive debug views
Code Profiler
Coverage Analysis
Expressions and
Variables
Conditional Breakpoints
BlackBerry JDE:
Simulators
1) Handheld
2) MDS
3) Radio
BlackBerry Java
Application Example
Sample Expense
Reporting Application:
List of Current Expenses
Local list of Reports
Customized form for efficient
data entry
HTTP(S)
Wireless
BlackBerry Server
Submit Report Wirelessly
ODBC/API
Servlet / Web App
Expense System
Java Development for
BlackBerry: Tips & Tricks
• Use wireless resources effectively
– Optimize data for transport
– Use PUSH and Always-On technology to your
advantage
– “Streaming” data is not yet practical (for the network
OR the pocket-book!!)
• Forms applications can be built as browser-based
solutions or custom Java applications
– Browser pages are easy to develop for custom
corporate solutions
– Local Java app enables optimized control of user
interface, data storage, and wireless transport
Java Development for
BlackBerry: Tips & Tricks
• Wireless Enterprise Solutions
– Understand what corporate data makes sense on
a wireless handheld
– Sort, filter, and analyze data on the server as
much as possible
Thank You for Attending!