38
v0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

  • View
    216

  • Download
    0

Embed Size (px)

Citation preview

Page 1: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

v0.01© 2009 Research In Motion Limited

Push technology for Java applications

Trainer name

Date

Page 2: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

736-01827-123 © 2009 Research In Motion Limited

Revision history

Document version Date Updated by Description of revision

0.1 Angela-Jo Griffin Initial content creation

Page 3: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

© 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 applicationAPI application programming interface

Page 4: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

Push technology for Java applications

Page 5: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

© 2009 Research In Motion Limited

Introduction to push technology for Java applications

Objectives:

– Describe push technology

– Describe client/server push Java applications for a mobile device such as a BlackBerry smartphone

– List and explain the advantages and disadvantages of push technology for mobile devices

– Write a basic client/server push Java application for a mobile device such as a BlackBerry smartphone

Page 6: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

Introducing push technology

Page 7: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

© 2009 Research In Motion Limited

Introducing push technology

Push technology:

– The ability to proactively deliver, or push, data to BlackBerry smartphones

Page 8: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

© 2009 Research In Motion Limited

Introducing push technology

Push applications for the BlackBerry® Enterprise Server:

– Use the BlackBerry MDS Connection Service component of the BlackBerry Enterprise Server to deliver data or web content directly to any BlackBerry smartphone

– Users do not need to request or download data

– The push application, in conjunction with the BlackBerry MDS Connection Service, delivers the data as soon as it is available

Page 9: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

Introducing push technology

Two applications are required to push data to a BlackBerry smartphone:

– Server-side push application that submits the push request

– Client-side listener application that listens for incoming push messages

Page 10: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

Introducing push technology

Server-side push application:

– Designed to send HTTP POST requests to the BlackBerry MDS Connection Service on the web server listen port

– The HTTP POST requests contain delivery parameters and the data to be pushed

– The BlackBerry MDS Connection Service then delivers the data to a specified port number on the BlackBerry smartphones within a specified time frame

HTTP Hypertext Transfer Protocol

MDS Mobile Data System

Page 11: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

Introducing push technology

Client-side listener application:

– Listens for data to be delivered to its specific port number

– You can create a custom BlackBerry MDS Java Application designed to listen for and handle pushed data

– You can push web content to the BlackBerry® Browser

– The BlackBerry Browser has an integrated listener thread

Page 12: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

© 2009 Research In Motion Limited

Introducing push technology

The BlackBerry MDS Connection Service:

– Manages the flow of pushed data from various push applications

– Sends the data to the BlackBerry smartphone using the same encrypted channel that is used for data communication between the BlackBerry smartphone and the BlackBerry Enterprise Server

– Pushes data to individual users or to user groups

Page 13: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

Client/server push application

Page 14: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

© 2009 Research In Motion Limited

Client/server push application

Client/server push applications:

– Consist of a custom client BlackBerry smartphone application and a server-side application

– Push content to the client BlackBerry smartphone

– Provide more control than browser push applications

– Provide more flexibility regarding the type of data sent and how the BlackBerry smartphone processes and displays the data

Page 15: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

© 2009 Research In Motion Limited

Client/server push application

Advantages:

– Store data on the BlackBerry smartphone

– Make network connections based on the information that comes in

– Integrate the data with BlackBerry applications

Page 16: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

© 2009 Research In Motion Limited

Client/server push application

Server-side push applications:

– Make requests to the BlackBerry MDS Connection Service to push data to specified BlackBerry smartphone users

Requests include push delivery parameters that:

– Uniquely identify the push request

– Inform the BlackBerry MDS Connection Service which BlackBerry smartphones to send the data to

– Provide additional delivery information, such as the priority and the reliability level of the push request

Page 17: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

© 2009 Research In Motion Limited

Client/server push application

Supported push formats:

– PAP push format

– RIM® push formats

PAP Push Access Protocol

RIM Research In Motion

Page 18: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

© 2009 Research In Motion Limited

Client/server push application

PAP push format:

– Sends an HTTP POST request to the BlackBerry MDS Connection Service.

– The request contains a MIME multipart message that includes two components

• An XML-based PAP control entity that defines the delivery parameters

• The data to be pushed

– The PAP push format is an open standard developed by the Open Mobile Alliance. MIME Multipurpose Internet Mail

Extensions

XML Extensible Markup Language

Page 19: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

© 2009 Research In Motion Limited

Client/server push application

RIM push format:

– Sends an HTTP POST request to the BlackBerry MDS Connection Service

– Pushes content as a byte stream

– The destination port is specified within the URL of the pushed content, and the destination users and other delivery parameters are specified in HTTP headers included with the request

– Is a proprietary push format supported exclusively by the BlackBerry MDS Connection Service and BlackBerry smartphone

URL Uniform Resource Locator

Page 20: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

© 2009 Research In Motion Limited

Client/server push application

A push request consists of:

– The data to be pushed

– A set of delivery parameters

Page 21: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

© 2009 Research In Motion Limited

Client/server push application

Both the PAP push and RIM push formats support the following features:

