没有合适的资源?快使用搜索试试~ 我知道了~
BlackBerry Application Developer Guide Volume 1
需积分: 0 2 下载量 173 浏览量
2009-08-10
20:26:58
上传
评论
收藏 5.03MB PDF 举报
温馨提示
试读
174页
BlackBerry Application Developer Guide Volume 1
资源详情
资源评论
资源推荐
BlackBerry Java
Development Environment
Version 4.0
BlackBerry Application Developer Guide
Volume 1: Fundamentals
BlackBerry Java Development Environment Version 4.0 BlackBerry Application Developer Guide Volume 1: Fundamentals
Last modified: 26 November 2004
Part number: SWD_X_JDE(EN)-001.000
At the time of publication, this documentation complies with BlackBerry Java Development Environment Version 4.0.
© 2004 Research In Motion Limited. All rights reserved. The BlackBerry and RIM families of related marks, images and symbols are the exclusive
properties of Research In Motion Limited. RIM, Research In Motion, BlackBerry and 'Always On, Always Connected' are registered with the U.S.
Patent and Trademark Office and may be pending or registered in other countries.
Microsoft, Windows and Outlook are registered trademarks of Microsoft Corporation in the United States and/or other countries. Java and Jini are
trademarks of Sun Microsystems, Inc. in the U.S. and other countries. IBM, Lotus, and Domino are trademarks of International Business Machines
Corporation in the United States. The Bluetooth® word mark and logos are owned by the Bluetooth SIG, Inc. and any use of such marks by Research
In Motion is under license. All other brands, product names, company names, trademarks, and service marks are the properties of their respective
owners.
The handheld and/or associated software are protected by copyright, international treaties and various patents, including one or more of the
following U.S. patents: 6,278,442; 6,271,605; 6,219,694; 6,075,470; 6,073,318; D,445,428; D,433,460; D,416,256. Other patents are registered or
pending in various countries around the world. Please visit www.rim.net/patents.shtml for a current listing of applicable patents.
This document is provided “as is” and Research In Motion Limited (RIM) assumes no responsibility for any typographical, technical, or other
inaccuracies in this document. RIM reserves the right to periodically change information that is contained in this document; however, RIM makes no
commitment to provide any such changes, updates, enhancements, or other additions to this document to you in a timely manner or at all. RIM
MAKES NO REPRESENTATIONS, WARRANTIES, CONDITIONS, OR COVENANTS, EITHER EXPRESS OR IMPLIED (INCLUDING, WITHOUT LIMITATION,
ANY EXPRESS OR IMPLIED WARRANTIES OR CONDITIONS OF FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, MERCHANTABILITY,
DURABILITY, TITLE, OR RELATED TO THE PERFORMANCE OR NON-PERFORMANCE OF ANY SOFTWARE REFERENCED HEREIN, OR PERFORMANCE
OF ANY SERVICES REFERENCED HEREIN). IN CONNECTION WITH YOUR USE OF THIS DOCUMENTATION, NEITHER RIM NOR ITS AFFILIATED
COMPANIES AND THEIR RESPECTIVE DIRECTORS, OFFICERS, EMPLOYEES, OR CONSULTANTS SHALL BE LIABLE TO YOU FOR ANY DAMAGES
WHATSOEVER BE THEY DIRECT, ECONOMIC, COMMERCIAL, SPECIAL, CONSEQUENTIAL, INCIDENTAL, EXEMPLARY, OR INDIRECT DAMAGES,
EVEN IF RIM HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, INCLUDING, WITHOUT LIMITATION, LOSS OF BUSINESS REVENUE OR
EARNINGS, LOST DATA, DAMAGES CAUSED BY DELAYS, LOST PROFITS, OR A FAILURE TO REALIZE EXPECTED SAVINGS.
This document might contain references to third-party sources of information and/or third-party web sites (“Third-Party Information”). RIM does not
control, and is not responsible for, any Third-Party Information, including, without limitation, the content, accuracy, copyright compliance, legality,
decency, links, or any other aspect of Third-Party Information. The inclusion of Third-Party Information in this document does not imply endorsement
by RIM of the third party in any way. Any dealings with third parties, including, without limitation, compliance with applicable licenses, and terms
and conditions are solely between you and the third party. RIM shall not be responsible or liable for any part of such dealings.
Published in Canada
Research In Motion Limited
295 Phillip Street
Waterloo, ON N2L 3W8
Canada
Research In Motion UK Limited
Centrum House, 36 Station Road
Egham, Surrey TW20 9LF
United Kingdom
Contents
BlackBerry APIs...............................................................................................................................................5
Using BlackBerry APIs.....................................................................................................................................................5
Using Java on BlackBerry handhelds .........................................................................................................................8
Application control........................................................................................................................................................ 12
Writing BlackBerry Java applications......................................................................................................14
Application management............................................................................................................................................ 14
Writing a sample application..................................................................................................................................... 14
Reusing common code................................................................................................................................................. 16
Using the IDE.................................................................................................................................................................. 18
Programming guidelines ............................................................................................................................................. 20
Creating user interfaces..............................................................................................................................29
User interface APIs ........................................................................................................................................................29
Displaying UI components ......................................................................................................................................... 29
Managing UI components.......................................................................................................................................... 38
Creating custom UI components.............................................................................................................................. 41
Working with images.................................................................................................................................................... 59
Drawing using graphics objects................................................................................................................................ 62
Listening for changes to UI objects......................................................................................................................... 67
Supporting media content..........................................................................................................................69
PME content .................................................................................................................................................................... 69
Playing media content ................................................................................................................................................. 71
Listening for media engine events........................................................................................................................... 73
Creating custom connections .................................................................................................................................... 79
Connecting to networks..............................................................................................................................82
HTTP and socket connections.................................................................................................................................... 82
Using HTTP connections.............................................................................................................................................. 82
Using HTTPS connections ........................................................................................................................................... 87
Using socket connections............................................................................................................................................ 87
Using port connections................................................................................................................................................ 89
Using Bluetooth serial port connections................................................................................................................ 90
Using datagram connections.....................................................................................................................96
Datagram connections................................................................................................................................................. 96
Using UDP connections............................................................................................................................................... 96
Using Mobitex networks.............................................................................................................................................. 98
Sending and receiving SMS messages................................................................................................................. 105
Localizing applications.............................................................................................................................109
Resource files................................................................................................................................................................ 109
Adding localization support to applications...................................................................................................... 110
Retrieving strings from a resource file................................................................................................................. 113
Managing resource files for application suites................................................................................................. 116
Using IT policies ........................................................................................................................................ 118
IT policies....................................................................................................................................................................... 118
Retrieving IT policy items......................................................................................................................................... 118
Listening for policy changes.................................................................................................................................... 118
Controlling application downloads....................................................................................................................... 119
Code example .............................................................................................................................................................. 119
Creating client/server push applications............................................................................................ 121
Push applications........................................................................................................................................................ 121
Client/server push requests.................................................................................................................................... 121
Writing a client-side push application................................................................................................................. 125
Writing a server-side push application ................................................................................................................ 128
Troubleshooting push applications....................................................................................................................... 132
Packaging and deployment.....................................................................................................................133
Deploying applications using the BlackBerry Desktop Software................................................................ 133
Deploying applications wirelessly ......................................................................................................................... 133
Testing and debugging.............................................................................................................................136
Test applications ......................................................................................................................................................... 136
Using the debugging tools...................................................................................................................................... 141
Appendix A: format of .alx files ............................................................................................................145
.alx files .......................................................................................................................................................................... 145
Elements in .alx files .................................................................................................................................................. 148
Appendix B: Mobile Data Service reference ........................................................................................150
HTTP requests .............................................................................................................................................................. 150
HTTP responses............................................................................................................................................................ 150
HTTPS support ............................................................................................................................................................. 151
Transcoders ................................................................................................................................................................... 152
Creating transcoders.................................................................................................................................................. 157
Compile and install transcoders............................................................................................................................. 160
Glossary.......................................................................................................................................................162
Index.............................................................................................................................................................165
1
BlackBerry APIs
Using BlackBerry APIs
The BlackBerry® Java Development Environment (JDE) provides a complete set of APIs and tools for you
to develop Java™ applications that run on BlackBerry Wireless Handhelds™. Applications developed
using version 4.0 of the JDE run on handhelds running BlackBerry Handheld Software version 3.8 or 4.0.
BlackBerry handhelds include a J2ME runtime environment that is based on the CLDC 1.1 and MIDP 2.0
specifications. BlackBerry API extensions provide additional capabilities and tighter integration with
BlackBerry handhelds.
You can use both CLDC/MIDP APIs and BlackBerry APIs in your application. To enable applications to
run on any JTWI-enabled device, write standard MIDP applications using only the CLDC and MIDP APIs.
BlackBerry handheld software components
To view the
API reference
, on the taskbar, click Start > Programs > Research In Motion > BlackBerry Java
Development Environment 4.0 > API Reference.
BlackBerry APIs
The BlackBerry APIs provide access to BlackBerry features for user interfaces, localization, networking,
and other capabilities.
• Using BlackBerry APIs
• Using Java on BlackBerry handhelds
• Application control
Note: Access to additional APIs for features, such as advanced cryptography, synchronization, and messaging, is restricted.
To use these APIs, you must receive express written permission from an authorized signatory of Research In Motion. See
the
BlackBerry Application Developer Guide
Volume 2: Advanced Topics
for more information
.
剩余173页未读,继续阅读
duxins
- 粉丝: 3
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0