Beginning BlackBerry 7



Similar documents
Practical Android Projects Lucas Jordan Pieter Greyling

ITG Software Engineering

Java 7 Recipes. Freddy Guime. vk» (,\['«** g!p#« Carl Dea. Josh Juneau. John O'Conner

Software Development Environment. Installation Guide

BlackBerry Smartphone Application Development

Developer's Cookbook. Building Applications with. The Android. the Android SDK. A Addison-Wesley. James Steele Nelson To

Tutorial: BlackBerry Object API Application Development. Sybase Unwired Platform 2.2 SP04

Beginning Nokia Apps. Development. Qt and HTIVIL5 for Symbian and MeeGo. Ray Rischpater. Apress. Daniel Zucker

Mobility Introduction Android. Duration 16 Working days Start Date 1 st Oct 2013

Module Title: Software Development A: Mobile Application Development

«compl*tc IDIOT'S GUIDE. Android App. Development. by Christopher Froehlich ALPHA. A member of Penguin Group (USA) Inc.

Table of Contents. Adding Build Targets to the SDK 8 The Android Developer Tools (ADT) Plug-in for Eclipse 9

Wiley Publishing, Inc.

Introduction to BlackBerry Development using Java ME. Presented by: Sean Fenton Technical Channel Manager RIM (Research in Motion )

Getting Started with Android Programming (5 days) with Android 4.3 Jelly Bean

INTRODUCTION TO ANDROID CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 11 02/15/2011

Tutorial: BlackBerry Application Development. Sybase Unwired Platform 2.0

Mobile App Design and Development

Android Setup Phase 2

Introduction to BlackBerry Smartphone Web Development Widgets

Developing Applications for ios

Challenges in Android Application Development: A Case Study

SmallBiz Dynamic Theme User Guide

Introduction to Android

An Introduction to Android

An Introduction to Android Application Development. Serdar Akın, Haluk Tüfekçi

HYBRID APPLICATION DEVELOPMENT IN PHONEGAP USING UI TOOLKITS

Cisco Jabber IM for BlackBerry Stay connected while mobile

INTERMEDIATE ANDROID DEVELOPMENT Course Syllabus

For keyboard and touchscreen BlackBerry devices User manual

NOKIA E52 PHONE TRACKING SOFTWARE

-Android 2.3 is the most used version of Android on the market today with almost 60% of all Android devices running 2.3 Gingerbread -Winner of

4 Application Development

Introduction to Android Development. Ed Burnette

ECWM511 MOBILE APPLICATION DEVELOPMENT Lecture 1: Introduction to Android

Mobile Phones Operating Systems

Professional Tizen Application Development

Android Application Development

Running Android Applications on BlackBerry 10 developer.blackberry.com/android

Mesa DMS. Once you access the Mesa Document Management link, you will see the following Mesa DMS - Microsoft Internet Explorer" window:

Android Mobile App Building Tutorial

Development of Java ME

An Introduction to Android. Huang Xuguang Database Lab. Inha University

A70 How to Deploy Applications

Developing Android Apps with the ArcGIS Runtime SDK for Android. Dan

Beginning Android 4. Games Development. Mario Zechner. Robert Green

Practical Eclipse Rich Client Platform Projects

Active Directory Integration for Greentree

Java Platform, Micro Edition (Java ME) Mokoena F.R. The 7046 Team

About this Release. Introduction. Prerequisites. Installation. Using the Web SDK Packager

Quick Start Guide Mobile Entrée 4

Running a Program on an AVD

COURSE CONTENT. GETTING STARTED Select Android Version Create RUN Configuration Create Your First Android Activity List of basic sample programs

Issues of Hybrid Mobile Application Development with PhoneGap: a Case Study of Insurance Mobile Application

Android Programming and Security

COMSOL Server. Manual

Android Application Development

TIBCO Runtime Agent Authentication API User s Guide. Software Release November 2012

SAIP 2012 Performance Engineering

Android in Action. Second Edition. Revised Edition of Unlocking Android MANNING. (74 w. long.) W. FRANK ABLESON CHRIS KING ROBI SEN.

Startup Guide. Version 2.3.9

A Modular Approach to Teaching Mobile APPS Development

IOIO for Android Beginners Guide Introduction

Generate Android App

ANDROID INTRODUCTION TO ANDROID

Advanced Java Application Development for the BlackBerry Smartphone. BlackBerry Academic Program

If your organization is not already

CHAPTER 1: INTRODUCTION TO ANDROID, MOBILE DEVICES, AND THE MARKETPLACE

1. Right click using your mouse on the desktop and select New Shortcut.

Overview of CS 282 & Android

COMSOL Server. Manual

Quick Start Guide. Installation and Setup

Appendix A How to create a data-sharing lab

Google Android Syllabus

Lecture 3 Mobile App Development (Android, ios, BlackBerry, Windows Mobile) <lecturer, date>

Also on the Performance tab, you will find a button labeled Resource Monitor. You can invoke Resource Monitor for additional analysis of the system.

TIBCO Runtime Agent Domain Utility User s Guide Software Release November 2012

1. Introduction to Android

Download and Installation Instructions for. Kindle Downloadable ebooks for BlackBerry.

Labtech ClassRoom21 Educator. Windows Installation Guide. Standard Version 1.0

Android Basics. Xin Yang

Guide to SAS/AF Applications Development

Develop Mobile Applications. with. Instant Developer

Mobile Print/Scan Guide for Brother iprint&scan

Using SQL Developer. Copyright 2008, Oracle. All rights reserved.

Android Development Tutorial. Nikhil Yadav CSE40816/ Pervasive Health Fall 2011

Installation Instructions for SAP GUI for Java 7.2

NVIDIA CUDA GETTING STARTED GUIDE FOR MAC OS X

CRESTRON-APP/CRESTRON-APP-PAD Control App for Apple ios

TIBCO Fulfillment Provisioning Session Layer for FTP Installation

Software Development Kit for ios and Android

FreeForm Designer. Phone: Fax: POB 8792, Natanya, Israel Document2

Android Application Development - Exam Sample

Welcome to our marketing solution

Mocean Android SDK Developer Guide

Learning Management System (LMS) User Guide Contents

Transcription:

Beginning BlackBerry 7 Development Robert Kao Dante Sarigumba With Anthony Rizk and Kevin Michaluk Apress*

Contents Contents at a Glance About the Authors About the Technical Reviewer Acknowledgments iv x xi xii Chapter 1: Setting the Stage 1 What This Book Is 1 What You Need to Know Before You Can Begin 2 Setting Up Your Development Environment 2 Installing the Development Environment 3 Getting Code Signing Keys 8 What's Different About Developing for BlackBerry 11 Limited CPU and Memory 11 Java As the Native API 11 Limited Screen Real Estate 12 User Input 12 Many Different Devices 12 What's in This Book 12 Chapter 2 12 Chapter 3 13 Chapter 4 13 Chapter 5 13 Chapter 6 13 Chapter 7 13 Chapter 8 Chapter 9 Chapter 10 Summary Chapter 2: Hello World 15 Creating an Application with the BlackBerry JDE Plug-In for Eclipse 15 Creating the Project 16 Creating the Application Classes 18 Basic GUI Fields Explained 13 13 14 14 22 V

i CONTENTS Running the Simulator 22 Building with Different JDE Versions 28 Packaging and Signing Your Application 29 Debugging on a Device 30 Polishing the Application 31 Setting the Title in the BlackBerry Application Descriptor 31 Creating an Icon 32 Seeing It All in Action 33 Summary 33 Chapter 3: What Makes a BlackBerry Application? 35 Javadocs 35 The BlackBerry Application Life Cycle 37 Starting the Application 37 Creating the Application 37 Invoking the Event Thread 38 Processing Events 38 Exiting the Application 38 Threading and the Event Thread 38 Knowing When Your Application Is on the Event Thread 39 Updating the Ul from Other Threads 39 Running Background Applications 42 Detecting Backgrounding or Foregrounding 42 Sending Your Application to the Background 43 Understanding the Types of Projects 44 Libraries 44 Creating an Alternate Entry Point 46 MIDP and MIDIet Projects 48 Summary 48 Chapter 4: User Interface Basics 49 The Ul Fun Application 49 The Components of a BlackBerry Ul 50 Creating the Application 51 Adding the Logo Image 52 Adding a Few More Fields 55 Handling User Interaction 59 Handling Ul Events 59 Handling the Clear Button 60 Handling the Login Button 62 Creating Menus 64 Understanding Menu Items 64 Implementing the Login and Clear Menu Items 65 Displaying Images 69 Summary 73 I Chapter 5: Beyond the Basics of User Interfaces 75 Enhancing the Ul Fun Application 75 Working with Fonts 77 Drawing to the Screen Using the Graphics Context 79 Vl

ii CONTENTS Using the Paint Method 79 Understanding How the BlackBerry Screen Is Drawn 80 Creating Custom Fields 82 Adding a Custom Label Field 82 Creating a Custom Button Field 90 A Review of Custom Fields 97 Creating Custom Managers 97 Creating a Manager 100 Tidying Up the Login Success Screen 107 Creating a Custom Screen 109 Delegate Managers 110 Implementing the Screen's Sublayout Method 110 Adding a Few Fields 112 Painting the Background 113 Adding the Final Touches 114 Adding a Header Background 114 Making Minor Tweaks 116 Working with Touch Screen Models 117 Creating Basic Animation 119 Setting the Vertical Offset 119 Animating the Layout 120 Summary 122 Chapter 6: Storing and Searching Data 123 Storing Data on the BlackBerry 123 Choices for Persistence 124 RMS 124 Persistent Store 124 Runtime Store 124 JSR 75 FileConnection 125 SQLite 125 BlackBerry Persistent Store 125 Persistent Store Keys 126 Persistent Objects 126 What Can You Persist? 127 The Persistable Application 128 More Advanced Persistence 132 Clearing Persistent Data from a Device 135 The FileConnection API 136 Basic Application Framework 136 Opening a File Connection 138 Listing the Directory Contents 139 Viewing Pictures 141 The Image Display Screen 141 Loading Images from the File System 142 Getting Images into the Simulator 142 Scaling the Image 144 Writing to the File System 145 A Dynamic Menu Item 146 vii

5CONTENTS The File Name Screen 147 Copying the File 148 Using SQLite 150 Creating a Database and a Table 150 Inserting Records 151 Querying Tables 151 SQLite Sample Application 151 Integrating Your App with Unified Search 157 Summary 167 Chapter 7: Hello Out There! Making a Network-Enabled Application 169 Different Ways to Connect 169 BES/MDS 170 Direct TCP/IP 171 BIS 172 Wi-Fi 172 WAP 2.0 172 WAP 1.0 173 Short-Range Communication 173 Recommendation 173 Service Book 174 The MIDP Connection Framework 175 Connector 175 Connections 175 HTTP Basics 176 The Test Web Application 177 The Networking Application 177 Some Controls 178 Making an HTTP Connection 179 The HttpRequestDispatcher Class 179 Testing It 182 Two-Way Interaction: Sending Data via HTTP POST 187 Connection Method: Using Direct TCP/IP Instead of BES/MDS 192 Making a Connection Using WAP 2.0 192 Making a Connection Using BIS 193 Making a Wi-Fi Connection 194 Determining Network Availability 194 Using Coveragelnfo 194 Using WLANInfo 195 Putting It All Together 195 TCP Socket Connections 196 Summary 198 ' Chapter 8: Where Am I? Using Location-Based Services 201 GPS Support on BlackBerry Devices 201 Getting Location Information 202 Getting Location Information Using JSR 179 APIs and the BlackBerry Extensions to JSR179 202 GPS Modes 203 Specifying a GPS Mode Using JSR 179 204 Vlli

CONTENTS Specifying a GPS Mode Using the BlackBerry Extensions to JSR 179 205 The Location Application 207 Getting Periodic Location Updates Using LocationListener 211 Using Geocoding and Reverse Geocoding 214 Geocoding: Getting Coordinates from an Address 215 Using BlackBerry Maps 216 The Invoke API 216 Launching the Default BlackBerry Maps View 217 Location Documents 218 Displaying a Custom Map View 220 MapField: Embedding BlackBerry Maps in Your Ul 221 Summary 223 Chapter 9: Getting Your App Out There: Packaging and Publishing 225 Setting Application Properties 226 Over-the-Air Installation 226 Sibling COD Files 227 The JAD File 228 Content Types (MIME Types) 228 Uploading Your Application 229 Downloading the Application 229 Desktop Installation 230 The ALX File 230 BlackBerry App World 232 Getting an App World Account 233 Distributing Your Application on App World 234 Implementing License Keys 235 Pricing 236 The Submission Process 236 App World API 240 In-App Purchase 241 Other Application Stores 244 MobiHand 244 Other Sites 247 Summary 247 Chapter 10: Next Steps 249 Keeping Current 249 Forums 250 BlackBerry Conferences 250 OpenGL on the BlackBerry 250 Newsletters, Blogs, and Other Resources 250 Farewell 251 Index 253 ix