– Reliable push requests

– Deliver-Before time stamp

– Deliver-After time stamp

Page 22: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

© 2009 Research In Motion Limited

Client/server push application

PAP push service also supports the following features:

– Push cancellation

– Push status query

Page 23: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

© 2009 Research In Motion Limited

Client/server push application

Client-side listener applications

– Client-side listener applications listen for incoming data

– You can create a custom BlackBerry MDS Java Application that contains a listening thread that listens for incoming data on a specified port

– To create a Java-based push application architecture, you must create both the custom client-side application that receives the pushed data and the server-side application that makes the push request

Page 24: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

© 2009 Research In Motion Limited

Client/server push application

Push applications provide a wider range of applications that enhance the BlackBerry experience for BlackBerry smartphone users.

You can use push applications for time- and location-sensitive alerts, such as:

– News and weather

– Banking and stocks

– Medical services

– Sports scores

– Backup notifications

Page 25: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

Advantages and disadvantages of pushtechnology for mobile devices

Page 26: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

© 2009 Research In Motion Limited

Advantages and disadvantages of push technology formobile devices

Advantages:

– Immediacy

– Efficiency

– Reduced latency

– Longer battery life

– Shorter learning curve

Page 27: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

© 2009 Research In Motion Limited

Advantages and disadvantages of push technology formobile devices

Disadvantages:

– Limited format

– No delivery status for individuals within a group address

Page 28: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

Client/server push Java applications

Page 29: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

© 2009 Research In Motion Limited

Client/server push Java applications

Your server-side application can use the PAP push format to send the following three types of requests to the BlackBerry MDS Connection Service:

– Push request

• Permits you to push data to the specified recipients

– Status-query request

• Permits you to query the status of a push request for one or more specified recipients

– Cancellation request

• Permits you to cancel a push request for one or more specified recipients

Page 30: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

© 2009 Research In Motion Limited

Client/server push Java applications

Send the request as an HTTP POST request to the BlackBerry MDS Connection Service.

If the BlackBerry MDS Connection Service is configured to support secure connections, you can use the HTTPS protocol.

The HTTP POST request must use the following format:

POST http://<MDS_CS>:<MDS_CS_port>/pap

<message>

Page 31: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

© 2009 Research In Motion Limited

Client/server push Java applications

To create a PAP push request:

1. Send an HTTP POST request.

2. To push content to multiple recipients using PAP, add multiple address tags to the post request.

3. To push content to a group using PAP, in the recipient addresses part of the push submission, prefix the group name with the $ character.

Page 32: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

© 2009 Research In Motion Limited

Client/server push Java applications

RIM push format:

– Your server-side application can use the RIM push format to send both the data and the delivery parameters to the BlackBerry MDS Connection Service in a single byte stream.

– Send the request as an HTTP POST request to the BlackBerry MDS Connection Service.

– If the BlackBerry MDS Connection Service is configured to support secure connections, you can use the HTTPS protocol.

Page 33: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

© 2009 Research In Motion Limited

Client/server push Java applications

RIM push format:

– The HTTP POST request must use the following format:

POST http://<MDS_CS>:<MDS_CS_port>/push?

DESTINATION=<destination>&PORT=<client_port>&REQUESTURI=<uri>

<headers>

<data>

Page 34: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

© 2009 Research In Motion Limited

Client/server push Java applications

You can create a RIM push request three different ways:

1. To push content to one or multiple BlackBerry smartphone users using a RIM push request, send an HTTP POST request using the following URL format.

http://mdsServer:web server listen port/push?DESTINATION=destination&

PORT=port&REQUESTURI=uri headers content

Page 35: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

© 2009 Research In Motion Limited

Client/server push Java applications

2. To push content to multiple recipients using a RIM push, include multiple DESTINATION parameters in the query string.

http://mds_server:8080/push?DESTINATION=

[email protected]&[email protected]&PORT=7874&REQUESTURI=/

3. To push content to a group using RIM push, in the recipient addresses portion of the push submission, prefix the group name with the $ character.

Page 36: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

© 2009 Research In Motion Limited

Page 37: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

Legal Disclaimer

The following trademarks and/or registered trademarks of Research In Motion are referred to in this presentation:

– BlackBerry®

– Research In Motion® (only include if it appears in the webinar/presentation)

– RIM® (only include if it appears in the webinar/presentation)

The following BlackBerry products are referred to in this presentation: (include all items from the official BlackBerry products list that appear in the webinar/presentation)

– BlackBerry® Internet Service

– BlackBerry® Enterprise Solution

– BlackBerry® Enterprise Server

– BlackBerry® Pearl™ 8100 smartphone

– BlackBerry® Curve™ 8300 smartphone

The following third-party trademarks are referred to in this presentation: (include all third-party products that appear in the webinar/presentation)

– Microsoft® Excel®

– Microsoft® SQL Server®

Please remove any products not mentioned in this presentation and add all mentioned products before completing this presentation. Also, remove any remaining red text.

© 2009 Research In Motion Limited

Page 38: V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date

© 2009 Research In Motion Limited

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.