Hacking BlackBerry TQW Darksiderg
Hacking BlackBerry TQW Darksiderg
Hacking BlackBerry TQW Darksiderg
BlackBerry
Glenn Bachmann
Hacking
BlackBerry
Hacking
BlackBerry
Glenn Bachmann
Hacking BlackBerry Published by Wiley Publishing, Inc. 10475 Crosspoint Boulevard Indianapolis, IN 46256
www.wiley.com
Copyright 2007 by Wiley Publishing, Inc., Indianapolis, Indiana Published simultaneously in Canada ISBN-13: 978-0-471-79304-5 ISBN-10: 0-471-79304-3 Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1 No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4355, or online at http://www.wiley.com/go/permissions. Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Website is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Website may provide or recommendations it may make. Further, readers should be aware that Internet Websites listed in this work may have changed or disappeared between when this work was written and when it is read. For general information on our other products and services or to obtain technical support, please contact our Customer Care Department within the U.S. at (800) 762-2974, outside the U.S. at (317) 572-3993 or fax (317) 572-4002. Library of Congress Cataloging-in-Publication Data is available from the publisher. Trademarks: Wiley, the Wiley logo, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may not be used without written permission. ExtremeTech and the ExtremeTech logo are trademarks of Ziff Davis Publishing Holdings, Inc. Used under license. All rights reserved. BlackBerry is a registered trademark of Research In Motion Limited. All other trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book. Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books.
Credits
Executive Editor Chris Webb Development Editor Kelly Talbot Technical Editors Craig Johnston Edward Lineberry Copy Editor Nancy Rapoport Editorial Manager Mary Beth Wakefield Production Manager Tim Tate Vice President and Executive Group Publisher Richard Swadley Vice President and Executive Publisher Joseph B. Wikert Compositor Kate Kaminski, Happenstance Type-O-Rama Proofreader Jen Larsen, Word One Indexer Melanie Belkin Anniversary Logo Design Richard Pacifico Cover Design Anthony Bunyan
Contents at a Glance
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
Part I: Customizing the BlackBerry with Tweaks, Secret Codes, Hidden Keys, and Add-On Applications
Chapter 1: Secret Codes and Hidden Keys . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Chapter 2: Adding Software to Your BlackBerry . . . . . . . . . . . . . . . . . . . . . . 15 Chapter 3: Advanced E-mail, Voice, and Messaging. . . . . . . . . . . . . . . . . . . . . 29 Chapter 4: Unleashing the Wireless Web . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Chapter 5: Using Your BlackBerry as a Wireless Dialup Modem . . . . . . . . . . . . . . 83 Chapter 6: The Ultimate Remote Control: Controlling Your Desktop Computer from Your BlackBerry. . . . . . . . . . . . . . . . . . . . . . . . . 91 Chapter 7: Storage on the Go: Your BlackBerry as a USB Thumb Drive . . . . . . . . . 107 Chapter 8: Keeping Your BlackBerry Safe . . . . . . . . . . . . . . . . . . . . . . . . . 117 Chapter 9: Getting Down to Business: Productivity Tools . . . . . . . . . . . . . . . . . 131 Chapter 10: Beyond BrickBreaker: Fun, Games, and Entertainment . . . . . . . . . . . 147
Part II: Advanced BlackBerry Hacks: Put Your BlackBerry to Fun and Wacky Uses with Creative Software Projects
Chapter 11: Developing Your Own BlackBerry Applications . . . . . . Chapter 12: A Classic Sketcher Application . . . . . . . . . . . . . . . Chapter 13: Music to My Ears: A Toy Piano in the Palm of Your Hand. Chapter 14: Meet BlackBerry, Your Personal Masseuse . . . . . . . . . Chapter 15: Printing Your Notes Wirelessly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 191 207 231 243
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
Contents
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
Part I: Customizing the BlackBerry with Tweaks, Secret Codes, Hidden Keys, and Add-On Applications
Chapter 1: Secret Codes and Hidden Keys . . . . . . . . . . . . . . . . . 3
Locating the Important Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Using Typing Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Accessing System Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 The Help Me! Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 The Event Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 The Signal Strength Display Mode . . . . . . . . . . . . . . . . . . . . . . . 6 Smart System Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Working with the Built-In BlackBerry Applications . . . . . . . . . . . . . . . . . . 8 The BlackBerry Applications Screen. . . . . . . . . . . . . . . . . . . . . . . 8 The BlackBerry Calendar Application . . . . . . . . . . . . . . . . . . . . . 10 The BlackBerry Address Book Application . . . . . . . . . . . . . . . . . . 12 The BlackBerry Calculator Application . . . . . . . . . . . . . . . . . . . . 13 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
xii
Contents
Chapter 3: Advanced E-mail, Voice, and Messaging . . . . . . . . . . . 29
Shortcuts and Hidden Keys in BlackBerry Messaging . . . . Special Keys Used in This Chapter . . . . . . . . . . . Navigating the Messages List . . . . . . . . . . . . . . Filtering the Messages List . . . . . . . . . . . . . . . Navigating Within the Message Viewer . . . . . . . . Composing Messages . . . . . . . . . . . . . . . . . . Replying to and Forwarding Your Messages . . . . . . Keeping Your Messages List Clean . . . . . . . . . . . Customizing Your BlackBerry Signature . . . . . . . . . . . Changing Your Blackberry Signature from the Desktop Using Multiple Signatures . . . . . . . . . . . . . . . Including BlackBerry in Your Signature . . . . . . . . Other Messaging Shortcuts . . . . . . . . . . . . . . . . . . Exchanging Your Contact Information . . . . . . . . . Keyboard Shortcuts for Composing Messages . . . . . Receiving Confirmation of Message Delivery . . . . . Controlling Your Inbox with Filters . . . . . . . . . . . . . . Instant Messaging Applications . . . . . . . . . . . . . . . . WebMessenger Mobile Instant Messenger . . . . . . . Verichat . . . . . . . . . . . . . . . . . . . . . . . . . IM+ Mobile Instant Messenger. . . . . . . . . . . . . BlackBerry Messenger . . . . . . . . . . . . . . . . . About MDS and BES Network Access. . . . . . . . . Using Your BlackBerry with Web-Based Mail . . . . . . . . Googles Gmail . . . . . . . . . . . . . . . . . . . . . Yahoo! Mail . . . . . . . . . . . . . . . . . . . . . . . Hotmail . . . . . . . . . . . . . . . . . . . . . . . . . Outlook Web Access . . . . . . . . . . . . . . . . . . iNotes . . . . . . . . . . . . . . . . . . . . . . . . . . Working with E-mail Attachments . . . . . . . . . . . . . . About the BlackBerry Attachment Viewer . . . . . . . Attachment Viewer Keyboard Shortcuts . . . . . . . . Third-Party Attachment Programs . . . . . . . . . . . Spell Checking Your E-mail . . . . . . . . . . . . . . . . . . Faxing from Your BlackBerry . . . . . . . . . . . . . . . . . Shortcuts and Hidden Keys in the Phone Application . . . . Using Speed Dial . . . . . . . . . . . . . . . . . . . . Dialing from the Home Applications Screen . . . . . . Dialing Using Letters . . . . . . . . . . . . . . . . . . Working with Live Calls . . . . . . . . . . . . . . . . Seeing Missed Calls . . . . . . . . . . . . . . . . . . . Installing and Playing Custom Ring Tones . . . . . . . . . . Understanding Hardware Capabilities . . . . . . . . . Using BlackBerry Ringtone Megaplex . . . . . . . . . Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 29 30 32 32 33 34 34 36 36 36 37 37 37 38 38 38 40 40 41 42 43 43 44 44 45 45 46 46 47 47 47 49 52 53 53 53 54 54 55 55 55 56 56 59
Contents
Chapter 4: Unleashing the Wireless Web. . . . . . . . . . . . . . . . . 61
Built-in Web Browsing Tools . . . . . . . . . . . . . . . . . . Comparing the WAP Browser and the Internet Browser The Surf s Definitely Not Up. . . . . . . . . . . . . . . Web Browser Keyboard Shortcuts . . . . . . . . . . . . . . . . BlackBerry-Friendly Websites and Portals . . . . . . . . . . . Third-Party Web Browsers . . . . . . . . . . . . . . . . . . . Why Use a Third-Party Browser?. . . . . . . . . . . . . Opera Mini . . . . . . . . . . . . . . . . . . . . . . . . Minuet . . . . . . . . . . . . . . . . . . . . . . . . . . Assisted Web Search and Information Aids . . . . . . . . . . . AskMeNow . . . . . . . . . . . . . . . . . . . . . . . . Berry 411 . . . . . . . . . . . . . . . . . . . . . . . . . YubNub . . . . . . . . . . . . . . . . . . . . . . . . . . Working with RSS Feeds . . . . . . . . . . . . . . . . . . . . RSS Clients for BlackBerry . . . . . . . . . . . . . . . . BerryVine RSS Reader . . . . . . . . . . . . . . . . . . PicoNews . . . . . . . . . . . . . . . . . . . . . . . . . Blogging with Your BlackBerry . . . . . . . . . . . . . . . . . The Popularity of the Blog . . . . . . . . . . . . . . . . Blogging and BlackBerry . . . . . . . . . . . . . . . . . Reading a Blog from Your BlackBerry . . . . . . . . . . Posting to a Blog from Your BlackBerry . . . . . . . . . Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 61 62 63 64 67 67 67 68 68 69 70 71 72 73 73 76 77 77 78 78 79 81
xiii
Chapter 6: The Ultimate Remote Control: Controlling Your Desktop Computer from Your BlackBerry. . . . . . . . . . . . . . . . 91
Remote Control/Remote Desktop Tools . . Desktop Remote Control Solutions . Microsoft Terminal Services . . . . . VNC . . . . . . . . . . . . . . . . . Common Connection Issues . . . . . BlackBerry Remote Control Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 92 92 93 93 94
xiv
Contents
Remote File Access Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 Avvenu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 Im In Touch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 EasyReach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 Mobile Administration Tools. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 Idokorro Mobile FTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 Other Networking Tools. . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
107
107 108 108 109 110 112 112 112 112 113 115
Contents
Caffeine Finder . . . . . . . . . . . . . . . . . . . Beiks Dictionaries and Phrasebooks for BlackBerry Working with Office Documents and Databases . . . . . E-mail Attachments . . . . . . . . . . . . . . . . . BlackBerry Database Viewer Plus . . . . . . . . . . Keeping Track of Yourself . . . . . . . . . . . . . . . . . Tracking Your Mileage with My Mileage Tracker. . Expenses . . . . . . . . . . . . . . . . . . . . . . . Tracking Your Time with BizTrackIt . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 138 139 139 139 140 140 142 144 146
xv
Part II: Advanced BlackBerry Hacks: Put Your BlackBerry to Fun and Wacky Uses with Creative Software Projects
Chapter 11: Developing Your Own BlackBerry Applications . . . . . . 169
Java and BlackBerry . . . . . . . . . . . . . . . . . . . The BlackBerry Platform and Profile . . . . . . . The BlackBerry Application Program Interfaces . The BlackBerry Java Development Environment . . . . The BlackBerry Integrated Development Environment . Setting Up Your Project . . . . . . . . . . . . . . Writing Your Source Code . . . . . . . . . . . . Building Your Program . . . . . . . . . . . . . . Testing Your BlackBerry Program . . . . . . . . . Installing Your Program to Your BlackBerry . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 170 171 171 172 175 179 185 186 190 190
xvi
Contents
Chapter 12: A Classic Sketcher Application . . . . . . . . . . . . . . . 191
Designing a BlackBerry Drawing Program . . . . . . . . . Creating a Design for SketchBerry . . . . . . . . . . The SketchBerry Project Plan . . . . . . . . . . . . . Developing the SketchBerry Program . . . . . . . . . . . . Creating the Main SketchBerry Application Skeleton Intercepting Trackwheel Events . . . . . . . . . . . . Understanding the BlackBerry Graphics Model . . . Drawing on the Screen with paint() . . . . . . . . . . A First Try at Sketching . . . . . . . . . . . . . . . . Not Quite There Yet . . . . . . . . . . . . . . . . . . Working with Bitmaps. . . . . . . . . . . . . . . . . Using SketchBerry . . . . . . . . . . . . . . . . . . . . . . Running SketchBerry on a Device . . . . . . . . . . Running SketchBerry on the Simulator . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 192 193 193 194 195 198 198 199 201 202 204 204 205 206
Chapter 13: Music to My Ears: A Toy Piano in the Palm of Your Hand
Playing Audio with the BlackBerry Alert Interface . . Whats the Frequency: A Short Music Theory Detour Creating the Main PianoBerry Application Skeleton . Adding the PianoBerry Menu System . . . . . . . . . Playing Notes Using Alert.startAudio . . . . . . . . . Capturing Keypad Events . . . . . . . . . . . . . . . Mapping BlackBerry Keys to Piano Keys . . . . . . . PianoBerry: Putting It All Together . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
207
208 208 210 211 215 217 219 222 229
Contents
About Bluetooth on BlackBerry . . . . . . . . . . . . . . . . What You Can Do with Bluetooth on Your BlackBerry Which BlackBerry Devices Have a Bluetooth Radio . . Pairing with Bluetooth Devices . . . . . . . . . . . . . Using a Bluetooth Connection from an Application. . . . . . Bluetooth as a Serial Port Connection. . . . . . . . . . Determining If a Serial Port Is Available . . . . . . . . Opening a Bluetooth Serial Port Connection . . . . . . Writing Data to the Printer . . . . . . . . . . . . . . . Putting It All Together . . . . . . . . . . . . . . . . . Debugging BluetoothPrint . . . . . . . . . . . . . . . Adding a Print Menu to the MemoPad Application . . . . . Using the ApplicationMenuItemRepository Class . . . Adding the Print Function . . . . . . . . . . . . . . . More Uses for ApplicationMenuItems . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 246 247 247 250 250 251 252 252 253 256 256 257 259 260 260
xvii
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
Acknowledgments
Impossible is really just someones opinion. Somewhere in the middle of writing this book, I was attending a pre-race dinner for the San Diego Rock and Roll Marathon and was fortunate to hear this quote, which has been stuck in my mind ever since. The idea of having enough commitment, dedication, stubbornness, and desire to make the seemingly impossible happen is a fascinating one to me. At my company, Bachmann Software, our engineers are challenged regularly to create software products that perform magical tasks on the tiniest handheld computers. Indeed, the BlackBerry phenomenon, and the wireless industry overall, is now providing the world with instant access to people, data, and information, anytime, anywhere a capability that not very many years ago surely must have sounded like science fiction. I must thank all of those who through their efforts make the wireless world the ever-changing, fast-moving, and innovating industry that makes me look forward to coming to work every day. On a more personal level, in the past year Ive been privileged to work with an organization known as Team In Training, part of the Leukemia and Lymphoma Society (www.teamintraining.org). This wonderful organization is dedicated to helping fight leukemia and other cancers. Ive come to know the stories of the courageous individuals who fight the ultimate battle, one in which they are fighting for their very lives. Ive also come to know many of the most giving people I have ever met. These children, men, and women challenge the notion of the word impossible with every single passing day and are a daily inspiration to me. Thank you! Finally, the very fact that you are reading this book places you firmly in the camp of those who have insatiable curiosity, who are driven to push the envelope, who pick up a product and inevitably find themselves itching to find more ways to do more things with it than what is listed in the owners manual. I love to see this kind of spirit, and it is for you that I wrote this book. So, to all of you who continually prove that impossible is really just someones opinion: I thank you. Id also like to extend heartfelt thanks to Chris Webb and Kelly Talbot at Wiley, who helped guide and support me through the writing of this book and who always managed to push me just a bit harder than I would have pushed myself. You guys are great! As you might expect, many BlackBerry tips and tricks can be found around the Web, posted by enthusiastic users eager to help other BlackBerry owners by sharing the information they have found themselves, either through experimentation or word-of-mouth. In fact, there are now several websites that are devoted to the idea of providing an online community where BlackBerry owners can meet and swap experiences, questions, and answers. There are far too many to mention here by name, but Id like to thank the many BlackBerry enthusiasts who actively participate in BlackBerryForums.com, BlackBerryCool.com, and PDAStreet.com for sharing what theyve learned.
xx
Acknowledgments
Last, of course, I must thank the company responsible for the BlackBerry itself, Research In Motion. Very few products manage to change the rules and become ingrained in our daily lives as has BlackBerry, although countless products have tried to do so and failed. Research In Motion and the BlackBerry are a fascinating success story, one that continues to unfold before us.
Introduction
The BlackBerry is the fastest growing, most popular wireless e-mail device ever sold. Dubbed the CrackBerry as a tribute to how obsessively BlackBerry users will check their e-mails, the BlackBerry is best known for its unique and well-executed push e-mail functionality. This feature makes it a favorite of mobile professionals who need to be connected while on the go. This book is all about how to do different, weird, fun, and amazing things with your BlackBerry. Before you start changing how your BlackBerry works, however, you need to understand what kind of product you are starting out with. Because the BlackBerry is a recent phenomenon, very little has been written about it, and most people regardless of whether they own a BlackBerry have only a very limited view of what the device is all about. This section introduces the BlackBerry device, explains some of the reasons why it produces a fanatical devotion in its users, and provides a short history of the device, which has grown from a single-purpose text-messaging utility to a fully capable wireless e-mail device, personal digital assistant (PDA), and general-purpose mobile application platform. I also provide an overview of the range of devices available on the market today, and survey the built-in capabilities of the BlackBerry hardware, as well as the included operating system and application software. If you already own a BlackBerry, this introduction will give you a greater perspective and understanding of the device before you set about changing it. If you are thumbing through this book because you are curious about the BlackBerry phenomenon, and perhaps are considering obtaining one for yourself, this introduction will give you a sense for why you see devices everywhere and why people are so attached to them.
xxii
Introduction
There are programs that can add all kinds of features to your BlackBerry, including getting weather updates, using word processing capabilities, storing your travel itinerary, connecting to RSS feeds, accessing enterprise systems, and much more. BlackBerry programs are available for purchase or can even be found for free. You can get more information on how to find and install these programs in Chapter 2.
If you know how to write your own software programs or work with web content, you can even create your own BlackBerry applications and web services. As you can imagine, this book exploits this aspect of the BlackBerry device quite extensively! See Chapters 11 through 15 for more ideas.
Modern BlackBerrys also double as cell phones, allowing you to use your device as both a phone and an e-mail messaging center.
Introduction
A key factor in the BlackBerrys success is its specific approach to the problem of mobile e-mail. Many mobile handheld products allow you to access your e-mail, but the BlackBerry early on grew a reputation for being the only device that could effortlessly deliver, or push, your e-mail to you in real time, without needing to perform menu commands or wait for your messages to download. When you pick up your BlackBerry, your latest e-mail is already retrieved and waiting for you. Although push e-mail is a seemingly simple concept, the BlackBerry is the only device to date that has been able to successfully deliver this capability inside a well-executed wireless handheld computer. As though the e-mail capability were not enough, all modern BlackBerrys double as cell phones. Instead of carrying a cell phone and a BlackBerry with you, all you need is a BlackBerry hooked up to your wireless voice and data service. For the millions of people who use a cell phone every day, the BlackBerry offers a simple but powerful way to add mobile e-mail while retaining the ability to place and receive calls. In addition, many believe that the BlackBerry has become so popular because it is so well-designed for the purpose it was intended for. In particular, BlackBerry users by far have enjoyed the best implementation of a QWERTY keyboard found on any mobile device, which is very important considering that composing and responding to e-mail messages is a primary BlackBerry feature. Furthermore, BlackBerrys have an outstanding battery life, lasting many days on a single charge, an extraordinary feat given that competing devices generally require a charge at the end of every day.
xxiii
xxiv
Introduction
Introduction
xxv
FIGURE I-1: The RIM Inter@ctive Pager model 950 (Courtesy of Research In Motion Limited)
The original RIM Pager came with wireless data service from Mobitex (BellSouth) and did not offer any voice capability. RIMs first customers were predictably businessmen including portfolio managers, stock traders, and others in the financial sector whose livelihood depended on constant communication with customers and co-workers. RIM followed up on the initial success of the RIM Pager with the very first BlackBerry in 1999. The BlackBerry improved upon the earlier Pager by offering a larger screen, compatibility with modern wireless services such as General Packet Radio Service (GPRS) and Code Division
xxvi
Introduction
Multiple Access (CDMA) networks, and integration with corporate e-mail through the BlackBerry Enterprise Server (BES). The BlackBerry also was built upon a Java platform, which gave the product a robust foundation for secure communications, as well as a foundation to allow software developers to create add-on software applications and solutions. Since the introduction of BlackBerry, RIMs devices have grown in both popularity and functionality. Backed by large U.S. wireless carriers such as Sprint, Cingular, Verizon, and T-Mobile, as well as non-U.S. carriers such as O2, Orange, and Vodafone, the BlackBerry devices are now much more available and can easily be purchased through your preferred wireless carrier and added to your existing voice account. Today, according to published estimates, BlackBerry is supported by approximately 200 wireless carriers worldwide and has more than four million handheld customers, and BES is installed at more than 50,000 locations.
Introduction
xxvii
Aside from physical differences and slight variations in additional capabilities from model to model, you should note that there are also variations in which model is supported by which wireless carrier networks. For example, the 7100t is offered by T-Mobile and the 7100r is specific to the Rogers Wireless network in Canada, while the 7100g is available on a broader range of carriers. In general, if you obtained your BlackBerry through your wireless carrier, it is locked to that network and cannot be used on other wireless networks.
xxviii
Introduction
A caution indicates that you should use extreme care to avoid a potential disaster.
Introduction
xxix
Code lines are often longer than what will fit across a page. The symbol i indicates that the following code line is actually a continuation of the current line. For example,
var newlat = latpoints[0] + ((latpoints[latpoints.length-1] - i latpoints[0])/2);
is really one line of code when you type it into your editor. Code, functions, URLs, and so forth within the text of this book appear in a monospaced font, while content you type appears either bold or monospaced.
On both pages you will find errata and updates to Hacking BlackBerry, as well as full source code for the projects in Part II. Although I cannot possibly provide answers and tech support for the entire BlackBerry user population, if you want to drop me a note to say Hello! or if you have a development project and want to learn more about my company Bachmann Software, you can use the following e-mail address:
[email protected]
xxx
Introduction
Summary
In this introduction Ive provided a basic overview of the BlackBerry and why it is such a wonderful product to use. Perhaps by now you suspect that I am some sort of paid evangelist for RIM. (Im not!) But I am a BlackBerry lover whos excited to show you the many ways in which you can customize the device and make it your own. This book covers just how to do that.
Hacking
BlackBerry
Customizing the BlackBerry with Tweaks, Secret Codes, Hidden Keys, and Add-On Applications
part
in this part
Chapter 1 Secret Codes and Hidden Keys Chapter 2 Adding Software to Your BlackBerry Chapter 3 Advanced E-mail, Voice, and Messaging Chapter 4 Unleashing the Wireless Web Chapter 5 Using Your BlackBerry as a Wireless Dialup Modem Chapter 6 The Ultimate Remote Control: Controlling Your Desktop Computer from Your BlackBerry Chapter 7 Storage on the Go: Your BlackBerry as a USB Thumb Drive Chapter 8 Keeping Your BlackBerry Safe Chapter 9 Getting Down to Business: Productivity Tools Chapter 10 Beyond BrickBreaker: Fun, Games, and Entertainment
chapter
elcome to Hacking BlackBerry! This book is all about how to do useful, interesting, fun, and different things with your BlackBerry device. Im going to dive right in with this first chapter, and provide you with information on many undocumented keystrokes and codes that allow you to access and effectively use the helpful, interesting, or just plain obscure features on your BlackBerry. For information on codes you can use for e-mail, web browser, and security purposes, see Chapters 2, 3, and 7, respectively.
in this chapter
Typing more efficiently Mastering shortcut keys Accessing hidden system screens Working with the built-in applications
Table 1-1
To insert . . . A period
Typing Shortcuts
Do this . . . Rather than pressing ALT+M, press the SPACE key two times in succession. Not only will your BlackBerry insert a period but it will also capitalize the next letter you type. Normally you would press the CAP key along with the letter you want to capitalize. With BlackBerry, you can simply press and hold the letter you want to capitalize. Press and hold any key while scrolling the trackwheel up or down. You will see a rotating list of characters mapped to that key appear on the screen. Select the character you want by scrolling the trackwheel. In any field designed to accept an e-mail address (such as the e-mail field in an Address Book entry), simply type a space for BlackBerry to automatically insert an @ character. This trick works for the period used in e-mail addresses as well.
A capital letter
A special character
An @ symbol
The numeric signal display represents your signal strength in decibels (dB).
Table 1-2
Smart Code myver LD LT mysig mypin
FIGURE 1-4: The BlackBerry information display after entering the smart code myver in an e-mail
Table 1-3
Shortcut Key A R B U L C K M D O P F V S T W
10
Table 1-4
Shortcut Key A M D W G
11
Table 1-4
Shortcut Key T SPACE N C
Continued
Meaning Go to the current date. Jump to the current date in your currently selected view. Navigate to the next day, week, or month, depending on the current view. Navigate to the next day, week, or month, depending on the current view. Create a new appointment. In Day, Week, and Agenda views, navigate forward or backward among the days of the week. In Month view, navigate forward or backward among the weeks in the month.
ALT+trackwheel
These shortcut keys will not work in the Day view if you are using the Enable Quick Entry option. When you start typing, Enable Quick Entry thinks that you are entering a new appointment rather than accepting what youre typing as shortcut keys. If you prefer to leave Enable Quick Entry on, you will be able to use these shortcut keys in only the Week, Month, and Agenda views. To turn off Enable Quick Entry, use the trackwheel in the Day view to display the menu and choose Options to bring up the Day View Options screen, then scroll to the Enable Quick Entry item and make sure it is set to No.
FIGURE 1-5: The Go To Date popup screen that appears after pressing G in the Calendar application
12
Finding Contacts
If you are like me and have a fairly large list of contacts in your Address Book, quickly finding the right entry when composing an e-mail or making a phone call can be frustrating, especially if you remember only a tiny bit of the contacts information. For maximum efficiency, start by keeping your Address Book sorted in the same way you are likely to look for contacts. If you are in sales and generally organize your contacts by company, sort your Address Book by company. Similarly, if you are more comfortable searching by last name, set your sort option to use last names. To change the sort order: 1. Use the trackwheel to bring up the Address Book menu, and choose Options. 2. In the Options screen, change the Sort By field to first, last, or company. One of the easiest ways to find a contact quickly is to use the proper search technique. In the BlackBerry Address Book list, you can quickly jump to the right contact by taking these simple steps: 1. Type the first few letters of the first name. 2. Insert a space. 3. Type the first few letters of the last name. This method yields the name you were looking for with a minimum of typing and scrolling because you avoid having to type the full name or scroll up and down within many entries that start with the same letter. Note that this technique works regardless of the sort option you are using.
Editing Contacts
When you add a contact to the Address Book in a hurry, you sometimes enter only the minimum amount of information necessary, such as name and phone number. When editing an Address Book entry, the phone fields (Work, Home, Mobile, and so on) all allow you to enter their values using the number keys. You do not have to use the ALT key when entering numbers for these fields.
13
Table 1-5
Shortcut Key + (or L) - (or U) * (or A) / (or G) ) (or Y) ( (or T) Return V #
The 7100 models with the more phone-centric keyboards do not have labeled keys for add, subtract, multiply, and divide. Instead, you must use the keyboard equivalents shown in Table 1-6.
Table 1-6
Shortcut Key I U A G Y T Return Key V #
14
Summary
I collected the hacks, tips, and tricks in this chapter from a number of different sources on the Internet. As of this writing, there is no big list of secret BlackBerry codes posted anywhere (a good reason for the existence of this book!). Instead, you can find a few tips here or there in a great many places. The BlackBerry site has some great information in its customer support materials. Another good source of information is your wireless carriers website. Several carriers list Frequently Asked Questions and post various tidbits of information in the sites customer support area. If you are interested in learning more about the codes and hidden screens that BlackBerry users have discovered, several online BlackBerry user forums have a Tips section where users freely post their discoveries or little-known tips and techniques they may have heard about or seen somewhere and simply felt like sharing with others. The following web sites have some good information: www.blackberrycool.com www.pdastreet.com/forums (navigate to the RIM and BlackBerry discussion forum) www.ibbug.org Who knows? You may even discover some of your own hidden key codes just by experimenting with your own BlackBerry!
chapter
ost handheld devices come with a basic set of Personal Information Management (PIM) applications that includes calendar, address book, to-do, and memo options. With wireless devices and smartphones, you also generally get a phone dialer, an e-mail client, and a web browser. Beyond that, perhaps you get a token game or two. To add any other functionality that you would like to have on your device, however, you need to locate and install a third-party application.
in this chapter
Finding additional software applications Loading software from your desktop Installing OTA applications
16
Document Management
BlackBerry is one of the few remaining popular smart devices that does not come with some sort of built-in document capability, which seems strange given the built-in BlackBerry keyboard. The following applications can help remedy this situation: eOffice: Provides viewing and editing of Word and Excel documents. DocHawk: Includes viewers for PowerPoint, Word, and RTF. BlackBerry Database Viewer: Enables you to view Access, Excel, and other popular database formats. Programs such as these are presented in more detail in Chapter 9.
17
Utilities
In addition to the program categories listed earlier, some programs are useful in a more general way and can help you gain more utility from your BlackBerry. The following are a few examples: MyClock: Provides an analog clock display. SearchMagic: Enables you to conduct a full text search on your BlackBerry. Password Manager: Keeps your passwords and PINs in one safe place. You can find additional information about programs in the utilities category in Chapter 8.
18
19
FIGURE 2-1: The main page of the Handango Store for BlackBerry
20
FIGURE 2-2: The 7290s home software page at the Handango Store for BlackBerry
21
22
23
24
3. Click the Add button to add an application to your BlackBerry. This displays the dialog box shown in Figure 2-7, which allows you to locate the appropriate Application Loader file. Application Loader files have an extension of .alx and accompany the .cod program file in order to provide the Loader Wizard with information about the program you wish to install.
To remove an application, simply uncheck the box next to the application in the Handheld Application Selection screen.
4. Select the .alx file for the application you wish to add, and then continue with the installation. Your BlackBerry may need to reset; after it re-initializes, you should see the program in the list of icons on your BlackBerrys main screen.
Some programs come as a completely self-contained executable (.exe) file, which automatically interfaces with the Application Loader to add the new program to your BlackBerry.
25
OTA downloads of BlackBerry applications are generally available in the same places where you would find the desktop-installable versions: at Handango.com or at the vendors web site.
Not all BlackBerry applications are available for OTA download. If an application you are interested in does not support OTA, it could be because the program has a necessary desktop component; the program has multiple components, making it difficult to support with a single download; or the developer simply has not bothered to make an OTA version available.
To learn how to perform an OTA download, you can start by downloading a BlackBerry version of the popular Sudoku game (created by a company called Magmic). The technique described here is applicable to any OTA download: 1. Load your BlackBerry web browser. Once in the browser, click the trackwheel and choose the Go To menu. 2. In the resulting dialog box, enter bb.magmic.com and click OK to go to Magmics OTA download page, shown in Figure 2-8. 3. Scroll to the link for Sudoku, and select it to begin the download. 4. Follow the prompts; the download should take a minute or two to complete. 5. After the download is complete, return to your BlackBerry main screen; you should see the new Sudoku icon. Select and run it, and you are ready to play! Figure 2-9 shows Sudoku in action.
26
Summary
Finding and adding a great software program can change your relationship with your BlackBerry, taking it far beyond e-mail messaging. It is without a doubt the easiest way to expand the number of things you can do with your BlackBerry. The third-party application market for BlackBerry devices is poised for rapid growth as the number of devices shipped demonstrates to software developers that there is potential for reaching new customers. As the number of BlackBerry users grows, so does the pool of enthusiasts, hackers, and other interested people programmers or otherwise who will find some
27
chapter
his chapter gets right to the heart of why everyone is in love with their BlackBerry devices e-mail! E-mail is easily the number one reason why people use their BlackBerry, and the BlackBerry is without a doubt the best handheld device or smartphone out there for mobile e-mail and mobile messaging. In this chapter, you explore all sorts of ways to make the most of your BlackBerry when used for e-mail messaging, instant messaging, and voice phone calls. The chapter covers the usual array of shortcut keystrokes and hidden codes. You also learn how to manage your e-mail signature, work with filters to get control of your e-mail, work with third-party applications for instant messaging and attachments, and even learn how to add custom ringtones to your smartphone!
in this chapter
Using secret codes and hidden keys in e-mail messaging Customizing your signature Filtering messages that are sent to your BlackBerry Examining thirdparty instant messaging applications Working with attachments Faxing from your BlackBerry Installing ringtones Using phone call shortcut keys
30
Keystrokes can cause different behavior when pressed in different BlackBerry screens. This chapter describes the meaning of special shortcut key sequences in various BlackBerry applications, but keystrokes can behave differently in other applications. For example, observe what happens when you enter the numbers from a phone number in the Phone application as opposed to when you enter those same numbers in a different program, such the Calendar Week screen.
31
Table 3-1
Shortcut Key T B SPACE CAP+SPACE N P U BACKSPACE
Additionally, the shortcut commands in Table 3-2 perform common actions on the selected message in the Messages List.
Table 3-2
Shortcut Key R F L S V C
32
Table 3-3
Shortcut Key ALT+J ALT+O ALT+P ALT+S ALT+V
Table 3-4
Shortcut Key
33
Table 3-5
Shortcut Key R F L S V C
Have you ever been annoyed by having to scroll forever to get back to where you left off reading a long message? Next time, when you return to your message, just press the G key and the cursor will automatically jump to the place where the cursor was the last time you closed the message!
Composing Messages
When you need to quickly compose a message on your BlackBerry, you dont have time to waste on the formalities of finding the recipients e-mail address or excessive typing. As mentioned earlier, you can use the C keystroke from within the Message List to automatically create a new message. This brings up the Address Book, so your next challenge is to either find your target recipient in your oversized Address Book or type in your recipients e-mail address from memory. Not! Instead, here is an excellent place to employ one of my favorite shortcuts, which is to type partial names in the Address Book listing to quickly find an entry. In most cases, you need to type only the first initial, then the SPACE key, and then the first few letters of the last name, and you will almost certainly have found your contact. For example, if you were trying to compose an e-mail to me and you thought I was in your Address Book, you would type g bach and your Address Book would quickly be filtered down to just a couple (or even one) entries.
34
35
Table 3-6
Shortcut Key R L
If you scroll to one of these date headers, click the menu, and choose the Delete Prior menu item, your BlackBerry proceeds to delete all messages from that date or prior to that date. I use this shortcut all the time. Because I often bounce back and forth between my desktop e-mail and my BlackBerry, all of my old messages are ultimately retrieved and stored on my desktop, so there is little reason to retain old messages in my device.
36
37
38
Table 3-7
Shortcut Mydcid Mypin Mynumber
39
3. Starting at the top of this form, each filter you define gets a name, because multiple filters can be associated with your profile. 4. After naming your filter, you may now add one or more conditions, which will be used to identify messages that you want to forward to (or block from) your BlackBerry. You can set a condition based on the contents of the From, To, Subject, or Body components of each message. Here are some examples of ways you can use conditions: If you want to create a filter condition that can trap all messages that have the word Urgent in the subject line, you can choose Subject, Contains, and Urgent as your condition criteria.
40
41
WebMessenger is very easy to install. The entire process is handled by a desktop-based wizard, which is a nice touch. More information on WebMessenger Mobile Instant Messenger, including a free trial download, is available at WebMessengers website at www.webmessenger.com.
Verichat
Verichat is an award-winning instant messaging application that runs on most handheld devices, including BlackBerry. Verichat supports Yahoo!, ICQ, MSN, and AOL chat networks and lets you carry on multiple conversations at one time with people on your Buddy List. Aside from person-to-person messaging, Verichat also offers access to numerous added-value services, such as zip code lookup, currency conversion, and more. Verichat presents this list of services to you as part of the menu of actions you can take in addition to messaging. Verichats signup and connection process is fairly straightforward, and once you are logged in to your preferred messaging service, chat sessions can be carried on, as shown in Figure 3-4.
42
I did have a little trouble with IM+ at the start when it attempted to try to autoconfigure my network access (see the About MDS and BES Network Access section later in this chapter), but I eventually got it configured and connected without too much trouble. If you cannot get past the network connectivity problem, Shape Services also offers a WAP-based version of IM+. In terms of pricing, IM+ is a little unique compared to the other messaging applications listed here, which require a yearly subscription. At the time of this writing, Shape Services offers
43
BlackBerry Messenger
BlackBerry Messenger (see Figure 3-7) is an instant messaging program that is provided free of charge by Research In Motion (the makers of the BlackBerry device itself ). Messenger does not integrate with popular instant messaging services such as AOL, ICQ, or MSN. What it does offer is the ability to perform messaging between BlackBerry devices independent of these Internet-based messaging services. Because it relies on the BlackBerry PIN, in order for you to chat with another person with Messenger, that person must be using a BlackBerry and must have installed BlackBerry Messenger on their device.
Rather than rely on an Internet-based Buddy List, BlackBerry Messenger builds up a messaging contact list out of your existing BlackBerry Address Book. To add to your contact list, just select the contact from your Address Book and a request is sent. Participation is thus by invitation, and you will need to await a confirmation from your target recipient before you can start a conversation with them using Messenger. If you can live with chatting only with other BlackBerry owners running Messenger, the program can meet your basic messaging needs. Of course, it is a free download so the price cant be beat! For more information on BlackBerry Messenger as well as access to a free download, please visit www.blackberry.com/messenger. (Note that this web page requires Internet Explorer to work correctly.)
44
Googles Gmail
Googles Gmail service is one of the most popular free e-mail services available. Setting up your BlackBerry to work with Gmail requires you to first change your Gmail settings on the web and then configure your BlackBerry Internet Service (BIS) account to access your Gmail account. Perform the following steps: 1. Log in to your Gmail account. 2. Click Settings at the top of the Gmail page. 3. Click Forwarding and POP in the Mail Settings box. 4. Select either Enable POP for all Mail or Enable POP for all mail from now on. 5. Click Save Changes. 6. Now go and log in to your BlackBerry Internet service account. 7. Click the Profile link at the top of the page. 8. Click Other Email Accounts in the e-mail accounts section of your BIS profile.
45
Yahoo! Mail
In order to integrate your Yahoo! Mail account with your BlackBerry, you must first subscribe to the Yahoo! Mail Plus service. (Unfortunately, regular Yahoo! Mail accounts are not supported.) 1. Log in to your BlackBerry Internet Service account. 2. Click the Profile link at the top of the page. 3. Click Other Email Accounts in the e-mail accounts section of your BIS profile. 4. Click Add Account. 5. Now enter the information for your Yahoo! Mail Plus account, including e-mail address, username, and password. 6. Click the option I have enabled POP access to my Yahoo! mailbox and want to add it. Then click Next. 7. To complete the change, click Submit.
Hotmail
To integrate your Hotmail account with your BlackBerry, you need to upgrade to MSN Hotmail Plus, which is a paid subscription. 1. Log in to your BlackBerry Internet Service account. 2. Click the Profile link at the top of the page. 3. Click Other Email Accounts in the e-mail accounts section of your BIS profile. 4. Click Add Account. 5. Now enter the information for your MSN Hotmail Plus account, including e-mail address, username, and password. 6. To complete the change, click Submit. Note that if you try this procedure with a regular (non-Plus) Hotmail account, you will receive an error message such as Cannot integrate the email account.
46
iNotes
To integrate your iNotes account with your BlackBerry, perform the following steps: 1. Log in to your BlackBerry Internet Service account. 2. Click the Profile link at the top of the page. 3. Click Other Email Accounts in the e-mail accounts section of your BIS profile. 4. Click Add Account. 5. Enter the information for your iNotes account, including e-mail address, username, and password. 6. Under Lotus Notes/Domino, choose the option I can access my mailbox using a Web browser (iNotes). 7. Click Submit. 8. In the iNotes URL field, type the iNotes account URL. Be sure to include the location of the .nsf file and the connection type (http or https). 9. Select the option Leave messages on mail server. 10. Click Submit.
47
The physical nature of the BlackBerry device also presents a challenge with some file formats. Navigating through even a moderately sized Excel spreadsheet with just the trackwheel on a small screen is a far cry from what happens on your desktop.
48
Table 3-8
Shortcut Key V T B F J G N P
Table 3-9
Shortcut Key Trackwheel
ALT+trackwheel V T B F G N P
Table 3-10
Shortcut Key ALT+trackwheel 3 9 . (period)
49
If you highlight an attachment and choose Open with DocHawk, DocHawk asks you to confirm that you wish to submit your attachment to the DocHawk host conversion server (see Figure 3-9). If you choose Submit, DocHawk contacts the host service and prepares an appropriate conversion of your PDF for viewing on the device.
50
From within the document list, you can select a document for viewing. Doing this submits a request to the Repligo host to convert the document for viewing on the handheld. Conversions occur one page at a time and are fairly quick. Once a page is retrieved, it can be quickly zoomed in or out, and a number of navigational aids allow you to move around the document. Figure 3-11 shows a sample Excel spreadsheet with a graph included, highlighting Repligos ability to preserve the original documents graphics and formatting.
51
Repligo is priced as a subscription service and can be purchased for $99.95 per year or $29.95 per quarter at the time of this writing. A limited functionality trial download, as well as more information on Repligo, can be obtained at the Cerience website at www.cerience.com.
52
Working with attachments in eOffice can be a bit more cumbersome and take a few more steps than in DocHawk or Repligo, but in exchange you are rewarded with a richer feature set and a taste of full Office functionality on your BlackBerry. At the time of this writing, eOffice is available for purchase in Basic ($119), Standard ($149), and Professional ($199) editions, at a one-time (non-subscription) cost. For more information on eOffice as well as access to free trial downloads, visit Dynoplex at www.dynoplex.com.
53
54
55
56
57
After you have selected a ringtone category, you are presented with a list of available ringtones for download. In my experiment, I went into the Classical category and chose Ravels Bolero. 4. Once selected, an audio player window appears and, as a preview, begins playing the ringtone youve chosen on your BlackBerry speaker, as shown in Figure 3-16.
58
5. Once youve chosen your new ringtone, save and close the Profile program. You should now be all set with your new ringtone. To test it out, just dial your BlackBerry from some other phone, and when your BlackBerry rings, your new ringtone will play! In my case, the Bolero tune has been ringing all day, and I am dying to change it. I wonder what I should change it to? Hmmm . . .
59
Summary
Many BlackBerry users simply are not aware that there is more to BlackBerry messaging than scrolling up and down the Messages List and opening e-mails. In this chapter you learned how to transform the way you perform BlackBerry messaging into a much more efficient and personalized experience through the use of special shortcut keys, custom signatures to your outgoing messages, attachment handling, and fun and distinctive ringtones. Armed with these tips and techniques, its a cinch that youll be more productive in how you handle e-mail. Just dont be surprised to find people looking over your shoulder as you work on your BlackBerry, saying Hey! Can you show me how to do that on my BlackBerry?
chapter
iven the built-in wireless capability that comes with BlackBerry, it makes sense that BlackBerry users want to make the most of their device by taking advantage of as much of the wireless world as they can. As youve seen, e-mail and messaging in general are the first and most obvious features that BlackBerry users gravitate toward. But what about the Web? For desktop and laptop users, the Web is the Internet. So how much of the Web can a BlackBerry user expect to be able to access on his or her device? In this chapter, you explore the built-in BlackBerry Browser and uncover hidden shortcut keys that can help speed up your use of the mobile Web. You also see some of the more mobile-friendly websites that exist and cater to users who access them from BlackBerry devices. You also step outside of the browser itself and take a look at tools for subscribing to and accessing information and news feeds from RSS, and even how to blog with your BlackBerry!
in this chapter
Using built-in web browsing tools Using web browser shortcut keys Exploring BlackBerry-friendly websites and portals Accessing third-party web browsers Working with RSS feeds Blogging wirelessly
62
63
Directly accessing a mobile-friendly web page or download URL from a saved bookmark Accessing news, weather, and other information via a mobile-friendly web portal Downloading applications over-the-air directly to your BlackBerry Accessing internal HTML pages from a corporate server that are specifically designed for use by a BlackBerry device Given a direct URL to a mobile-friendly web page, it is amazing how much better the experience can be on a BlackBerry!
Table 4-1
Shortcut Key spacebar Shift+spacebar H ESC R F G O K T
64
Table 4-1
Shortcut Key B A I N L P S D U
Continued
Action Jumps to the bottom of the currently viewed page. Prompts you to add the currently viewed page as a bookmark. Jumps to the browser History screen. Goes to the next page in the browser History list. Brings up the address for the currently selected link and allows you to copy the address to the clipboard or to e-mail the address. Brings up the address for the currently viewed page and allows you to copy the address to the clipboard or to e-mail the address. Saves a link to the currently viewed page as a Saved Message. Switches the web browser to the background and lets you switch to a different application without having to close your browser session. Toggles between full-screen mode and normal viewing mode. Full screen mode omits the title bar and status bar to give you slightly more screen real estate to view a web page in. Brings up an interesting Connection Information screen that shows details about your current browser session and connection. You can copy this information to the clipboard if you wish.
Many of these shortcut keys can save you a considerable amount of repetitive and monotonous thumb-scrolling and menu-clicking. As with some of the other BlackBerry shortcut keys and techniques covered in Chapter 1, once you master these keystrokes, youll wonder how you ever got along without them!
65
Table 4-2
Website
Mobile-Friendly Websites
Content USA Today (news) US News and World Report (news) New York Post (news) Business Week (business news) PR NewsWire (press releases) CNN (news) MapQuest (maps and directions) SportsLine (sports news) ESPN (sports news) Amazon.com (online shopping) Google (search engine) Motley Fool (investment/financial) TV Guide (TV listings)
www.usatoday.com www.usnews.com/usnews/textmenu.htm www.nypost.com/avantgo Pda.businessweek.com www.prnewswire.com/tnw/tnw.shtml Wireless.cnn.com www.mapquest.com/pda Ppc.sportsline.com Mobile.espn.go.com www.amazon.com/mcommerce www.google.com www.motleyfool.com Wireless.tvguide.com
66
A good strategy I recommend is to spend a few minutes on your desktop computer finding a couple of good mobile-ready websites that cover the information categories you care most about and pre-load your BlackBerry Internet Browser with bookmarks for those sites. Later when you have only your BlackBerry to depend on, youll be glad you did!
67
Opera Mini
Opera Mini is a proxy-based web browser designed with phones in mind. It runs on the MIDP/ J2ME platform and will run on a BlackBerry device. Opera Mini is referred to as a proxy browser because it does not directly retrieve and format web pages on the device. Instead it offloads this task to a server whose job it is to evaluate any requested web pages and reformat them so that they will work well on a phones small screen. Depending on the web page you are trying to access, this approach can result in faster web page downloads and better looking pages because the device no longer has to do all of the hard work. Besides the proxy-based feature, Opera Mini (pictured in Figure 4-4) also has some userinterface niceties such as an optimized home page with ready-to-use search, bookmark, and history sections. Opera also features a unique speed dial option for quickly accessing commonly used bookmarks; just press ALT+* and the number of the bookmark from your list, and Opera will retrieve the referenced web page.
68
Opera Mini is a free download and is available at the Opera website, www.opera.com.
Minuet
Minuet, developed by TriPrince at TriPrince.com, is another popular alternative web browser for BlackBerry devices. In contrast to Opera, Minuet claims to use no proxy middleman servers and does all of the brute-force web formatting and rendering on the device itself via a direct connection. Other advantages that TriPrince claims with Minuet are background web page loading, image display optimizations, better security, and caching. As with Opera, depending on which device you have and which web pages you want to access, you may find that Minuet provides a better experience for you than the built-in BlackBerry Browser. Note that Minuet is a native BlackBerry program and does require BlackBerry OS 4.x or better. To get more information on Minuet including a trial download, visit Handango at www.handango.com or www.TriPrince.com.
69
AskMeNow
One example of such an assisted search service is called AskMeNow, located at (you guessed it) www.askmenow.com. The premise of AskMeNow is that you sign up for the service, and whenever you need information you pose your question to the AskMeNow service by placing a phone call or by submitting a question from the AskMeNow software. Your answer is then sent as a text message to your phone via your wireless data connection. AskMeNow claims that they can answer virtually any question for which the answer can be found on the Internet. Questions that can be answered automatically, such as 411 info, driving directions, directory listings, or movie times, are free. AskMeNow also offers a service called AskMeAnything, which allows you to ask any question at all for a per-question fee of $0.49. These questions may require an actual person to research the answer for you (for example, Why is the sky blue?). Although you can use AskMeNow by simply calling in your question and receiving the answer as a text message, you can download software that lets you interact with the service from your BlackBerry. The optional software loads as a BlackBerry icon. When you first run AskMeNow on your BlackBerry, you just need to enter your mobile phone number so that the AskMeNow service can correctly send the answer to your question as a text message. You are then presented with the main AskMeNow screen (see Figure 4-5), a series of icons representing 12 different categories of information, including weather, sports, stock quotes, driving directions, flight status, hotel listings, and more. Within each category is an entry form formatted specifically for that category, so for example if you want to know the score of todays Mets baseball game, you choose Major League Baseball as the sport and Mets as the team. Similarly if you want driving directions, enter the starting and ending address.
70
Berry 411
Berry 411 is a software program that acts as a front end to the BlackBerry Internet Browser. As its name suggests, Berry 411 aims to give you the Internet equivalent of the 411 telephone information service and make it easily accessible from a BlackBerry device. Berry 411 delivers on this goal with a deceptively plain-looking software program that loads on your BlackBerry. You run Berry 411 as you do any other BlackBerry application, and Berry 411 presents you with a simple form (shown in Figure 4-6) with two pieces of information to fill out: your location and one or more keywords representing what you are searching for.
Your location is pre-filled with your work, home, or other location. These locations can be entered when you first run the program and can be changed at any point when you do a search. Once you enter your search terms, clicking the trackwheel menu brings up a list of search choices that you can target with your search. Selectable options include the Yellow Pages, White Pages, Google, Weather, Shopping, Movies, and Sports. Selecting a search option then submits your search terms to the selected service and launches the BlackBerry Browser with the matching search results. For example, I performed a search for sushi in my work location of New York City, and within a few seconds I was presented with a listing of available restaurants (shown in Figure 4-7) where I could get my hands on a spicy tuna roll with extra wasabi.
71
Notice that the listings are all formatted consistently with name of the restaurant, phone number, and street address. Finding this same information without Berry 411 would have involved either a Google search and wading through a hodgepodge of results or else finding a mobile-friendly restaurant listing web page. Even nicer, with Berry 411s software front end, I didnt even have to connect to the Internet until I was ready to submit my search! Believe it or not, Berry 411 is freeware and is downloadable from www.berry411.com.
YubNub
YubNub is neither a software application nor an information service. Instead, www.yubnub.org is a website that offers what it refers to as a command line for the Web. The idea behind YubNub is that you can execute a much more specific, directed search for information by typing a complete command line that describes what you want YubNub to do. YubNub offers a wealth of predefined commands that cover weather, sports, news, music, stock quotes, and more. For example, to get the weather for New York City, you go to the YubNub page and enter weather 10001 in the input box (10001 is one of New Yorks zip codes). YubNub quickly brings you to a page from The Weather Channel that offers the current weather conditions for New York! Similarly, typing allmusic Bob Dylan brings up a page from the popular music site www.allmusic.com, with information on the musician Bob Dylan. You can also direct your search commands to use mobile-friendly search results that are stripped of images or other bandwidth- and screen-hogging elements. For example, the command to search Answers.com is a, and you can direct YubNub to use the mobile-friendly version by adding mo to the command, as in amo thunder, which will return the Answers.com page containing the definition of thunder, optimized for mobile devices. Pretty cool! Figure 4-8 shows YubNub on the standard BlackBerry Internet Browser. While not a BlackBerry-specific service, YubNub is a boon to BlackBerry users in that it speeds up the search process and lets you retrieve information using few keystrokes. Instead of having to go to a specific website (which may not be mobile-friendly at all) and enter your search criteria, you can do it all from the YubNub site, which loads on a BlackBerry in a matter of
72
73
As you can see from Figure 4-9, the main screen for BerryVine is a list of the RSS feeds you are subscribed to. Many RSS clients start you with a blank list and leave it up to you to find and subscribe to your first RSS feeds, but I liked the fact that BerryVine populates your subscription list with 18 preconfigured feeds, including feeds from popular sources such as Yahoo, CNN, the New York Times, and Reuters.
Loading a Feed
To retrieve the latest news items from a feed you are subscribed to, just select the feed you wish to read, click the trackwheel menu, and choose Load Feed, as shown in Figure 4-10.
74
Choosing Load Feed causes BerryVine to connect to the Internet, contact the URL associated with the feed you have selected, and download all of the latest items or stories that are published. As an example, in Figures 4-11 and 4-12, Ive chosen the RSS feed for the popular BlackBerryCool website for BlackBerry enthusiasts and asked BerryVine to retrieve the latest stories.
75
In the previous example, I wanted to find a way to learn about new BlackBerry software applications as they are released. Because I knew that Handango.com keeps such a list, I went to the Handango website from my desktop web browser, clicked on the XML icon, and discovered that the URL for a feed of newly released BlackBerry apps is:
http://service.handango.com/ampp/ContentRequestGenerator?id= 123&password=rss20content&platformId=5&maxCount=50&optionId=5
To add this feed to BerryVine, simply fill out the form as shown in Figure 4-13, including the URL. (Yes, I know this is tedious on the BlackBerry keyboard.) If you are careful and enter the URL correctly, you can then load stories for this feed, as shown in Figure 4-14.
Getting Updates
Some desktop RSS readers automatically check for updates on each subscribed feed, but in BerryVines case you need to manually check each feed on your list when you want to see if new items are posted.
76
FIGURE 4-14: The Handango RSS feed shows me the latest BlackBerry applications released!
PicoNews
PicoNews is an interesting combination of a software program and an online service that come together to create a very nice RSS news reader solution for BlackBerry devices. Like BerryVine, PicoNews is a downloadable BlackBerry software application that installs onto your device. But whereas BerryVine then works more or less like a traditional RSS client, PicoNews takes advantage of the PicoNews online website, at www.piconews.com. The websites main benefits are: An online catalog of known RSS feeds from a wide variety of categories. Registered PicoNews users can manage their subscriptions and feed options from their desktop web browser, rather than having to do so from their device. Automatic push of new stories and items for your subscribed feeds down to your device. Figure 4-15 shows the main PicoNews screen as seen on a BlackBerry device.
77
78
79
After adding the feed, my blog now shows up in the PicoNews main list for my subscriptions, as shown in Figure 4-17.
80
The Mail-to-Blogger address is a special e-mail address that you can use to post to your own blog, and it is in the form [email protected], where username is your Blogger username and secretname is a name you choose that will be unique for your Mail-to-Blogger address. Check the box labeled Publish if you want e-mailed comments to be posted to the blog immediately, or leave it unchecked if you want to have the opportunity to moderate or preview these comments before they are posted. One thing to note about the Mail-to-Blogger address. Regardless of how you as the author specified your blogs rules about who can post comments to your blog, anyone who uses the Mail-to-Blogger address can post to your blog! As long as you understand this and take appropriate steps to safeguard this e-mail address, it should not be a problem. If the e-mail address does accidentally get into the wrong hands and you start getting unwanted posts, you can either change your settings so that e-mail comments are not immediately published, or of course you can simply change the Mail-to-Blogger e-mail address to something different, which will have the effect of disabling any e-mail comments from those who have the older address. Once the Mail-to-Blogger setting is enabled, you can post comments to your own blog by simply creating an e-mail containing your comments and sending it to the e-mail address you specified as your Mail-to-Blogger address. This capability is not limited to BlackBerry posting. You can now post to your blog via Outlook, web mail, or any other means you have available for sending an e-mail message. But e-mail posting is especially wonderful for BlackBerry users because it gives you blogging options wherever you may be. For my test blog, I composed an e-mail on my BlackBerry, and set the to: address to be my blogs Mail-to-Blogger address. I then sent it. I then went to my laptops web browser to check my blog, and sure enough, my post was immediately reflected at the top of the blog (see Figure 4-19).
81
Of course, if youve followed the steps described earlier in the section Reading a Blog from Your BlackBerry and are using PicoNews, you can also see this blog posting on your BlackBerry.
Summary
In this chapter you learned how to start using your BlackBerrys browser to access content from the World Wide Web, and you became familiar with a series of hidden keyboard shortcuts that can be used to make the built-in BlackBerry browser more convenient to use. You also saw how BlackBerry web access can go way beyond viewing websites in a tiny browser window. Programs such as AskMeNow and Berry 411 leapfrog the browser entirely and deliver the online information you need without your having to navigate through page after page of slow-loading web content. Bringing the BlackBerry into the world of social networking, you also saw how to use your BlackBerry to participate in the fast-growing world of RSS feeds and web logs (blogs), both as a reader and even as an active participant. These capabilities are not difficult to add to your BlackBerry and greatly enhance your access to online news, headlines, and discussions.
chapter
in this chapter
f you are like many laptop users, sooner or later you travel someplace where your laptop cannot get Internet access, wireless or wired. You could be in a car, at an airport, in a clients building, or at any of a number of other places where a network hub or Wi-Fi is simply not an option for you. If you are ever in that situation, you may just find yourself staring at the BlackBerry, which is happily connected to the Internet and delivering your e-mail. You may be wondering, Hmmm. I have this great wireless device that can connect to the Internet just about anywhere. I wonder if I could somehow use it to get wireless Internet on my laptop. It turns out that you are not alone in wondering about this. How to use your BlackBerry as a wireless modem is one of the most often asked questions on BlackBerry discussion and customer support pages. Unfortunately, it is discussed so frequently because the information on how to actually make it work is so hard to find. Also, the information that is out there is based on guesswork or trial and error and is often confusing, outdated, or simply wrong. Research In Motion, in its own online support knowledge base, currently takes an official stance that using BlackBerry as an Internet modem is not supported. Even worse, the information that does exist needs to be regularly updated based on the arrival of new BlackBerry devices, new BlackBerry desktop software, and differences among the various wireless carriers that officially either support or do not support this feature. Despite all this, I can personally attest that it is indeed possible to use a BlackBerry device as a wireless modem on your laptop. I have made a successful connection, surfed the Web on my laptop, and retrieved my Outlook e-mail, using my BlackBerry wireless data service. There was definitely some voodoo that had to occur to get there, and it was a mighty struggle, but in the end it worked!
Accessing the Internet with your laptop and your BlackBerry Examining connection options Configuring your modem Connecting to the network
84
Finally, it is probably a good idea to check with your wireless carrier to see if you need to add any special features to your wireless data plan in order to enable dialup modem usage. Depending on whom you get on the phone, they may not even know what you are talking about, but its worth a try and it may save you headaches (or even additional charges) later on.
Wireless carriers can and sometimes do change their service plans, and wireless bills are notoriously difficult to comprehend, often using fine print or strange terminology to notify you of changes in your billing. It is a good idea to regularly review your bill and watch out for any change in the amount of your bill, just to be sure you arent being charged in error.
Supported Devices
Research In Motion claims in its knowledge base that a BlackBerry can be used as an external modem to connect a laptop computer to the Internet. It lists the BlackBerry models 7100, 7250, 7290, and 8700 as those to which this statement applies. However, it must be noted that despite this statement, RIM also does not offer any promise of user support for customers who try to use a BlackBerry for this purpose. Essentially this means that the potential is there to use your BlackBerry as an external modem, but you cant expect to get help from Research In Motion if it doesnt work or if you have questions about it. Rather than take on responsibility for this feature directly, RIM defers to the wireless carrier for any support issues related to the use of a BlackBerry as a modem.
85
Ive personally had success with both a 7290 and an 8700, using AT&T and Cingular. Various postings from www.blackberryforums.com and other sites around the Web testify success or failure with these and other devices using different carriers. So rather than making any sort of sweeping statement about which devices and carriers you can use the external modem feature with, let me simply recommend that you follow the steps and try it. The worst that can happen is that it wont work, but you may just be able to get it to work and enjoy a really useful new possibility with your BlackBerry!
86
87
FIGURE 5-1: The BlackBerry Modem Initialization String (for Cingular networks)
At this point you have successfully configured your BlackBerrys modem support (or so you hope!) for use with your laptop. This is the rough equivalent of purchasing an actual external modem and installing it as a modem on your computer. Now the next step is to create a network connection that uses your new modem.
88
89
If the connection fails, you may experience a variety of error messages and codes, unfortunately none of which will be very helpful in determining what went wrong. One thing to check that might just fix it is to make sure that IP header compression is turned off in your network connection. You can check this by following these steps: 1. Choose Properties Networking. 2. Then select the Internet Protocol item. 3. Choose Properties again to access the TCP/IP Settings page. 4. Click Advanced. 5. Under PPP Link, make sure that Use IP Header Compression is unchecked. If this does not improve things, my best advice is to retrace your steps in the three configuration tasks you just covered and also to double- and triple-check the modem initialization string, dialup number, username, and password supplied by your wireless carrier.
90
Summary
In this chapter youve seen how to dramatically add to the value of your BlackBerry by leveraging its built-in wireless data capability for use as an add-on dialup modem for your laptop. Although support for this feature can vary a great deal depending on wireless carrier and device model, getting it to work successfully means you will be able to get online with your laptop anytime, anywhere, without needing a phone jack or Wi-Fi hotspot. Given the potential benefit, I feel it is definitely worth the effort to try to get this feature enabled on your BlackBerry. With a little luck and perhaps even some support from your carrier, lets hope youll be online in more places than ever!
The Ultimate Remote Control: Controlling Your Desktop Computer from Your BlackBerry
chapter
in this chapter
Controlling your desktop computer remotely Browsing and downloading desktop files Managing FTP files and folders Discover mobile administration
s BlackBerrys become more powerful, add more storage space, and support faster wireless connections, we will naturally rely on them for more and more of our daily computing. Already we use our BlackBerrys to do e-mail, work our calendars, access the Web, and even work with attachments. Yet no matter how many useful tasks you use your BlackBerry for, Murphys Law says that there will always be some file, some piece of information, or some task for which you will need to connect back to your computer and network server. Perhaps I forgot to bring an important document on my business trip. Maybe I am at home and I get an e-mail from a client requesting a file that is back on my office network. Or maybe Im on the road and need to access my desktop computer and perform some daily or weekly maintenance task. Whatever the reason, the ability to connect back to a desktop computer or network server is a very common need. Indeed, for mobile laptop users a great many software solutions are available that can provide various kinds of remote access. In this chapter, I present an amazing and surprising variety of remote access programs that work on your BlackBerry. These programs let you use your BlackBerry as a remote terminal, grab files off of a server, and even view and control the screen of a desktop computer!
92
93
VNC
VNC stands for Virtual Network Computing. VNC allows a computer to connect to and control another computer over the Internet. VNC is different from more traditional proprietary remote control software products in the following ways: Cross-platform compatibility: The client computer does not have to be the same type of computer as the host. For example, a Windows computer can control a Linux computer. Cost: It is generally available for free (assuming it is for personal use). VNC software is available from www.realvnc.com, www.ultravnc.com, and other sources.
94
Mobile Desktop itself installs as a standard BlackBerry application. Once installed, you have the ability to define one or more remote computers that you wish to access and control. For each remote computer, you must specify the method used to connect (Terminal Services or VNC) as well as the IP address for the computer. Figure 6-1 shows the configuration screen for a remote computer connection. If youve done everything right and you have ensured the VNC or Terminal Services protocols are allowed through your firewall, you should now be able to connect to your target computer! Figure 6-2 shows Mobile Desktop in action, allowing me to remotely access Excel on my computer, although you can just as easily access iTunes or other software.
95
FIGURE 6-2: Working on an Excel spreadsheet from my BlackBerry with Mobile Desktop
So what was it like to be viewing and controlling my computer screen from my BlackBerry? Well, from a technical perspective alone, just the ability to see and work with my computer remotely from my BlackBerry is an amazing achievement. I can control iTunes and play music whenever I want! However, in my experience you need to level-set your expectations somewhat for the following reasons: The difference in screen dimensions between a typical desktop computer and a BlackBerry is dramatic, and you will be able to see only a portion of the remote screen at any one time. Even given that, text on the remote screen can be so small as to be barely readable. I ran Mobile Desktop on a BlackBerry 8700, which is much more powerful than many commonly used BlackBerrys. I also use Cingulars EDGE high-speed wireless network. Even with these advantages, redrawing the screen as I moved up and down was painfully slow, incurring waiting times of half a minute or more. On some occasions, the screen never updated, so I had to disconnect and reconnect to get things back on track. Using the mouse pointer to click the correct spot on the screen can be tricky, not to mention tedious.
96
FIGURE 6-3: Windows Terminal Services needs to take over the remote computers Windows login session
I want to point out that this step is not specific to ZZZ Softwares Terminal Services product. Rather, it is a feature associated with Windows Terminal Services implementation. True, if you are accessing your computer remotely, it is probably okay if you force the computer to log out and log in to make a connection. But if the remote computer is a shared resource or if
97
98
Avvenu
Avvenu is a file sharing solution that allows users of mobile devices and Internet-connected computers to access their files from their desktop computer. Avvenu is installed as a software application on your desktop computer, and after successful completion of the installation process, folders and files on your computer can be accessed from any computer or mobile device using just a standard web browser. A nice feature of this approach is that because Avvenu uses only standard web protocols, no security issues should exist in terms of allowing the software to operate through your Windows or network firewall. Once installed on your desktop, you can go to your BlackBerrys HTML Web Browser, enter the special Avvenu access URL of http://share.avvenu.com, and log in using your personal username and password. You are then greeted with a web browser screen displaying folders and files from your computer desktop.
99
The capability to browse and access your desktop files sounds great, but there are some problems with using a solution such as Avvenu on a BlackBerry device: Browsing through large folders can be very tedious. Only five or six listings are shown per page, so if there are dozens or perhaps hundreds of files, and you have to click Next to page through a folder, it will take a very long time to locate the file you want. Making the Avvenu client browser-based means that users dont have to install special software on the device; all they need is the BlackBerry Browser. But it also means that their user experience in browsing their desktop files will suffer the same limitations and frustrations as browsing through web pages. Pages are slow to display, images take a long time to render, and drilling down to subfolders and back up can be quite painful. This is not really Avvenus problem, but a BlackBerry does not have any built-in way to work with common document file types such as Word, Excel, PowerPoint, or PDF. This means that Avvenu users on a BlackBerry will not be able to download these file types to their BlackBerry. Certain browser-ready file types such as JPG and TXT are recognized and display nicely on the BlackBerry, but many (perhaps even most) of the file types you would want to access on your desktop will simply give you an error if you try to download them to your BlackBerry. Even if you were to go and purchase one of the several document solutions available for BlackBerry, those solutions do not work with native file types on the device, so that does not help in the Avvenu scenario, which totally depends on the ability of the web browser to recognize the file type. Despite these drawbacks, Avvenu does indeed work on a BlackBerry device and can be a worthwhile solution to look at if the supported file types you need to access are among the limited list of types that can work with BlackBerry.
100
Im In Touch
Im In Touch is, like Avvenu, a web browserbased remote access solution. Like Avvenu, Im In Touch relies on a desktop application that is installed on your computer and makes your files and other information available to you when you connect from another computer in this case, your BlackBerry. However, for BlackBerry device users, Im In Touch goes above and beyond the basic file/folder access capability offered by Avvenu and lets you actually view most document types on your BlackBerry. Im In Touch manages to do this by including a document converter utility with the desktop application. What happens is that when you select a document using Im In Touch on your BlackBerry Browser, the Im In Touch desktop service converts the selected document to a web-viewable format and then serves it to you in the browser itself. While this is still not quite the same as being able to download and work with a document in Microsoft Word, the ability to at least access and view the contents of a document can be very useful. Im In Touch does not limit you to accessing files and folders, either. When you log in from your BlackBerry, you are presented with a menu that lists the various types of information that can be accessed remotely, as shown in Figure 6-6.
As you can see from Figure 6-6, besides files and folders, Im In Touch can also remotely access your desktop calendar, contacts, and Inbox. You can even create an e-mail remotely and attach a file from your desktop to the e-mail! Im In Touch is available from 01 Communications at www.imintouch.net, and at the time of this writing, a subscription costs $99.95 per year or $9.95 per month.
101
EasyReach
EasyReach is a somewhat different product in that it focuses on the problem of searching for and finding information on your desktop. EasyReach indexes all of your documents, e-mail, contacts, appointments, tasks, and other information on your desktop, which then enables it to provide very fast searching of your data based on keywords. On top of general-purpose desktop search, EasyReach also lets you define projects that organize all of your content related to a specific topic in such a way that it is always collected together for you. EasyReach is primarily oriented as an information search and organization tool for desktop users, but the products relevance in this discussion is that it also offers remote users access to this information from a web browser or from a special BlackBerry software client that is installed to the device. When you run the EasyReach BlackBerry client, you are prompted to log in with your user name and password. After doing this, you are greeted with a very simple search form where you enter keywords that match the content you are searching for. As shown in Figure 6-7, you can specify the scope of your search to include documents, appointments, e-mail, tasks, contacts, or all of the above.
EasyReach then submits your search criteria directly to your desktop computer and returns any matching results, as shown in Figure 6-8.
102
A free trial download of EasyReach is available from EasyReach Corporation at www.easyreach.com. At the time of this writing, the basic EasyReach Find desktop software sells for $49.99 per computer and includes a 1-year subscription to the remote access service. The full desktop Workspace edition is $99.99 per computer.
103
Once the file listing appears, you can select a file and use the trackwheel menu to create, view, edit, rename, move, and delete folders and files; view images; change permissions; or even e-mail files as attachments to a specified e-mail address. Mobile FTP is available from Idokorros web site www.idokorro.com for $35 per license, and a free trial download is also provided.
104
105
Summary
In this chapter Ive shown you a variety of tools that enable you to use your BlackBerry as a remote control, remote command console, or remote administration tool for accessing networked desktop computers. If you are away from your desktop for much of the time, these tools can truly be a lifesaver by enabling you to do things such as find and forward an important file to your customer, execute a quick procedure on a server, or perform a remote backup. With the introduction of more powerful BlackBerry devices, better screens, faster processors, and faster wireless connections, these tools will no doubt become more capable and even more essential for performing remote tasks. In particular, process- and data-dependent tasks such as remote screen control and remote file access are just now appearing, and if current trends continue, should become more usable in the future.
chapter
odern BlackBerry device models are being sold with 32 megabytes and even 64 megabytes of memory storage on board, giving valuable breathing room for more e-mail messages, more contact records, more software applications, and more of everything. Yet its a pretty safe bet that most BlackBerry owners make use of only a fraction of that available memory. After all, current BlackBerry models do not come with MP3 or video capability, nor do they have built-in document editing support, so there are fewer things that BlackBerry owners can put on their device, versus someone who owns a Palm Treo or Windows Mobile handheld. They say that nature abhors a vacuum, and indeed the tendency among computer users is to try to fill any unused memory storage with more files. After all, why have a BlackBerry with 64MB of memory if you arent going to make full use of it? And for that matter, what exactly is on a BlackBerry, and how do you get files on and off of it? This chapter unlocks some of the mystery of what is stored on a typical BlackBerry device and how data is stored by BlackBerry programs. I then go further and show you how to copy files to and from your BlackBerry, effectively turning your BlackBerry into a kind of portable USB hard drive.
in this chapter
Exploring BlackBerry memory storage Mastering JavaLoader Listing files Uploading and downloading files Taking screenshots Transferring files with eFile
108
Table 7-1
Device Model
Obviously, the trend has been toward increasing capacity with each new device model or series. How much memory will come with future BlackBerry models is anyones guess, but its a pretty safe bet they will come with more than previous models. Currently, no BlackBerry devices have an expansion card slot, but a quick glance at flash memory SD card prices shows that cards with 256MB are incredibly inexpensive, and even 1GB, 2GB, and 4GB card configurations are all available for less than $100. So it is clear that how much memory comes on a given model is less a technical hurdle than it is simply a product pricing and customer demand issue for Research In Motion to work out. The technology to load up a small handheld with gigabytes of storage is here (as proven by Apples iPod).
109
110
Table 7-2
Command -usb Dir Deviceinfo Load Save Info Wipe Erase Screenshot
It goes without saying that you should use JavaLoader with extreme caution. Erasing the wrong file or wiping your device can have undesirable consequences and can even wreck your device! To be safe, always make sure you have a recent backup of your device before playing with a utility such as JavaLoader.
On my device, this command produces a listing, as shown in Figure 7-1. Each entry in the listing is a file that is currently stored on your device. Some are system files, some are applications, and others are resource files that support an application. A full listing of files on my device from JavaLoader shows 196 entries. This list scrolls far too quickly on my computer, so I use a handy DOS option called redirection, which causes the output from the JavaLoader command to be sent to a file instead of the screen, as follows:
javaloader -usb dir > FileListing.txt
111
Although not a true file utility, JavaLoader directory listings provide you with insight not easily obtainable by other means into what files are on your BlackBerry. It is interesting to see the system components as well as which files are consuming the most space.
112
This takes a snapshot of what is currently displaying on your device and stores it as a standard Windows bitmap (.bmp) file on your desktop. You can then open the bitmap file with Microsoft Paint or another image viewer program and rename it or do whatever you wish with it. Besides taking snapshots for books, this feature is quite useful for product documentation, web site demonstrations and discussions, PowerPoint presentations, or any other situation where you wish to show others an example of a BlackBerry screen.
Whats Missing?
JavaLoader is definitely a nice find for anyone interested in learning more about what is going on with the internal file system of a BlackBerry. But the fact that it able to work only with BlackBerry files is an unfortunate limitation that makes it not quite as useful as it would be if we were able to copy other kinds of files to and from a device, such as MP3 files or documents. For that, you look to another software utility called eFile.
113
As shown in Figure 7-2, on the left side of the eFile screen are folders for Local and Network files. On the right side of the screen, you see the files in the currently selected folder. Navigation between the panels and around the folders and files is supported using either the trackwheel or the menu system that pops up from the Start button at the lower left. One of the first things you notice is that upon initial installation, there arent any files in any of the folders. This seems a bit perplexing at first. Whats the point of a file explorer if it doesnt show you the files on your BlackBerry? This requires a bit of explanation. eFile does not actually show you any of the BlackBerry files, such as system files or programs, that reside on your device. Although that function would arguably be useful to some people, the real purpose of eFile is not to let you mess around with the built-in system files, but rather to let you copy ordinary documents, spreadsheets, and other file types from your desktop to your device. So how do you copy files from your desktop to your BlackBerry? This is where the eFile Desktop program component comes in. When you run eFile Desktop from your Windows Start button, it opens as a window with two panels, as shown in Figure 7-3. On the left side is a view of the folders and files on your computer. The drop-down list at the top lets you move up or down within the drives and folders on your computer. Below the dropdown is a list of files that reside in the currently selected desktop folder. On the right side of the eFile desktop display is a representation of the files on your BlackBerry that are managed by eFile.
114
To copy a file from your desktop to the device, simply select the file or files you wish to place on your BlackBerry, and click the arrow icon in the center that points to the right. eFile Desktop will then place the files in the list on the right side panel. During this process, eFile Desktop attempts to convert any files for which it has a file type plug-in. DynoPlex offers alternative programs for Word and Excel, and because of this, eFile automatically converts files of those types to its own internal eWord and eExcel formats. For other file types, no conversion is performed and the file is left intact, which generally means that the file will not be viewable on your BlackBerry. (If you do not want a Word or Excel document to be converted, you can change the file extension, for example .ddd instead of .doc.) The actual file transfer is triggered by invoking a synchronization session with your BlackBerry using BlackBerry Desktop Manager. The eFile synchronization process is then run by Desktop Manager and will automatically process any file actions necessary. Figure 7-4 shows the eFile BlackBerry display after successful synchronization and file transfer. To delete files from your BlackBerry, simply use eFile Desktops right side panel to select the files to remove and they will be removed from your BlackBerry on the next synchronization. Additionally, you can copy files from your BlackBerry to your desktop. eFile is available as a free download from www.dynoplex.com.
115
Summary
Despite the lack of tangible evidence on a standard BlackBerry device, there are some (barely documented) methods for discovering what files are actually stored on your BlackBerry and even for copying files between your BlackBerry and your desktop. With a little knowledge, BlackBerry owners can even exploit the information presented here to use their devices as a kind of portable external storage drive. It is pretty clear that eFile is intended to encourage users to try out the full eOffice suite, in order to enjoy the ability to launch into, view, and edit documents. But as simply a means for getting standard desktop files onto and off of a BlackBerry device, eFile does the job well enough on its own. The only real issue with using it as a way to turn a BlackBerry into a portable hard drive is eFiles habit of trying to convert files to eOffice format, but that can be worked around. Given enough available storage on your BlackBerry, eFile can be used in a pinch to transport files such as MP3, video, or even Windows programs and other files between your home and work computer or between any two computers. Of course you also need to have eFile Desktop installed on any computer you wish to copy files to from your BlackBerry, but given that it is a free download, this should not be a problem.
chapter
ost people find that once they start using their BlackBerry, it becomes the repository for much of the information they need in their personal and work lives. Certainly, your BlackBerry routinely and automatically delivers your e-mail messages to you. Your e-mail account settings and passwords are stored on your device. Plus, even simple e-mails sometimes carry important document attachments filled with important and perhaps even secret or proprietary information. It is likely that all of the addresses and phone numbers for your friends, family, customers, clients, and colleagues are stored on your BlackBerry. Also on your BlackBerry Calendar is likely to be a precise schedule for your whereabouts and activities on a daily basis. Finally, if you make use of any other BlackBerry software applications or services, other tidbits of information about you or your company are also possibly stored on your device. This is all good news, right? I mean, the whole point of carrying a great handheld device such as a BlackBerry is to have instant access to your important information. But what if your BlackBerry is lost, stolen, or even borrowed? You got it the fact that you will be without your constant BlackBerry companion is perhaps the least of your worries. Perhaps even more upsetting is the idea that all of your precious private data is now in the hands of someone else. It is a bit disturbing to think of all of your personal information being read by another person who has your BlackBerry. And just think about how your employer might feel if he or she knew that company e-mails, contacts, and activities were all out in the open. Think about the implications of all this for a moment, and I am sure you will realize that security on your BlackBerry is an issue that you want to learn more about. This chapter delves into methods of protecting against the loss or theft of the data stored on your BlackBerry. I cover how to use the BlackBerrys built-in password protection mechanism to secure your data. I describe available data backup and restore features to make sure that you have good backup copies of your data. I also present several third-party applications that can give you peace of mind by storing, securing, and even encrypting your BlackBerry data.
in this chapter
Securing your device with passwords Protecting your BlackBerry from Bluetooth devices Backing up and restoring your device and data Wiping and resetting your BlackBerry Extending your batterys life Securely storing your personal information
118
3. The Owner screen has only two fields: Name and Information. Enter your name in the Name field; in the Information field, enter as many clues as possible that could help someone who has found your BlackBerry contact you. Although you cant enter much text (the input field supports only 128 characters), at minimum it is a good idea to provide an e-mail address, a phone number, and a physical mailing address to which your device can be shipped.
119
To set a password on your BlackBerry: 1. Go to the Options application, and scroll down the alphabetical list of options until you find the Security category. Use the trackwheel to display the Security screen (shown in Figure 8-3).
2. Position the trackwheel on the Password field and click to enable the Password feature; when you go to Save, you are prompted to enter your password.
Passwords are required to be between 4 and 14 characters in length, and the device is smart enough to reject passwords that are considered to be weak, such as an obvious sequence like abcd or 0000. Any time you set your password, you are also required to re-enter and confirm your password a second time.
The Security Timeout field, also found on the Security Options screen, goes hand in hand with the password option, as it determines the amount of time your handheld is inactive before a password must be supplied to use the BlackBerry. By default, this is set to 2 minutes, but you can change it to be as short as 1 minute or as long as 1 hour. Set this to whatever time you are comfortable with. Dont set it so short that you are annoyed by having to constantly re-enter your own password, but dont set it to be so long that you run the risk of unauthorized access if you accidentally leave it behind on your airplane seat. You can also set an option in the Security Options screen to automatically lock the device if you place your BlackBerry in its holster, requiring a password to use the device once it is removed again from the holster.
120
121
Full Backups
BlackBerry devices do not support any kind of expansion memory card. To perform a full backup: 1. Connect your BlackBerry to your desktop PC using the supplied USB cable or cradle. 2. Run the BlackBerry Desktop Manager application on your PC, and double-click the Backup and Restore icon from the main screen. This brings up the Backup and Restore screen shown in Figure 8-4.
FIGURE 8-4: The Backup and Restore screen from Desktop Manager
3. From the Backup and Restore screen, click the Backup button, and choose a name and location for your backup file. Backup files use an .ipd extension, so a good convention might be to incorporate the backup date into the filename, such as 10-31-2005.ipd.
Be sure to note the storage location of your backup file, as you will need to know it if you ever have to restore your BlackBerry!
The Desktop Manager now proceeds to back up all of the user data on your handheld.
122
Selective Backups
Instead of backing up all of your handheld data, you can be more choosy about what gets backed up by using selective backup, which lets you choose exactly which application databases get backed up. So if, for example, you care only about backing up your Calendar data, you can speed up the backup by ignoring all of the other data on your handheld. To perform a selective backup: 1. Connect your BlackBerry to your desktop PC using the supplied USB cable or cradle. 2. Run the BlackBerry Desktop Manager application on your PC, and double-click the Backup and Restore icon from the main screen. This brings up the Backup and Restore screen. 3. Click the Advanced button to see a list of available databases. 4. Check each database that you wish to back up. 5. Choose File Save As to begin the backup to a filename and location of your choosing.
Full Restores
To restore your BlackBerry data from a previous backup session: 1. Connect your BlackBerry to your desktop PC using the supplied USB cable or cradle. 2. Run Desktop Manager and double-click Backup and Restore. This brings up the Backup and Restore screen. 3. Click the Restore button. 4. Navigate to the location where your backup .ipd file is stored, select the file, and click Open. 5. At the prompt, click Yes to restore all of your original BlackBerry data from the specified backup file.
Selective Restores
As with the backup function, you can choose to perform a selective restore on one or more specific databases, rather than choosing to restore all of your BlackBerry data. This option is useful if one of your application databases has been damaged or deleted or if you are moving to a different BlackBerry handheld and you want to move only certain data over from your old handheld.
123
Automatic Backups
Remembering to perform a regular backup can be a challenge. To ensure regular backups, you can configure the Desktop Manager to perform automatic backups of your BlackBerry according to a schedule. You can schedule a backup to occur as often as every day or, if you prefer, you can choose a longer interval. To set up an automatic backup: 1. Connect your BlackBerry to your desktop PC using the supplied USB cable or cradle. 2. Run the BlackBerry Desktop Manager application on your PC, and double-click the Backup and Restore icon from the main screen. This brings up the Backup and Restore screen. 3. In the Configuration section at the bottom, click the Options button. This brings up the Backup and Restore Options screen, which includes the Automatic Backup setting, as shown in Figure 8-5. 4. Select the checkbox under Automatic Backup to enable the backup interval input field. You can directly enter the number of days, or you can use the up and down arrows to increase or decrease the number of days to use as the interval between backups. As part of the Automatic Backup options, you can also direct Desktop Manager to back up all of your handheld data from all applications, or you can choose to exclude selected types of data from the backup. You may choose to exclude e-mail messages from your backup, or you may choose to exclude the built-in BlackBerry Calendar, Address, Task, and Memo application databases (described on this screen as PIM application data, where PIM stands for Personal Information Manager, a common term used to describe these four applications).
124
Automated backups will occur either on the days set by you in the Backup options or, if that day has passed, the first time you connect your handheld after the originally scheduled backup date.
3. Click Wipe Handheld, and then click Continue to erase your BlackBerry data.
125
126
Password Keeper
If you own a BlackBerry device running the newer BlackBerry OS 4.0 or later, you can find a built-in program called Password Keeper in the Applications folder that offers a simple utility for storing and tracking passwords and other data of a personal nature. Password Keeper, pictured in Figure 8-6, is not terribly full-featured, but it does support the basic ability to store generic password information.
With Password Keeper, you create one entry for each password you want to track. For each password, you can store a title, a username/login (if applicable), your password, a website (if applicable), and additional notes about the password. Figure 8-6 shows a Password Keeper entry for a fictional POP3 e-mail account, but Password Keeper can just as easily store passwords for web sites, online shopping carts, bank PIN numbers, and more. Access to the information you store in Password Keeper is itself protected by a password that you create the very first time you use the program. Thereafter, anytime you access Password Keeper, you are prompted to enter this password. You may find Password Keeper to be insufficient for your needs. One obvious drawback I found was that every type of password you store uses the same cookie-cutter set of five fields, regardless of whether the fields make sense for the password you are entering. For example, the website and username fields offer little value when entering a simple PIN code for a bank account. It would be great if Password Keeper offered form templates customized for different kinds of personal data such as PINs, e-mail accounts, frequent flyer programs, and more. If you are looking for more in a password-tracking program, you should read on to the next section, which presents a number of third-party add-on programs.
127
All three programs reviewed in the following sections test out well and serve as fine solutions for safely storing your personal information. All of them provide good password protection, data encryption, and a system for storing items of different types. Which one you choose to use depends on your experience and your preference for entering free-form versus structured personal data.
All of these programs are available for you to check out yourself at either www.blackberry.com or www.handango.com.
CryptMagic
CryptMagic by www.software-for-blackberry.com (see Figure 8-7) uses a category system to allow you to file your bits of personal information in Business, Private, or Unfiled categories. It also has a number of predefined templates, which are specially created to support data entry forms and fields for recording and storing bank, credit card, e-mail account, insurance, inventory, membership, software, and web login information.
Getting started with CryptMagic is easy. A free trial download is available on the Web that lets you play with the program before you decide whether to buy it. Installation is pretty simple and straightforward. (See Chapter 2 for more information on how to add downloaded third-party software applications to your BlackBerry.) Once you have downloaded and installed CryptMagic, you can launch it just as you would any of the built-in BlackBerry application icons on the home screen. You will be prompted to create a password specifically to protect the information stored inside of CryptMagic. (Dont get confused this password is separate and distinct from the password you use to protect your BlackBerry.) Enter a password of your own choosing, and you are presented with the CryptMagic main screen.
128
The user interface for MySafe+ is a bit different than CryptMagic and DataVault (see the following section) in that you create a new item with a name, and then it is up to you to associate as many fields as you wish with that new item. This turns out to be not quite as elegant as having predefined entry types such as Bank Account that automatically include all the necessary fields, but the MySafe+ approach could potentially be more flexible in that you can elect to store as little as one field of information or as many fields as you like. At the time of this writing, MySafe is available at the Handango store at www.handango.com for $27.
129
Summary
This chapter delved deeply into the issue of security and safety for the data stored on your BlackBerry device. As youve seen, data security is not achieved by implementing any single method. Rather, you need to incorporate a variety of techniques, including properly identifying your device in case of loss, enabling password security, implementing a regular schedule of backups to your desktop, and potentially investing in a solid third-party personal data storage solution. As anyone who has ever lost his or her data on a desktop, laptop, or handheld can attest, losing your work is no fun. When it comes to losing personal or other sensitive information, it can be not only annoying, but also downright scary and even damaging to your business or personal life. I hope that while it is fresh in your mind, you will now take the most important actions of all, which are to evaluate your own exposure to loss of data and use the information provided in this chapter to implement the security measures that make sense for you and your BlackBerry.
chapter
he BlackBerry first came to the attention of the general public when it began to be seen in the hands of financial analysts, stock traders, brokers, and portfolio managers. These people were the perfect early adopters for the BlackBerry, given their fast-paced working environment and their need to be in constant communication with colleagues and customers worldwide. Today, years after the device first gained recognition, it is of course common to see everyone from Hollywood celebrities to teenagers working their thumbs on their BlackBerrys. Even so, the product has become even more entrenched as a serious business tool and is now seen as standard equipment for just about anyone working in business. Obviously, the biggest draw of the BlackBerry is its wireless messaging capability, but through the addition of some excellent add-on software, your BlackBerry can help you be more productive in other areas of your working life. In this chapter. I show you ways to enhance your BlackBerry to be able to work with office documents, track your hours and expenses, and make your business travel more productive and pleasant.
in this chapter
Empowering your travel Learning languages Working with databases Tracking mileage, expenses, billing, and time
132
After the map renders on the BlackBerry screen, you can pan up, down, left, or right by using the trackwheel. You can also zoom in a level at a time by pressing the I key (the minus key), and you can zoom out by pressing the O key (the plus key). If you prefer a satellite map view, you can click the trackwheel and choose Satellite View instead of Map View. This will present you with a satellite image of your selected location, as shown in Figure 9-2. As with Google Maps, Google Local for Mobile will let you zoom down to a remarkable level of detail. For example, after zooming in several times on the Manhattan map, it is quite easy to see close-up snapshots of familiar New York City landmarks such as Central Park and the Statue of Liberty, all shown in great detail.
133
In terms of business productivity, the greatest benefits of using Google Local for Mobile lie in its wonderful ability to provide you with a method to quickly search for local businesses, as well as driving directions from point A to point B. To locate a business, click the trackwheel and choose the Search menu. Instead of a location, enter a business name or even a type of business that you are looking for. As an example, Figure 9-3 shows the results of my search for pizza in downtown Chicago.
FIGURE 9-3: My search for Chicago deep dish pizza shows promise.
As you can see, Google Local for Mobile plots the location of the nearest nine matching results for my pizza search. Now some of the thoughtfulness of the BlackBerry applications design comes into play. Because you dont have the luxury of using a mouse to point at the matching location you want to go to, Google assigns the numbers 1 through 9 to the first nine matching results. By simply pressing the BlackBerry keypad number corresponding to the matching result you want, you can view details for that location. Even better is Googles mobile support for getting driving directions to a location. You can either enter in your own starting and ending locations or use a search result (such as the preceding pizza search) as either the start or end point for your directions. Google then creates a route for you, complete with turn-by-turn directions, as shown in Figure 9-4.
134
Note at the bottom of the screen how I can use the number keys on my BlackBerry to move forward or backward through the individual segments of my route. As I move forward, the map changes to illustrate the route segment I am on, and moves me forward toward my destination (which is, of course, a nice slice of deep dish pizza!). I cannot recommend Google Local for Mobile highly enough. It is an extremely useful application to have on your BlackBerry, and its free!
Traffic Edge
A company called MAQ Software has produced a very unique software program called Traffic Edge, which will be of interest to anyone who commutes to a job. Traffic Edge offers real-time camera images and traffic maps for a sizeable number of cities and locations in the United States and even worldwide. When you install and run Traffic Edge on your BlackBerry, you are asked to choose a city or region, after which you can choose from among a number of traffic locations available within that area. You are then given a list of specific roads where either a traffic map or camera image is available. Choose a road or map, and after a brief pause, you are rewarded with a real-time picture of the traffic situation at that location! Figure 9-5 shows an example camera image from Traffic Edge.
135
WorldMate
WorldMate, by MobiMate, is a very popular application, having carved out a niche by offering a unified collection of handy information and utilities, which together meet the needs of the busy business traveler. WorldMate is sold as a subscription product and installs as a standard BlackBerry application icon on your home screen. When launched, WorldMates elegant and polished user interface (shown in Figure 9-6) presents a set of vertical tabs for world clock, flight schedules, maps, weather, currency conversion, and travel information.
FIGURE 9-6: WorldMates World Clock tab provides current time for up to five different world locations.
You can navigate among the different tabbed views by using the trackwheel (pressing the ALT key while scrolling makes the selection easier). Each tab has its own unique configuration options. World Clock lets you configure which cities to display, Flight Schedules lets you select your departure and arrival airport, and so on. All of the tab views are very professionally presented and formatted, and the configuration process for each is very easy and intuitive to follow. For example, I was able to quickly and easily bring up a weekly schedule of flights from Newarks Liberty Airport to Los Angeles (shown in Figure 9-7) almost effortlessly. Depending on your own personal preferences, each WorldMate tab may offer more or less value to you as a user. While I will admit that none of the individual tabs represents an earthshakingly powerful function, when they are all put together in as eye-catching a package as the folks at MobiMate have managed to create, it becomes quite an attractive package.
136
Check out MobiMates home page, www.mobimate.com, for more information on WorldMate and other mobile software applications, as well as a free trial download. WorldMate Standard Edition is priced at $34.95 for a one year subscription, while the Professional Edition adds wireless access to flight schedules and goes for $49.95.
Caffeine Finder
Ive heard it said that sleep is just a symptom of caffeine deprivation. Indeed, for some people, quickly locating a place to get a caffeine fix is a quest of the highest importance. While researching this book, I had the good fortune to come upon a great little BlackBerry software application called Caffeine Finder, written by a company called Greystripe. Now, you might wonder why Ive included a program whose sole purpose is to locate coffee shops in a chapter about business productivity, but I can personally vouch for how being in a highly caffeinated state many late evenings made it possible to write this book! Caffeine Finder downloads onto your BlackBerry and, once installed, will let you locate the nearest coffee shop based on an address, a city and state, or even a location from your contact list. The main screen for Caffeine Finder is shown in Figure 9-8.
137
Caffeine Finder will even give you directions to the selected coffee shop, using your location as a starting point, complete with a street map showing you where your cup of coffee is awaiting your arrival, as shown in Figure 9-10.
Caffeine Finder has other nice features, including the ability to automatically dial the shop from your BlackBerry phone, a small coffee trivia section, and the ability to fine-tune settings such as the maximum radius to search in. The program is not infallible it did not list one or two coffee shops in my area that I know of. But it did find most of them, and I suspect it is only as good as the source from which it is obtaining its coffee shop listings. All in all, I found Caffeine Finder to be a very nice program. Given how useful it is as well as the obvious effort Greystripe put into making the program work so well, I simply could not believe that it is available for free. I recommend you get it while its still free, at www.greystripe.com.
138
In addition to dictionaries, Beiks also offers a series of phrasebooks that offer translation of common phrases from one language into another. For devices capable of audio output (see the Beiks website for compatibility information) the application will even play an audio clip demonstrating how to pronounce the phrase in your target language. The Beiks EnglishGerman phrasebook is pictured in Figure 9-12.
139
E-mail Attachments
Chapter 3 presented several third-party software applications that offer more advanced attachment handling than that offered by the built-in BlackBerry Attachment service. Repligo and DocHawk both offer better attachment handling and viewing, while eOffice by DynoPlex takes a more comprehensive approach and goes beyond viewing, offering local document editing on your BlackBerry device itself. See Chapter 3 for more information on these applications.
The programs main strength is in the file formats it supports. No other BlackBerry program Ive seen can handle the database formats that Cellica does. However, the device-side viewer component itself is somewhat limited in functionality and offers only basic viewing of rowcolumn tabular data. You can edit fields and have those changes sent back to the desktop, but the changes are not reflected back in the device file in terms of formula calculations. For more information on Database Viewer Plus and other applications from Cellica, visit their website at www.cellica.com.
140
My Mileage Trackers main screen lets you enter your mileage traveled, view reports, and even send reports to your desktop via e-mail. In My Mileage Tracker, your mileage data is organized by which business client you are traveling for. Accordingly, the first thing you need to do is to create at least one client, using the Clients item on the main screen. Once youve created a client, you can start entering mileage records, representing the miles traveled for that client. This is done by selecting the Mileage item on the main screen with the
141
Each mileage record has a date and a starting and ending odometer reading. My Mileage Tracker automatically calculates the miles traveled for you based on this information. When you save your record, My Mileage Tracker will store your mileage in a database of mileage records associated with the specified business client. Tracking your mileage with no way to report it to anyone would be rather pointless, so My Mileage Tracker enables you to choose from a number of different pre-defined reports you can run on your mileage records, as shown in Figure 9-16.
Once youve selected a type of report, My Mileage Tracker prompts you to select a client, and then produces a viewable report on your BlackBerry, listing the mileage records and totals that match your reporting criteria, as shown in Figure 9-17.
Among other features, My Mileage Tracker offers a simple method of e-mailing your mileage records to yourself (or to another e-mail address) as an attachment, at which point you can print a report or integrate it into your own desktop-based reports. The program also offers some custom settings, such as using miles or kilometers. My Mileage Tracker is available for a free trial download from www.handango.com or from Sprite at www.sprite.net, along with a number of other business applications. The program costs $30 to purchase.
142
Expenses
Writing up expense reports is a necessary evil for thousands of sales professionals who must report on how much they spend, on what, and when. Tracking expenses can be fairly painless if good records are recorded at the time of the expense and kept on file. Then it becomes a simple matter of gathering them up periodically for a report. Unfortunately, keeping good records requires discipline, and people do not always stay in the habit of recording expenses at the time they are incurred, which means coming up with an accurate expense report is going to require a lot more time and effort. As with other tracking functions, expense tracking is a natural fit for the BlackBerry because your device is always with you, giving you the ability to quickly and accurately record expenses right on the spot. Given how widespread the need for expense tracking is, many applications have been developed for the purpose. Now take a close look at one of them, trackIT: Expense Edition, by Javatek Media. trackIT: Expense Edition installs as a standard BlackBerry application icon on your home screen. Running the application on your device produces a somewhat out of the ordinary main screen that uses a graphical workstation as the main menu for the programs features, shown in Figure 9-18. (Presumably the programs designers felt this was clever, although I imagine some users would prefer a more straightforward list of functions.)
Rolling the trackwheel over the various parts of the main screen image reveals the various program functions: Expenses, Accounts, Merchants, Categories, and more. I liked the fact that trackIT let me get right to the task of entering my expenses without requiring a lot of up front configuration of accounts and categories. Choosing Expenses from the main screen lets you create a new expense right away, which I did, as you can see in Figure 9-19.
143
As you enter more expenses, trackIT builds up your list of expenses for the month and lets you view them in the main Expenses screen (shown in Figure 9-20). This screen enables you to navigate to other months, duplicate or edit your expense items, and filter or sort your expenses by type or category.
Additional features are available from this screen, including nice looking graphs showing daily expense levels. When it comes time to creating your monthly expense reports, trackIT offers a rich set of exporting options. In addition to the commonly offered e-mail export option, the program is one of the few I have seen that offers its own desktop component, allowing you to use your BlackBerry USB cable to transfer your expense report from your BlackBerry directly to your PC. Many other export options are available, including formats such as CSV, HTML, and even Quicken and QuickBooks.
144
After saving a project description, all you need to do is select the In button to start the clock for a task you are going to work on for that project. While you work, the timer continues tracking your time, as shown in Figure 9-22.
145
Getting information off of your BlackBerry and onto your desktop is a challenge that many BlackBerry users face, and BizTrackIt takes the common approach of allowing you to send your records wirelessly to an e-mail address, where you can then save them or import them into another time tracking tool. BizTrackIt gives you a flexible report creation screen that allows you to specify which projects to include and which date ranges to draw records from. Your time records are then e-mailed to the address you provide. Figure 9-23 shows BizTrackIt e-mailing a report.
FIGURE 9-23: Sending a time and billing report from the BlackBerry to an e-mail address.
More information on BizTrackIt is available at www.shrunkenhead.biz, including a free trial download that will provide you with up to five free uses of the software. The software is available for purchase at a one-time cost of $34.99.
146
Summary
The vast majority of BlackBerry users in the business arena have no idea that their device can do anything beyond handle e-mail and phone calls. Proving that add-on software is not just about fun and games, this chapter presents BlackBerry applications that can seriously raise your level of productivity. The next time you are lost in an unfamiliar city, Google Local for Mobile can show you the way. Stuck in traffic in Silicon Valley? Check your BlackBerry to see where the tie-ups are. Need to document the hours and miles youve spent on a project? Track it all on your BlackBerry. The applications presented here are just a sample of what is available. Check out www.handango.com and the BlackBerry Software store to learn about more software applications for your device.
chapter
hile BlackBerry has a solid reputation as being a serious business tool, even the busiest executive needs some downtime sooner or later. Whether they confess to it or not, almost everyone who has a BlackBerry has given the built-in BrickBreaker game at least one try. But BrickBreaker is not the final word on fun and games for your BlackBerry. A number of third-party add-on applications have now been developed and are available for download and purchase. These titles range from card games such as Texas Hold em to puzzle games, golf scorecards, and even health and fitness programs. In this chapter, you take a look at a number of representative software programs from different categories. Their subject matter may not be terribly serious, but there is no doubt that some high quality programs are out there if you are willing to take a break from time to time.
in this chapter
Playing Texas Hold em Going golfing Playing chess Learning Sudoku Mixing drinks
Card Games
Poker games such as Texas Hold em have achieved unprecedented popularity these days, thanks in part to popular TV shows covering the World Poker Tour and celebrity tournaments. If you have played it, you know that the game itself is remarkably simple. It is played like regular poker but with community cards that are revealed in stages. The real excitement in Hold em is the betting. Few moments are as dramatic to watch as when a player pushes his chips to the center of the table and calls all in. In addition to poker games, card games in the Solitaire family have been popular for ages and have been the basis for many computer-based versions on desktops and mobile handsets alike. This section reviews a couple of available card game software titles that are available for BlackBerry devices.
148
When you begin a new game, you are dealt into a new Hold em game with five other computer-based players. These players quickly each take their turn and either fold or place bets until your turn comes up, as shown in Figure 10-2.
In the example game shown, I decide to stay in the game and use the trackwheel menu to call the bet. Subsequently, the flop happens and three community cards are turned over in the center of the table, as shown in Figure 10-3.
149
Although I had been hoping to see some cards that matched up with my queen, I decide to stay in a bit longer. Two more cards are turned in the center, one at a time, and as you can see in Figure 10-4, I wind up with a fairly ho-hum hand (two pairs, 8s and 6s), and only two of the other players have folded ( Jose and Kris).
FIGURE 10-4: Two pair. This cant be good enough to win, can it?
Still, its just play money, so I decide to stick around and see what happens. I check and the others do as well, so the hands are revealed, as shown in Figure 10-5. Amazingly enough, I almost have the winning hand with two pairs. I am just barely edged out by Jackie, who has 9s and 8s, which beats my 8s and 6s by a hair! Game over. Time to deal a new hand! Aces Texas Hold em, just like the real thing, is an addictive game that keeps you coming back for more. Concrete Softwares game is a great way to brush up on your Hold em skills and gain some experience without losing your shirt. If you like the game, there are an amazing number of books and videos that teach you to know when to hold em and know when to fold em so you can bluff and outwit your opponents.
150
Aces Texas Hold em No Limit is available for purchase online at Concrete Softwares website (www.concretesoftware.com), as well as from www.handango.com and the www.blackberry.com software store for $14.99. A free trial evaluation is also available.
Sol Mania
Another classic card game that has been adapted for BlackBerry handhelds is Solitaire. What most people think of when they hear Solitaire is the familiar game played with seven piles across, four home stacks that start with an ace, and a draw pile. This game is technically called Klondike and is, in reality, just one of many different one-player card games that are part of the Solitaire family of games. One of the best examples illustrating the sheer variety of Solitaire games that have been invented is the BlackBerry program SolMania, developed by Gera. SolMania installs as a standard BlackBerry program icon on your device and gives you 24 Solitaire variations you can play, from the classic Klondike to other popular games such as Free Cell, Spider, Canfield, and Pyramid. When you run SolMania, the main screen gives you access to each game variation via the trackwheel menu, as shown in Figure 10-6. You can scroll up or down through the list to access any of the 24 available games, or you can change game settings or access help.
151
To begin playing, use the scrollwheel to move around the stacks of cards and press the spacebar to select a card to move from one stack to another. Press the spacebar again to drop the card on the new stack. To draw new cards from the draw pile, you can press the D key on the BlackBerry keyboard. Similarly, if you select a card with the spacebar, you can use the H key as a shortcut to send to one of the four home piles. Within each Solitaire variation are custom settings you can apply to govern how scoring is done, as well as options such as three-card or one-card draw. Games can also be saved and resumed at a later point. SolMania is available from www.handango.com for $9.99 and is also available as a free trial download.
152
mScorecard
Several scorecard programs are out there for golfers, including Links Scorecast by Concrete Software (www.concretesoftware.com). One of the best scorecard programs Ive seen for BlackBerry handhelds is mScorecard, by Velocor (www.mscorecard.com). mScorecard is a very user-friendly program that at its most basic provides an electronic version of the paperbased scorecard you would normally use. But thats where the similarity ends. mScorecard goes far beyond what a paper scorecard gives you, and lets you track more details about your strokes, such as the number of putts, whether you hit the fairway or were left, right, short or long, up and down or sand saves, penalties, and club selection. Along the way, it tells you your total score so far and where you stand vs. par. You can score for just yourself, or for everyone in your foursome, and if your group is so inclined, you can even use mScorecard to keep score of a number of different sidegame variations. Even more impressive, mScorecard helps you share completed scorecards by letting you send completed rounds to yourself or your friends via e-mail. Velocor also offers a website to registered mScorecard customers where you can electronically post your rounds, review your history, track your handicap, and view statistics about your play.
153
Once you have entered (or downloaded) the course you will be playing, it appears in the course selection screen whenever you start a new round. Figure 10-9 shows mScorecards course selection screen after entering a course scorecard for Crystal Springs.
Once you have selected a course, you need to select the players you wish to score in this round. You can add as little or as much information about your partners as you wish. Once a player has been entered, you dont need to keep adding them for future rounds, as their profiles are stored in the mScorecard database. Figure 10-10 shows the player selection screen in action. You are now ready to tee off! mScorecard starts by presenting you with a scoring form for the first hole, as shown in Figure 10-11, and thereafter moves from hole to hole as you progress through your round. Entering scores is simple. Just use the trackwheel to navigate to the cell entry where you wish to record information and either type in a value or choose a value from the menu.
You can always go back and view or even revise your scores at any time during the round, which is nice.
154
When you have completed your round, mScorecard shows you your completed scorecard as shown in Figure 10-12. You can scroll up or down to see your overall scoring over the 18 holes, as well as the total against par at the bottom. You can also use the trackwheel to show a variety of statistics (see Figure 10-13) for the round, including net score vs. handicap, holes won, number of putts, eagles, birdies, pars, bogeys, and more. Think of how much arguing mScorecard will save you and your buddies as you review a just-played round at the 19th hole!
155
156
You are given a default club selection that is appropriate for your distance, but you can change the club selection if you wish to experiment. Based on wind conditions or the slope of the green, you can also adjust your aim to the left or right of the target, or keep it centered right at the target. Prior to each shot, the yardage, club selection and wind speed/direction are displayed at the upper right. To make a shot, Par 3 Golf uses the familiar golf arcade technique of displaying a vertical bar that represents how much of a backswing you wish to use, which affects how far the ball will travel. To start your swing, press the spacebar once (alternatively, you can click the trackwheel menu and choose Swing). You will see the vertical meter begin rising higher, representing a gradually increasing backswing. If you let the meter rise to the top, you are taking a full backswing. If you wish to use a shorter backswing for more control, press the spacebar at the point in the meter where you want to stop, and the golf swing will change from a backswing to a forward swing, striking the ball and following through. Figure 10-15 illustrates the golf swing process in Par 3 Golf.
157
As you complete each hole, Par 3 Golf displays your score, as shown in Figure 10-17. Play then advances to the next tee.
Although you can get around the course in far less time than it takes to play the real thing, game play includes the ability to pause a game and resume it later on. Par 3 Golf is an entertaining golf arcade game and is available for purchase from www.resetgame .com or www.handango.com for $9.95. A free trial version that unlocks only the first hole for play is also available. (Once you purchase the full version, the remaining 17 holes are unlocked.)
158
Board Games
Board games may seem like an odd fit for a tiny handheld like a BlackBerry, but surprisingly enough, many of the most popular board games have been successfully adapted for handhelds. Monopoly, Scrabble, and Yahtzee have seen successful representations for Palm and Windows Mobile handsets. Unfortunately, no adaptations of these board games exist yet for BlackBerry, but I am sure someone is working on it. Besides commercial board games, easily the most popular board game for handhelds is chess. The ability to play solo against a computer opponent or even wirelessly against a remote player makes chess an excellent game for BlackBerry, and indeed several chess games are now available.
On the New Game screen, you can choose to play against either a real human (sharing your BlackBerry between the two of you) or a computer opponent at various skill levels. You can also choose the visual style for both the board as well as the playing pieces. You can also choose to play over the network against another BlackBerry user by choosing Network Play for up to 15 active games at once. In Network Play, each move made by you or your opponent is sent over the wireless network and reflected in each players screen. When you are happy with your game settings, scroll down and choose Begin Game, which displays the chess board and pieces in the standard starting position, white vs. black, as shown in Figure 10-19.
159
If you are playing against the computer, the opponent quickly makes a move right after you have completed yours. The game proceeds as fast or as slow as you wish, until ultimately you (or in my case, the computer!) finally put your opponent in checkmate. (Take a look at Figure 10-20 for an example of my poor performance against the Medieval Kings computer!)
At any time you can save a game in progress and recall it at a later point to continue playing. Medieval Kings is available for only $8.95 from www.handango.com or directly from Magmic at www.magmic.com. A trial version is available that lets you play for a couple of days before buying. It is a great chess game for your BlackBerry and is perhaps the most compact way ever to take the wonderful game of chess with you anywhere you go!
160
Puzzle Games
Puzzle games are more popular than ever. Crossword puzzles continue to be a mainstay in the daily newspaper. Word games and memory games are fun for kids and grownups alike. But the most recent boost to the popularity of puzzle games is the Sudoku phenomenon.
Mobile Sudoku
According to some, the puzzle game called Sudoku has origins as far back as the eighth century, when it was derived from a similar game called Magic Squares played by the Chinese and passed to the Arab and European world. Although it has been played for hundreds of years around the world, the first puzzle wasnt published in New York until 1979. Even then, Sudoku became a daily fixture in daily newspapers and the general media only when the London Times started publishing Sudoku puzzles in 2004. From there it was picked up by other papers and eventually spread across the Atlantic to the United States, where it now enjoys tremendous popularity, spawning websites, clubs, books, and videos. The rules for playing Sudoku are pretty simple. The usual configuration of the puzzle grid is that of a 9 9 grid of squares, forming 9 rows and 9 columns. In addition, the grid is subdivided into nine 3 3 subgrids. Grids come with selected cells already filled in for you, and the object of the game is for you to fill in the missing cells of the grid using only the digits 1 through 9, such that each number appears only once in each row and column. So, for example, the number 4 can appear only once in any given row or column (meaning it will have exactly 9 appearances in the overall puzzle when completed). Further, each digit can appear only once in the smaller 3 3 subgrids. Traditionally, there is only one possible solution for any given puzzle. The last time I checked, I counted more than ten Sudoku games on www.handango.com, evidence that the availability of Sudoku on handheld devices has helped fuel its growing popularity. In this section you look at Mobile Sudoku by Icenta, Inc. (www.icenta.com/mobile). Mobile Sudoku enables you to play Sudoku games on your BlackBerry handheld. Game grids can be downloaded wirelessly or entered manually by you. Four new puzzles are made available for download each day as part of the application. Downloading a new game is as simple as choosing Get New Game from the main menu. It takes only a second or two to download. Mobile Sudoku presents a new game, complete with a set of already-entered values, to get you started. Your job is to fill in the remaining cells so that only one of each of the digits 19 appears in each row. Figure 10-21 shows a new Sudoku game, ready to play. To move around the grid, use the trackwheel. When you want to enter a value, just use the BlackBerry numeric keyboard. If you need to clear a cell value, use the 0 key. There are (as expected) endless websites and other resources dedicated to discussing Sudoku puzzles and strategies for solving. Two basic strategies are: Look at the rows and columns, and fill in the blanks by looking at the numbers that are already present in a given row or column. If only one blank cell remains in a given row or column, then just fill in the one and only number that can satisfy the row or column. If
161
Using each of these strategies (as well as in combination) doesnt necessarily quickly solve the puzzle, but it at least gives you a starting point. Naturally, as you start filling in the cells, some of the other rows and columns in the puzzle can become easier to solve because fewer valid digit choices will remain that will fit. For example, in Figure 10-21, I start by looking at the sixth column because it has only three empty cells. I can tell that the remaining three cell values cannot be a 9, 8, 7, 6, 5, or 4, because those digits are already present in the sixth column. Focusing on the top-most empty cell, I also can see that the top-center 3 3 grid already has a 2 and a 3 in it. So for this cell, there is only one possible value, 1, which I enter in Figure 10-22. Whew, only 49 more cells to go!
FIGURE 10-22: Ive figured out that 1 is the only possible value in the top-most cell of the fifth column
162
From this screen, you can browse and search three categories of mixology: drinks, shooters, and drop shots. You can also have Mobile Bartender find a random drink recipe for you or access a favorites list where you can maintain a growing list of the drinks that you find yourself serving up again and again.
163
Once youve found a drink recipe, just use the trackwheel to click and open it, and you are presented with a screen showing the ingredients for the selected drink, as shown in Figure 10-25.
If you would like to add a drink to your personal Favorites list, just click the trackwheel and choose the Favorite Menu. The Shooters database also has a handy Category search method, with which you can find a shooter using categories such as Candy, Sexy, or Fruity. (Certainly you can get yourself in a good bit of trouble in this part of the program!)
164
165
Most runners tend to use a couple of well-known routes that they have mapped out in their neighborhood or other runner-friendly locations. Running Log lets you create courses, which are simply named routes that you can then reference each time you add a new log entry. In the example shown in Figure 10-28, I have added two of my own common running routes.
Once you have built up a number of log entries, Running Log becomes a rich tool for viewing statistics and graphs on your progress in a number of areas, as shown in Figure 10-29. You can choose to view graphs that chart your progress according to duration, distance, calories, heart rate, pace, or weight, shown over a period of time. Use Running Logs statistics to find your longest run, farthest run, fastest pace, or other key statistics.
166
Running Log also provides a way to get your log entries off your BlackBerry and onto your desktop using a simple e-mail export feature. Choose the Export option, and Running Log prompts you for an e-mail address, as well as a date range encompassing the log entries you wish to export. Running Log e-mails a text file to the designated e-mail account. You can then choose to save this to your PC, print it, or import it into a database or other program of your choosing. Running Log costs $14.49 at the time of this writing and can be purchased at the Mobiteq website, www.mobiteq.com, or the Handango store at www.handango.com. A trial version is also available. If you are a biking enthusiast, you may be interested to know that Mobiteq also offers a similar program called Cyclists Log for BlackBerry.
Summary
This chapter has presented a number of representative software titles that are available to help you have a bit more fun with your BlackBerry, help you stay fit and trim, or even just waste a little time here or there, maybe at the airport or on the train. The programs reviewed here are among the most popular, but there are many more titles available in these and other categories, and new applications are being developed and published all the time. As mentioned in other parts of this book, a great place to find these programs is at Handango at www.handango.com or the BlackBerry software store at www.blackberry.com. After a slow start, the BlackBerry add-on software selection is now growing rapidly, so its a safe bet you will find many programs that match your interests!
Advanced BlackBerry Hacks: Put Your BlackBerry to Fun and Wacky Uses with Creative Software Projects
part
in this part
Chapter 11 Developing Your Own BlackBerry Applications Chapter 12 A Classic Sketcher Application Chapter 13 Music to My Ears: A Toy Piano in the Palm of Your Hand Chapter 14 Meet BlackBerry, Your Personal Masseuse Chapter 15 Printing Your Notes Wirelessly
chapter
ow that you know what your BlackBerry is capable of straight from the box, you can start to think about adding to its capabilities. This chapter focuses on working with Java application program interfaces (APIs) to create BlackBerry-specific software for your handheld. After you learn how to build the simple BlackBerry program in this chapter, you will be equipped to create programs that can perform a wide range of tasks serious and frivolous on your BlackBerry. However, if you have no interest in learning to program, you can safely skip this specific chapter. You dont have to be a BlackBerry programmer in order to have fun with the projects in the rest of this book.
in this chapter
Downloading the BlackBerry Java Development Environment Writing Java code Building your first BlackBerry application Debugging your application with the BlackBerry Device Simulator
When RIM created the BlackBerry device, the developers decided that it was important for the devices to be based on the Java platform. Thats why Java, an optional environment on Windows, is the only environment on the BlackBerry device. If you wish to create native software programs for your BlackBerry, you need to make sure that your programs work with Java. In addition to being a software environment, Java is also the name of the programming language used to create software programs that run on the Java platform. The Java programming language is similar in concept to other
170
171
172
System Requirements
The BlackBerry JDE is intended for use with Windows computers and works with Windows 2000 and Windows XP, specifically. The JDE also assumes that you have the Java 2 platform installed on your desktop computer; it will not work with the older Java 1.0 or 1.5 versions. You probably already have Java 2 on your computer. If not, you can obtain the latest version from sun.java.com. You should complete the Java 2 installation before proceeding with the installation of the JDE.
3. After filling out the required forms, click to proceed with the download. Because the JDE is a fairly large download (version 4.0.2 is almost 100MB), you need a reliable broadband Internet connection in order to download it in a reasonable amount of time. 4. After the download is complete, double-click to run the installer and follow the prompts to complete your installation.
When you download the JDE, you will see several different versions available, ranging from 3.6 through 4.1. These version numbers correspond to the BlackBerry OS version numbers. The basic rule of thumb is that if you create a program using a JDE version, your program will most likely run on devices with a BlackBerry OS of that version or higher. The development projects in this book use JDE 4.0.2 because it addresses significantly more devices than 4.1, which addresses only BlackBerry devices running BlackBerry OS 4.1.
173
The IDE is written in Java so, as with most Java applications, you may notice a short wait when you start the IDE while your computer loads the Java environment. Once it is loaded, you will see the main IDE screen, similar to the one shown in Figure 11-1. The IDE screen is divided into three main panels: Workspace: Located in the upper-left corner of the IDE screen, this panel is devoted to displaying a hierarchical view of your currently open workspace, including any projects contained within your workspace. (I discuss projects and workspaces in the next section.) This panel works much like a folder system on your computer and serves to organize your work.
174
175
Creating a Workspace
Because this is your first step toward programming your BlackBerry, creating your first workspace might seem like a momentous decision. But its really easy as mentioned previously, all you really need to do to create a workspace is decide what to call it and where to store it. To create a workspace: 1. Choose File New Workspace from the IDEs main menu.
You can have only one workspace open at a time. Therefore, if another workspace is already open and has any pending changes, the IDE prompts you to save your current workspace before creating your new workspace.
2. The Create workspace dialog box (see Figure 11-3) appears. Type your workspace name in the Workspace name field. If you plan to work on a series of related projects, give your workspace a name that will help you remember what the projects are collectively about. For this reason, I am using HackingBlackBerry as my workspace name. 3. Now choose a location to store your workspace file.
176
By default, the IDE suggests the folder where you installed the JDE (typically a path like C:\Program Files\Research In Motion\BlackBerry JDE\). I strongly suggest that you choose an easy-to-find location that will make it more convenient to work on your programming projects (for example, C:\Development\HackingBlackBerry). Storing your projects in the \Program Files folder makes it harder to remember to back them up, which means that you may lose your work if you ever have a computer failure or if you need to move to a different computer. Your project files are also prone to being lost if you ever uninstall and reinstall the JDE, as this may wipe out the JDE folder in the \Program Files area. Type in the path you want to use or click the Browse button to navigate to that path. If you want your workspace to live in its own subfolder (this is generally a good idea), go to the end of the path shown in the Create in this Directory field and add a forward slash, followed by the name of the folder you want to use. If the folder does not exist, the IDE will create it for you. As you can see, I am storing the HackingBlackBerry workspace in its own folder called /HackingBlackBerry. 4. To create your workspace file, click OK. The IDE automatically opens your new workspace, displaying it as an icon at the top of the Workspace panel of the main IDE window.
Creating a Project
Once youve created your workspace, you can populate it with one or more BlackBerry programming projects.
In the IDE, a Java project is not tied to any specific workspace. Rather, it becomes part of a workspace only when you specifically add it to your workspace. In fact, a project can be part of multiple workspaces. Think of it this way: A recipe for pasta primavera might be part of your Favorite All-Time Italian Dishes category, but it might also be part of your upcoming Holiday Dinner menu. In fact, you are likely to use that recipe in many culinary projects over time. Similarly, if you create enough BlackBerry programs, you will build up a number of projects and many of them may prove useful in multiple workspaces at different times.
To create a project: 1. Choose Project Create New Project from the IDEs main menu.
177
Although this dialog box is visually similar to the Create workspace dialog box, the choice you make here is a bit more important. Your project name is tied to the name of the program you will be creating, and it has repercussions in terms of the names used in your Java source code. A good rule of thumb is to think about what you would like your program to be called, and use that as your project name. Accordingly, I am calling my project HelloBlackBerry. 3. Choose a location to store your project file. As with workspaces, it is a good idea to carefully consider where on your computer you want your project and project source files to live. Although (unfortunately) the IDE does not enforce this concept, creating a separate folder for each project you work on is important; otherwise, all your project and source files will become hopelessly intermixed within the same folder. You can create a folder for each project under the main workspace folder but because projects arent necessarily used in only one workspace, you are free to create project folders outside of the workspace folder. I am storing my HelloBlackBerry project in a new folder within my HackingBlackBerry workspace folder. As with workspaces, you can force the IDE to create your folder for you by appending your new folder name to the end of the path shown in the dialog box. 4. To create your project file, click OK. The IDE creates your new project file with a .jdp extension in the folder you specified. If you already have a workspace open, the BlackBerry IDE will automatically add your new project to the currently open workspace. If you did not have a workspace open when you created your project, or if you wish to add an already existing project to a new workspace, choose Project Add Project to Workspace from the IDEs main menu. Select the .jdp file representing the project you wish to add to your workspace and click OK to add it. At this point, the IDE main screen should show your workspace and your first project in the Workspace panel, as shown in Figure 11-5.
178
FIGURE 11-5: The HelloBlackBerry project, shown as part of the HackingBlackBerry workspace
179
180
You should give your source file a meaningful name. In the HelloBlackBerry project, you will have only one source file, but larger projects often have multiple source files. The standard convention is to name your source file after the main class, which is defined in the file itself. Always use an extension of .java. For this project, I am using HelloBlackBerry.java as the name of the new source file. 3. In the Create source file in this directory field, enter the location where you wish to store your .java source file. (You dont have use the default project directory.) Large projects may store source files in many areas, but with this simple project you can store everything in one folder. 4. Click OK to create your new source file. At this point, the IDE should look something like the screen shown in Figure 11-8. Note that the IDE has opened a new Java source file in the Editor panel. In addition, it has created a new file entry in the Workspace panel under your project node. Depending on your IDE settings, some basic skeleton code and comments may be created for you in the new source file.
181
To write your program: 1. Delete any previous code that the IDE may have generated for you, and type the preceding code into the HelloBlackBerry.java window in the Editor panel.
The Editor panel works the way you might expect: Like NotePad and Word, it allows standard typing, deleting, and highlighting. The IDE editor also supports additional editing features, which you can learn about in the IDE Help.
2. Once you have typed or pasted in the code, save your work by going to File Save.
182
FIGURE 11-8: The HelloBlackBerry project after creating the new HelloBlackBerry.java source file
If you dont wish to type in all the code manually, the complete source code for this chapters project is available on the Wiley web page at www.wiley.com/go/extremetech.
Now you can break it down by doing a simple top-to-bottom walk-through of the HelloBlackBerry program code you just wrote. Because the code references specific pieces of the BlackBerry APIs, it starts off with these three import lines:
import net.rim.device.api.ui.*; import net.rim.device.api.ui.component.*; import net.rim.device.api.ui.container.*;
In order for the IDE to build HelloBlackBerry, it needs to resolve any references to the BlackBerry API. The standard way to resolve these references is by using the import statement, which serves to tell the IDE where the relevant BlackBerry feature is defined in the SDK. This code has only two tiny classes, but they do the remarkable job of starting up HelloBlackBerry as a real BlackBerry application. The first class in the HelloBlackBerry.java source file is the
183
This section of code begins with the class declaration for HelloBlackBerry. Note that HelloBlackBerry extends a class called UiApplication. Any BlackBerry application that provides a user interface extends UiApplication, a BlackBerry class found in the net.rim.device.api.ui package (hence the first import statement). The extends keyword is basis for inheritance in Java. So essentially with this first line you are saying, I am declaring a new class HelloBlackBerry, and I wish it to inherit all of the behaviors found in the UiApplication class. All BlackBerry programs start at a special function called main(), so it stands to reason that the main program class HelloBlackBerry should have a main() method. The code public static void main(String[] args) signifies that the HelloBlackBerry class has a main() method and that the lines of code in main() will be executed at program startup. In this simple HelloBlackBerry program, main() does the bare minimum job of creating an instance of the HelloBlackBerry class and starting the necessary event-handling process by calling enterEventDispatcher(). Doing this allows a BlackBerry program to listen in on and participate in system events and messages and is a standard part of any BlackBerry application. The other piece of your HelloBlackBerry class is the constructor. All classes have a constructor, which is the place where an instance of a class can perform any tasks that must be taken care of when the instance comes to life within a program. In the HelloBlackBerry program, the constructor does one thing: launches the user interface for itself by creating an instance of the HelloScreen class using the inherited pushScreen method of UiApplication. The second class in the HelloBlackBerry.java source file is called HelloScreen:
class HelloScreen extends MainScreen { public HelloScreen() { super(); LabelField applicationTitle = new LabelField(Hello BlackBerry Title); setTitle(applicationTitle);
184
RichTextField helloWorldTextField = new i RichTextField(Hello BlackBerry!); add(helloWorldTextField); } public boolean onClose() { Dialog.alert(What? Leaving so soon?); System.exit(0); return true; } }
The HelloScreen class is responsible for handling the (rather simplistic) HelloBlackBerry user interface by inheriting from the BlackBerry MainScreen class, which in turn inherits from the Screen class. All this inheritance means that the simple HelloBlackBerry program gets to enjoy some automatic menu handling, such as presenting a standard Close menu when the user presses the Esc key. It also gives the HelloBlackBerry program the ability to listen for trackwheel and keyboard events, which are notifications sent to your program when the user operates the TrackWheel or presses a key on the keyboard. The constructor for HelloScreen is responsible for setting up the initial appearance and layout of the HelloBlackBerry programs main screen. The first thing HelloScreen does is invoke the constructor for its MainScreen parent by calling super(). Next, it sets contents of the application title bar to be Hello BlackBerry Title by calling MainScreens setTitle method. HelloScreen passes the title text into setTitle by creating a LabelField user interface and setting it with the desired text. Finally, it displays the message Hello BlackBerry on its screen by creating a RichTextField object and adding it to the screen layout.
Even HelloScreens short constructor calls our attention to some new and unfamiliar concepts, such as LabelField and RichTextField, which are user interface classes that are part of the BlackBerry API and described in full in the JDE developer documentation. Many other interesting user interface classes useful for more complex programs than HelloBlackBerry are also described in the API. One of the nicest things about object-oriented programming, as well as the Java programming language and the BlackBerry API, is that you can begin to use some fairly complex system facilities with very little knowledge or effort. HelloBlackBerry is a fine illustration of that benefit.
The last portion of code is HelloScreens onClose() method. The onClose() method comes from MainScreen and is automatically called when HelloScreen closes. HelloScreen responds to this call by first showing an alert dialog box, and then asking the system to close the HelloBlackBerry application.
public boolean onClose() { Dialog.alert(What? Leaving so soon?); System.exit(0); return true; }
185
186
187
188
These figures show the Simulator looking and behaving like a BlackBerry 7290 device, but you can configure the Simulator to resemble other BlackBerry models as well. To do this, go to the Edit Preferences menu option in the IDE, choose a different device in the General tab of the Preferences dialog box, and click OK. The next time you launch the Simulator, your selected device will be the model for that Simulator session.
189
190
Summary
Compared to whats known about more widespread environments such as Windows, there is simply not a great wealth of information available to the general public on BlackBerry programming. In some cases, the only way for you to learn how to do something is to try it for yourself. If you are familiar with Java programming and would like to learn more about how to program for BlackBerry devices, I recommend that you continue working with the BlackBerry IDE. Learn as much as you can from IDE Help (the provided developer documentation) and the sample code that comes with the JDE. Additionally, many great resources are available to you on the BlackBerry developer website at www.blackberry.com/developers. You can also join online communities (check out the BlackBerry developer website or search Yahoo! or Google) to get connected with other developers. If you have a programming background but are not familiar with Java, a good next step would be to visit the java.sun.com Java Developer website to learn about Java programming in general. If you know another programming language, especially C++, you will be surprised by how quickly you can pick up the basics of Java programming. If youre just a brave soul who doesnt consider yourself to be a programmer but are nevertheless interested in learning how to create custom BlackBerry programs of your own, one of the best ways to learn is to experiment. Because learning to program for a new computing device and operating system in the space of a single chapter is a challenge, the subsequent chapters in this part will build on the basics to help you create your own custom BlackBerry programs. Writing your own BlackBerry programs is the ultimate in hacking BlackBerry because you can do virtually anything you want!
chapter
n just about every kind of computer you can think of, desktop or mobile, big or small, you can find a graphics drawing program that lets you perform basic line drawing and other functions. On desktops, the availability of pointing devices (for instance, the mouse) makes this kind of program possible, while on mobile devices a touch screen and stylus supply similar support. The BlackBerry device has no touch screen or pointing device, and there are currently no widely known or available drawing programs for BlackBerry devices. In considering the physical design of the BlackBerry, I was struck by an odd similarity to the classic Etch-A-Sketch childrens drawing toy, and I quickly came up with the idea to create a BlackBerry program that mimics the Etch-A-Sketch both in terms of the drawings and the controls. In this chapter, you will continue with another custom software project, which I have dubbed SketchBerry. As you create SketchBerry, I cover such topics as how to capture user trackwheel events, how to draw graphics on the screen, and how to work with bitmaps.
in this chapter
Designing a drawing program Capturing trackwheel events The BlackBerry graphics interface Drawing on the screen
192
193
194
The SketchBerry code listing is short enough to present just about all of the code here in printed form, but please note that complete source code for the program described in this chapter is available for download on the Wiley website at www.wiley.com/go/extremetech.
This section walks you through the steps involved in coding the SketchBerry program as it follows the rough project breakdown and design presented in the previous section. The code listings are from a single Java source file called SketchBerry.java. As with HelloBlackBerry and the other software programming projects in this book, you need to create a new workspace and new project in the BlackBerry JDE in order to be able to build and run SketchBerry.
195
This declaration tells the BlackBerry OS that HelloBlackBerry should assume behavior consistent with that of the built-in UiApplication class, unless it is told otherwise. But what if you wanted your program to act slightly differently than the base UiApplication class? Would you have to abandon UiApplication entirely and add all of that default behavior yourself, just because you want to change one or two things? Absolutely not. One of the best things about working with objects and classes in Java is that you can decide which behaviors you want to keep and which behaviors you want to override. If you dont like a specific behavior provided by a base class, all you need to do to change it is replace that one behavior with your own code that does things the way that you want it to. When you do this, what you are telling the BlackBerry OS in effect is Gee, thanks for offering this great function, but I think Ill handle it myself. All BlackBerry programs that extend UiApplication get some free trackwheel handling as part of the deal. As you saw with HelloBlackBerry, a UiApplication-based program automatically knows how to handle some trackwheel events for you. This includes the display of a Close menu when you press and release the ESC button and the display of context-specific menus when user interface elements such as fields are present on the screen. Your design for SketchBerry calls for the use of the trackwheel as the control knob for positioning and drawing on the screen. This is definitely not standard UiApplication behavior, so you need to override the default trackwheel methods and provide your own functionality that does what you want. In order to do this, you need to add custom handlers for the built-in methods trackwheelClick() and trackwheelRoll().
196
By default, your application never sees these events, and the system takes care of them on your behalf. But by making your class TrackwheelListener, you get the opportunity to see these events inside your application and even perform your own custom actions when the events occur. So how do you make your class TrackwheelListener? Its actually easy. All you have to do is add the syntax implements TrackwheelListener to the class declaration line, like so:
public class SketchBerry extends UiApplication implements TrackwheelListener
This allows your class to add the special methods trackwheelClick, trackwheelUnclick, and trackwheelRoll. Note that you dont need to add all three methods. You can add one or two of them if thats all you need. Most applications listen for trackwheel events so that they can create and display their custom menus at the appropriate time. In SketchBerry, you have a different purpose in mind, which is using the trackwheel to change the current drawing position on the screen. Take a look at some code that will process the trackwheelRoll event:
public boolean trackwheelRoll(int amount, int status, int time) { if ((status & TrackwheelListener.STATUS_ALT) == 1) { _horzPos += amount; } else { _vertPos += amount; } return false; }
Once added to your code, the trackwheelRoll method will be called within your program each time the trackwheel is rolled up or down. If the trackwheel is rolled down, the amount parameter is positive, and if the trackwheel is rolled up, the amount parameter is negative. What does the value of the amount parameter actually represent? Whatever you want it to represent. For an e-mail program that lists messages, it might make sense for this value to be the number of messages to scroll up or down in a list. In the MemoPad viewer it might be best to map this to the number of lines of text to scroll up or down. In SketchBerry you want to give the user a certain degree of precision with which to draw line segments, so you will interpret the amount parameter as the number of screen pixels to move the drawing cursor up or
197
By adding the value of the amount parameter to _newVertPos, you are able to track the movement of the SketchBerry cursor up or down the screen. As mentioned in the earlier SketchBerry design section, horizontal drawing is enabled by pressing and holding down the ALT key. You can tell whether the ALT key is pressed by using the following piece of code:
if ((status & TrackwheelListener.STATUS_ALT) == 1)
So if the ALT key is pressed, your code applies the amount value to the horizontal position variable _newHorzPos; otherwise it is applied to the vertical position variable _newVertPos.
198
199
In trackwheelRoll(), you now will use the amount parameter to update the New position variables:
if ((status & TrackwheelListener.STATUS_ALT) == 1) { _horzPosNew += amount; } else { _vertPosNew += amount; }
200
As each paint() request is processed, you also need to make the end point the new starting point for the next line segment:
_horzPosOld = _horzPosNew; _vertPosOld = _vertPosNew;
Finally, you need to be able to trigger a paint() call in response to each trackwheelRoll event by calling invalidate at the end of the trackwheelRoll() handler:
_mainScreen.invalidate();
201
202
Another problem with the current code is that even if invalidate() did not erase the entire screen, other things could ruin the SketchBerry drawing. For example, the user could pop up a menu. When the menu went away there would be no way to go back and redraw the portion of the current sketch that was erased. What SketchBerry needs is a way to not only draw new line segments as you move around the screen, but also a way to render the entire set of line segments drawn so far the whole picture, on demand, anytime. The most common way to solve this problem is by using an off-screen bitmap. With this technique, you do not draw directly on the screen. Instead, you draw only to a bitmap that is the same size as the screen. Then, whenever you need to display your drawing, you simply copy your bitmap to the screen. Because nothing ever erases the contents of your bitmap, it always contains a perfect representation of the entire drawing. In the next section, you see how to implement the off-screen bitmap technique, and you complete the SketchBerry program.
Through the magic of the BlackBerry Graphics class, you will be able to draw lines on an offscreen bitmap without knowing anything about the actual memory format of the bitmap itself. This small piece of sleight of hand is accomplished by creating your own Graphics object. So far, the Graphics object you have been working with is one that has been passed to you by the paint() method. But you are free to create your own Graphics object and draw into it for whatever reason. To construct a Graphics object for this purpose, you need to pass it a bitmap that will act as the drawing surface:
myGraphics = new Graphics( myBitmap );
So, to create an off-screen Graphics object that matches the dimensions of the BlackBerry screen and can be drawn to, you would use the following code:
// obtain the width and height of the screen // and create a bitmap with those dimensions myBitmap = new Bitmap( getWidth(), getHeight); // create a graphics object which will use the bitmap as its // drawing surface myOffScreenGraphics = new Graphics( myBitmap );
203
Now, in paint(), instead of drawing on the screen Graphics object, you can draw on this off-screen Graphics object:
myOffScreenGraphics.drawLine (_horzPosOld _vertPosOld, _horzPosNew, _vertPosNew);
Okay, so youve created an off-screen Graphics object with a bitmap, and you can draw SketchBerrys line segments to it. You now have a perfect way to record all of SketchBerrys drawing actions by writing them to a bitmap that never gets erased. But how do you get the contents of this bitmap to show on the BlackBerry display? You might be inclined to scan through the list of Graphics and Bitmap class methods in the BlackBerry developer documentation, looking for a helpful function with a name like CopyBitmapToScreen or Copy(src, dest). Well, there is no such thing. The method you want comes with the unlikely name of rop(), which stands for raster operation. A raster operation can be thought of as a manipulation of image bits in some manner. If you look at the API documentation for rop(), youll note that it can perform quite a number of interesting and obscure operations on images. The reason for this is that any drawing function on BlackBerry, from text to bitmaps to lines to backgrounds, eventually resolves down to a raster operation. For your purposes, you dont need any of the more exotic raster operation types. All you will use is ROP_SRC_ALPHA, which simply copies a source bitmap to the destination Graphics object. Thus, to copy your off-screen bitmap to the Graphics object passed to you by paint(), and of course the BlackBerry screen, the following code does the trick:
gr.rop(gr.ROP_SRC_ALPHA, 0, 0, getWidth(), getHeight(), myBitmap, 0,0 );
This piece of code says Copy the contents of myBitmap, using the origin (0,0), to the screen Graphics object at coordinate (0,0). Now revisit your paint() routine, and use the new offscreen bitmap technique:
protected void paint(Graphics gr) { if (_drawing) {
204
_myOffScreenGraphics.drawLine (_horzPosOld, i _vertPosOld, _horzPosNew, _vertPosNew); } // make sure you always draw the last good screen i bitmap from the off-screen bitmap gr.rop(gr.ROP_SRC_ALPHA, 0, 0, getWidth(), getHeight(), _myOffScreenBitmap, 0,0 ); _horzPosOld = _horzPosNew; _vertPosOld = _vertPosNew; }
Your paint() routine now draws each new line segment into the off-screen bitmap and then slams the bitmap onto the screen using the super-fast rop() method. If you compile and run SketchBerry with this technique, youll see that it works great.
Using SketchBerry
To compile, build, and run SketchBerry, youll need the full source code for SketchBerry.java. Youll also need to have created a workspace and project for SketchBerry in the Java JDE. Once built, SketchBerry installs to your BlackBerry as a standard application, through the BlackBerry Desktop.
205
FIGURE 12-2: Hmm. This could take a long time to get good at . . .
As with the original Etch-A-Sketch, it takes quite a bit of patience and skill to create a drawing of any higher complexity than a rectangle, but you will see that the SketchBerry program is essentially true to the original model in its usage and results.
For more information on the BlackBerry Simulator, please refer to Chapter 11.
206
Summary
In this chapter you saw how to take a simple do-nothing BlackBerry application skeleton and build it up to handle more sophisticated tasks such as trapping trackwheel events, drawing on the screen, and working with off-screen bitmaps. The result is a real, working sketch program for BlackBerry devices. SketchBerry is by no means a commercial-quality program but its easy to see where additional features and capabilities would push it closer to that goal if you were up for doing further work. Some obvious areas where improvements can be made are: Ability to save your drawings as named bitmaps Ability to load saved drawings from memory Change color of the lines drawn An erase feature An undo feature Better controls for switching between horizontal and vertical direction Beyond these, you can, of course, go well beyond the Etch-A-Sketch model and add more sophisticated drawing tools for text, shapes, and color. With the introduction provided in this chapter, these features should be within your reach.
chapter
lackBerry is not particularly known for its multimedia capabilities. In fact, a quick scan through the icons on the BlackBerry home screen reveals very little evidence of fun at all the applications are all about business and productivity. While BlackBerry competitors such as Palm and Windows Mobile have long promoted the ability to play music, display photos, take pictures, and even work with digital video, RIM has kept the focus on work and not play within the BlackBerry product family.
in this chapter
Understanding BlackBerry audio Playing musical notes Capturing KeyPad events Mapping BlackBerry keys to piano keys Creating menus Creating a keyboard instrument
In some cases the unfortunate lack of BlackBerry media features simply boils down to holes in the device hardware. For example, no BlackBerry device released to date has support for an expansion card slot. The lack of this slot means that users can put on their device only those files that will fit in the relatively small main device memory. This effectively eliminates the possibility of storing any realistic MP3 audio or digital video files, which generally require many megabytes of memory each. Until recently, the built-in processor of the BlackBerry was too feeble to be able to conjure up the horsepower necessary to handle music and video. Yet the newest BlackBerry devices, the 8700 and 7130, have improved screen displays, stronger processors, and better system level audio capabilities. Ringtones available for these devices show that reasonable audio quality can be had. As a result, the main barriers to making a BlackBerry more multimedia-friendly would seem to be the lack of software applications that play audio and video. In this chapter, I thought it would be fun to take a crack at exposing some of the BlackBerrys audio capabilities by creating a program that can play music. While playing MP3 audio is still problematic because of the lack of device memory storage, I wondered whether you could simply create your own music. So I decided to try to create a simple piano program that let you play different notes in a scale, just like the keys on a piano. The techniques used in the PianoBerry custom software project build on the basic BlackBerry programming concepts youve already covered in the development project chapters. New areas I cover in this chapter include how to access the BlackBerry speaker through the system audio support, how to define musical tones that match the notes on a piano, and how to add BlackBerry keypad control.
208
Its always a good idea to check your assumptions about device capabilities instead of just going ahead and calling functions that may fail (or worse) because the support is not there.
Using ADPCM or MIDI is beyond the scope of this chapter, but if you have an interest in producing more complex sounds, it will be useful to determine what level of sound support is found on a given device.
209
Table 13-1
Note A Bb B C Db D Eb E F
210
Table 13-1
Note Gb G Ab
Continued
Frequency 740 784 831
211
212
Now you need to add menu handlers for each of the menu items that are added to the menu in makeMenu(). First you add a simple closeItem handler, as shown here:
private MenuItem _closeItem = new MenuItem("Close", 0, 0) { public void run() { Dialog.alert(What? Leaving so soon?); System.exit(0); } };
Now, all this menu handler does is pop up a dialog box alert prior to exiting, but you can, of course, enhance it to allow the user to cancel the closing operation or do anything else you want. Next, you add a handler for the AudioSupportItem menu item. AudioSupportItem will use the Alert functions covered earlier in the chapter to query the system and find out what level of audio support is included on the device PianoBerry is running on. Regardless of any other supported audio interfaces, PianoBerry uses only basic audio, but the query is nonetheless
213
This menu handler uses the Alert class interface to query the system and see if the three main audio subsystems are supported: Audio, ADPCM, and MIDI. In your simple program, PianoBerry does nothing more with this information than to display a dialog box for each interface supported, but the program perhaps could be enhanced to make use of MIDI or ADPCM if they are present to provide richer sound. Finally, you add menu handlers for each of the music notes you want to be able to play: A, Bb, B, C, Db, D, Eb, E, F, Gb, G, and Ab, as shown in the following code listing:
private MenuItem AItem = new MenuItem(A, 0, 0) { public void run() { // Play an A note } }; private MenuItem BbItem = new MenuItem(Bb, 1, 0) { public void run() { // Play a Bb note } }; private MenuItem BItem = new MenuItem(B, 2, 0)
214
215
Youll note that in the run() code for each menu handler, I have not yet added the actual code to play the corresponding note. For that, you need to define a tune structure for each note, as well as call the Alert.startAudio() function to play the note.
216
Once youve done this, anywhere you want to play a G note, you simply reference it by the variable name G instead of having to always remember that the frequency of G is 784. Similarly, rather than hard-coding a duration value for the note everywhere you call startAudio, you can predefine another data member called duration1sec that will have a value of 1000 (milliseconds).
private static final short duration1sec = 1000;
This makes it easier to see what your code is doing. Instead of specifying a G note that plays for 1 second as {784, 1000}, I think you will agree that it is nicer to write {G, duration1sec}. You can also pre-define a volume level you want to use for the same reason:
private static final int VOLUME = 100; // Percentage volume.
Now, because startAudio() requires that you pass both the frequency and the duration as an integer array, the final little code-cleanliness thing you want to do is pre-define a set of named two-integer arrays, which you can then directly pass into the startAudio() call whenever you want to play a note. So, you write up 12 additional class data members, with names such as TUNEA, TUNEBb, TUNEC, and so on. These two-integer arrays are coded as follows:
// pre-defined private static private static private static private static private static private static private static private static private static private static private static private static tune arrays for use with the startAudio function final short[] TUNEA = new short[] {A, duration1sec}; final short[] TUNEBb = new short[] {Bb, duration1sec}; final short[] TUNEB = new short[] {B, duration1sec}; final short[] TUNEC = new short[] {C, duration1sec}; final short[] TUNEDb = new short[] {Db, duration1sec}; final short[] TUNED = new short[] {D, duration1sec}; final short[] TUNEEb = new short[] {Eb, duration1sec}; final short[] TUNEE = new short[] {E, duration1sec}; final short[] TUNEF = new short[] {F, duration1sec}; final short[] TUNEGb = new short[] {Gb, duration1sec}; final short[] TUNEG = new short[] {G, duration1sec}; final short[] TUNEAb = new short[] {Ab, duration1sec};
Now youve set yourself up perfectly so that whenever you need to play a tune, you just call Alert.startAudio() as follows:
Alert.startAudio(TUNEAb, VOLUME);
217
The remaining 11 menu handlers for the notes in your scale are coded in a similar fashion. At this point, if youve entered all the pieces of code correctly, you can actually test out PianoBerry using the menu system on either the BlackBerry Simulator or an actual device. When you run PianoBerry, you will see a blank screen with a simple title, PianoBerry. To play a note, click the trackwheel menu and choose one of the menu items corresponding to a note, as shown in Figure 13-1.
FIGURE 13-1: PianoBerrys main menu lists the notes you can play.
Drum roll, please. When you click the menu item for a note in the scale, you should hear the note through either your computer speaker or the BlackBerry speaker. That first note sounds so sweet!
218
Although keyChar passes your class three parameters, the main piece of information is the key parameter. The others are simply extra information in case you want to know if any modifier keys were pressed or what the exact time was when the key was pressed. The key parameter represents the actual character that was generated by the keyboard event. On other kinds of computers, figuring out what character was entered often means you have to learn ASCII codes and hexadecimal numbers. BlackBerry has simplified things for programmers by offering a special Java class called Characters that contains a named value representing every possible character that can be generated by the keypad. So a capital A is represented by the constant Characters.LATIN_CAPITAL_LETTER_A, a lowercase c is represented by the constant Characters.LATIN_SMALL_LETTER_C, and so on.
219
Table 13-2
BlackBerry Key A Q W E
220
Table 13-2
BlackBerry Key R T Y U I O P L
Continued
Piano Note Db D Eb E F Gb G Ab
If you ignore for a moment that the letters on the keys dont match up at all with the letters of the notes, it actually sort of makes sense in that keys are laid out in the same sequence left to right as they would be on a real piano. Dont worry. If you hate the layout, just come up with a better idea and change the code! Speaking of the code, the following code illustrates how to implement this keypad mapping using your keyChar() handler:
public boolean keyChar(char key, int status, int time) { super.keyChar(key, status, time); switch (key) { case Characters.LATIN_CAPITAL_LETTER_A: case Characters.LATIN_SMALL_LETTER_A: { Alert.startAudio(TUNEA, VOLUME); return true; } case Characters.LATIN_CAPITAL_LETTER_Q: case Characters.LATIN_SMALL_LETTER_Q: { Alert.startAudio(TUNEBb, VOLUME); return true; } case Characters.LATIN_CAPITAL_LETTER_W: case Characters.LATIN_SMALL_LETTER_W: { Alert.startAudio(TUNEB, VOLUME); return true; } case Characters.LATIN_CAPITAL_LETTER_E: case Characters.LATIN_SMALL_LETTER_E: { Alert.startAudio(TUNEC, VOLUME); return true; }
221
The preceding code is pretty straightforward. It traps each keypad letter in your layout, and it plays the appropriate music note using Alert.startAudio().
222
223
224
225
226
// overrides MainScreens standard keypad handling by i associating the top row of keys to the notes of the scale // Starting from the left side of the keyboard, the mappings are: // Key Note // A A // Q Bb // W B // E C // R Db // T D // Y Eb // U E // I F // O Gb // P G // L A public boolean keyChar(char key, int status, int time) { super.keyChar(key, status, time); switch (key) { case Characters.LATIN_CAPITAL_LETTER_A: case Characters.LATIN_SMALL_LETTER_A: { Alert.startAudio(TUNEA, VOLUME); return true; } case Characters.LATIN_CAPITAL_LETTER_Q: case Characters.LATIN_SMALL_LETTER_Q: { Alert.startAudio(TUNEBb, VOLUME); return true; } case Characters.LATIN_CAPITAL_LETTER_W: case Characters.LATIN_SMALL_LETTER_W: { Alert.startAudio(TUNEB, VOLUME); return true; } case Characters.LATIN_CAPITAL_LETTER_E: case Characters.LATIN_SMALL_LETTER_E: { Alert.startAudio(TUNEC, VOLUME); return true; } case Characters.LATIN_CAPITAL_LETTER_R: case Characters.LATIN_SMALL_LETTER_R: { Alert.startAudio(TUNEDb, VOLUME); return true;
227
228
229
Summary
In this chapter you were able to take a standard BlackBerry and turn it into a tiny little piano. Along the way I showed you how to play audio using the BlackBerry Alert interface and how to trap BlackBerry keypad events. PianoBerry is far from perfect, and if you are up for a challenge, consider enhancing the following areas: Using the ADPCM or MIDI interface to play richer audio Storing the notes played in a file for later playback Volume control Visual display of the notes played Using varying note durations (half-notes, quarter-notes, and so on) If you want to try to implement these features, most of the information you will need is scattered throughout the BlackBerry developer guides, the BlackBerry online knowledge base, and the example programs that come with the BlackBerry JDE.
chapter
n the preceding chapter you worked on a programming project that turns a BlackBerry into a toy piano. If you followed the example code, you saw that it made use of the BlackBerry Alert interface to force the BlackBerry to play audio through the BlackBerry speaker. If you were paying close attention, you may have even noticed that you could do other things with the Alert interface than play audio. The Alert interface can be used to directly control the standard BlackBerry vibrate mode. Vibrate mode is, of course, a standard feature on BlackBerry devices (and for that matter, just about every other handheld and smartphone device) and is used as a means for alerting you when an event of significance has occurred. Examples of this would be an incoming phone call, the arrival of a new e-mail or voice mail message, or an appointment reminder. Vibrate mode is most useful in situations when it would be inconvenient (or downright rude) to have your device play audible sounds for example, in a movie theater. If you must carry your phone into the theater, it is polite to set it for vibrate mode. That way, only you are able to tell if your phone is ringing. (Now if only you could make it so that talkative movie-goers had their voices set to vibrate!) BlackBerry users have some control over the use of vibrate mode on their devices. The BlackBerry Profiles icon lets you manage several different profiles that govern how your device will behave when different kinds of events and notifications occur. Within each profile are settings for each kind of alert: Calendar, Messages, Phone, and so on. The idea is that you can define a set of behaviors for different situations you might be in. A set of pre-defined profiles are provided, including Loud, Vibrate, Quiet, Normal, Phone Only, and Off. Although these should be sufficient, you have the ability to create new custom profiles of your own choosing. If you are entering a movie theater, simply switch your device to the Vibrate profile. When you come out, switch it to Normal. If you are on a loud city street or at an outdoor sporting event, you might want to use Loud. And so on. Figure 14-1 shows how to use BlackBerry Profiles to edit your vibrate settings.
in this chapter
Examining the BlackBerry Vibrate programming interface Starting and stopping vibrations Extending vibration duration Creating your own personal masseuse
232
All this is very nice for your average user who is satisfied with basic control of vibrate mode. But if you are reading this book, you are not your average BlackBerry user, are you? I didnt think so! The BlackBerry SDK makes available a function that is accessible from an application program which can directly control vibrate mode. Naturally I could not resist the temptation to figure out some way to use it more creatively. What I came up with was a program that would turn a BlackBerry into a handheld masseuse. Rather than wait for a phone call or reminder to start vibrate mode, Masseuse lets you turn vibrate on or off with a click of the BlackBerry trackwheel. Once turned on, Masseuse forces your BlackBerry to vibrate until you turn it off. Read on to learn more about how you can create Masseuse with just some basic programming steps.
233
If bBuzzer returns true, then the Buzzer interface is supported. If bVibrate returns true, then the Vibrate interface is supported. It is possible on relatively recent devices that both interfaces are supported, in which case you should just use the vibrate mode. In my tests on a modern 8700 device, only isVibrateSupported() returns true. Although you could certainly support both, given that Vibrate has been supported for some time now, you will assume the Vibrate interface for this project.
234
To build Masseuse, you need to follow the same steps for creating a new BlackBerry workspace and project as described in Chapter 11. The preceding code should be entered in a text file called Masseuse.java, and included in the Masseuse project. If you have avoided any typing errors, Masseuse.java will compile and run on the BlackBerry Simulator and on a real device.
235
236
This is fairly standard menu code for a BlackBerry application, and it uses the same techniques as are used in the other programming projects in this book. First, you modified the MasseuseScreen class to extend TrackwheelListener, to give the class the ability to capture trackwheel events. Next, you added a boilerplate makeMenu function, which constructs the menu and menu items. Finally, you add a set of menu handlers for Close, Support, Start, and Stop. For the moment, the menu handlers dont do anything, so you are now at the point where you need to implement Start and Stop by using Alert.startVibrate().
Interestingly, startVibrate takes a parameter that specifies how long the vibration should last. This parameter is expressed in milliseconds, so to start a vibration that is one second long, you would pass a value of 1000 like so:
Alert.startVibrate (1000); // vibrate for 1 second
To try it out, just add this line of code to the Start menu handler in Masseuse, as follows:
private MenuItem startItem = new MenuItem(Start, 0, 0) { public void run() { Alert.startVibrate (1000); // vibrate for 1 second } };
If you build Masseuse with this code change and then click the trackwheel menu and choose Start, your BlackBerry vibrates for one second. Pretty cool!
237
At this point you might be thinking, But wait! It lasts only one second! You noticed that, did you? I realize that if you had paid for a real massage and the masseuse stopped after just one second, youd probably feel a bit cheated. Well, with startVibrate, you can extend the duration to last a little bit longer. But according to the BlackBerry API documentation for startVibrate, the maximum value you can pass is 25500, or 25 seconds. This is a little better than 1 second, but still not quite the luxurious long-lasting massage you were hoping for. You need a way to make the vibration go on indefinitely, until the Stop menu item is selected. Speaking of stop, how do you stop vibration mode? Read on.
This signals the BlackBerry OS that it should notify MasseuseScreen whenever a vibration initiated from Alert.startVibrate() completes. To handle the notification, you need to add an override to the stopVibrate method of AlertListener in the class, like so:
public void vibrateDone(int reason) { // restart the vibration! Alert.startVibrate(1000); return; }
238
Now that you can use vibrateDone() to catch whenever the startVibrate() duration has ended, all you need to do is restart it. Here is how it is done:
public void vibrateDone(int reason) { // if the vibration ended because the duration was over // just restart it. Let it stop for all other reasons if (reason == REASON_COMPLETED) { Alert.startVibrate(1000); } return; }
In vibrateDone(), you are passed a reason for why the vibration ended. This reason can be REASON_COMPLETED, REASON_STOP_CALLED, or REASON_KEY_PRESSED. If the reason code indicates that the vibration stopped simply because the duration ran out, you can restart the vibration with another call to startVibrate(). This cycle continues until either you explicitly call stopVibrate() (from the trackwheel menu) or the user presses any key.
239
FIGURE 14-2: Masseuse running on my BlackBerry /** * Masseuse */ import net.rim.device.api.ui.*; import net.rim.device.api.ui.component.*; import net.rim.device.api.ui.container.*; import net.rim.device.api.system.*; import java.util.*; public class Masseuse extends UiApplication { public static void main(String[] args) { Masseuse theApp = new Masseuse(); theApp.enterEventDispatcher(); } public Masseuse() { MasseuseScreen myScreen = new MasseuseScreen(); pushScreen(myScreen); addAlertListener(myScreen); } }
240
class MasseuseScreen extends MainScreen implements i TrackwheelListener, AlertListener { // some menu items you will add to the menu private MenuItem _closeItem = new MenuItem(Close, 0, 0) { public void run() { onExit(); } }; private MenuItem supportItem = new MenuItem(Support, 0, 0) { public void run() { boolean bBuzzer = Alert.isBuzzerSupported(); boolean bVibrate = Alert.isVibrateSupported(); if (bBuzzer) { Dialog.alert(Buzzer supported); } if (bVibrate) { Dialog.alert(Vibrate supported); } // shows how to set the volume Alert.setVolume (100); } }; private MenuItem startItem = new MenuItem(Start, 0, 0) { public void run() { Alert.startVibrate(1000); } }; private MenuItem stopItem = new MenuItem(Stop, 1, 0) { public void run() { Alert.stopVibrate(); } }; public MasseuseScreen() { super(); LabelField applicationTitle = new LabelField(Masseuse); setTitle(applicationTitle);
241
242
Alert.startVibrate(1000); } return; } public void buzzerDone(int reason) { return; } public void audioDone(int reason) { return; } }
Summary
In this chapter, you extended some of the same concepts covered in the previous PianoBerry chapter, but this time the end result is not a toy piano, but instead a personal vibrating massager! This is just another example of some of the creative things that you can pursue to make your BlackBerry do some pretty weird and unexpected things, if you are willing to get your hands dirty with a small amount of Java programming. If you want to take Masseuse to the next level, here are some ideas to pursue: Provide onscreen controls. Provide visual feedback (via LED blink or other means) for when vibrate is on or off. Allow users to set a duration limit if they want (to ensure that the massage feature wont run down the battery if they forget to turn it off ). Play a little nice background music by incorporating some of PianoBerry!
chapter
espite the ongoing race to digitize everything from e-mail and documents to banking, commerce, books, music, and video, you will still find that there is still at least one printer in virtually every home, business, or office where there is a computer. Many predicted the demise of paper decades ago, yet here in the twenty-first century, printers continue to sell like hotcakes. Why? It turns out that the desire to print a hard copy, hold it in your hands, and read it comfortably continues to be more desirable than going blind squinting to read a two-inch square screen. Most desktop and laptop users print something every day. With much of the same content being moved to handhelds and smartphones, the only reason people dont print from these mobile devices is because their handheld vendor did not include printing in the built-in feature set for their device. For me, if someone sends me a lengthy e-mail with a document attached to it and asks me to review and comment on it, the first thing I want to do is print it out on the nearest printer rather than going through the pain of reading it all on my tiny device.
in this chapter
Connecting to your printer Opening a serial port connection over Bluetooth Sending text to the printer Adding a custom menu to MemoPad
In this chapter, I offer a remedy to the lack of printing capability on BlackBerry devices by showing you how to add Bluetooth printing. You will see how to open a Bluetooth connection, send data to a printer, and even add printing to the built-in MemoPad program.
Bluetooth Printers
Relative to other handheld devices, BlackBerry devices have a limited number of ways in which you can achieve a connection to a printer. Infrared is a built-in option for Palm, Windows Mobile, and most other device models, but no BlackBerry device to date includes an infrared port. The few commercial printing solutions that are out there employ a backend server host that requires you to route the data to the server where it is printed over the network to a target printer which must be registered for use with the specific service. It is possible, however, to print directly from your BlackBerry device using the one local wireless option available to BlackBerry owners, namely Bluetooth. As you will see later, modern BlackBerry devices include Bluetooth radios, giving them the ability to wirelessly connect to other local Bluetooth-enabled devices, computers, and peripherals.
244
245
BlackBerry-Controlled Functions
In an effort to provide a measure of security on BlackBerry devices for users and wireless carriers, Research In Motion controls access to functions available to developers in the BlackBerry SDK. Any function can be called from a program within the BlackBerry Simulator, but when it comes to running a program on an actual BlackBerry device, certain families of functions are controlled for security purposes. This means that any application program that uses a protected function must be digitally signed before being loaded onto a device. Now, as luck would have it if you are anxious to print, among the functions protected by RIM are those that enable direct Bluetooth communications. Accordingly, because you will be using these functions in this chapter, it is necessary to talk briefly about the signing process and how you go about obtaining a digital signature for your program.
246
247
248
3. After Bluetooth is enabled, you are able to add one or more device pairings to your Paired Device list. To add a paired device, click the trackwheel menu and choose Add Device. This initiates a search (discovery in Bluetooth parlance) for other Bluetooth devices that are in range of your BlackBerry, as shown in Figure 15-2.
If any available devices are found, your BlackBerry presents you with a screen showing a list of all of the devices it was able to identify. The names in the list can appear a bit strange. Depending on the device type, the name can be either manually assigned by a person, or an obscure product code or serial number. I will never forget the trade show I was at one year where I was demonstrating a phone solution involving Bluetooth, along with about 60 other vendors in the same pavilion. When I initiated a discovery, literally hundreds of Bluetooth devices were found. It took minutes for the phone to stop listing the devices it found, and the list was filled with so many obscure device names I had no idea which device I was trying to pair with! Lets hope your devices search will turn up only one or two devices, as shown in Figure 15-3, in which my BlackBerry found both my laptop as well as my Bluetooth-enabled printer.
249
4. To complete a pairing with a selected Bluetooth device, you need to supply a passkey that authenticates you as a legitimate pairing partner for that device. For instance, if your laptop has a Bluetooth radio, you would configure your laptop to allow different kinds of connections from other Bluetooth computers and devices. Naturally you would want to establish some kind of security to prevent unauthorized access, so you would assign a passkey to protect your laptop. Any other computer or device would need to know your passkey in order to successfully connect to your laptop. When trying to pair with a Bluetooth printer, you normally do not have an opportunity to assign a passkey to the printer, so what happens is that the manufacturer assigns a default passkey to its printer (for example 0000). Some vendors give you a software utility that lets you change your printer passkey from your laptop with a USB cable, but because printers are not usually thought of as a high risk for security intrusions, generally the passkey remains the default. You will need to consult your printers documentation in order to find your printers default Bluetooth passkey. Figure 15-4 shows the BlackBerry passkey screen.
250
Now that you have successfully created a pairing, you can look at information about the device pairing by selecting your pairing from the Paired Devices list and choosing the Properties menu item, as shown in Figure 15-5. The most interesting piece of information here is under Services, indicating that the one and only Bluetooth service available from my target Bluetooth printer is the Serial Port service. This probably doesnt sound too promising to you at this point, but as a matter of fact its perfect. You will make excellent use of the Serial Port service in the next section!
251
If at least one BluetoothSerialPortInfo object was returned, you know that there is at least one available Bluetooth serial port from a pairing that exists on the device. Note that this does not imply anything about the ability to connect to the target Bluetooth printer other than
252
If successful, Connector.open() returns an object of type StreamConnection that can then be used for managing both inbound and outbound data communications. If unsuccessful, Connector.open() typically throws a Java ConnectionNotFound exception or an IOException. You are almost there. The last step in opening the connection for printing is to actually open an outgoing data stream that you can use to write bytes to the printer. A StreamConnection in and of itself does not have useful methods, but it is derived from an OutputConnection, and as such it inherits the method openDataOutputStream(), which is exactly what you are looking for. Opening a Bluetooth output stream is done like this:
outputStream = bluetoothConnection.openDataOutputStream();
If successful, openDataOutputStream returns a DataOutputStream object, which in this example means you are now ready to write data to the printer.
253
Printer-Specific Commands
As mentioned earlier, this example ignores several real-world printing problems, and one of them is dealing with the many different kinds of printers that are out there. For many printers, it is perfectly valid to simply spew out text to them and they will print that text in a generic fashion. However, many printers require special codes for proper initialization. For example, to properly initialize an HP LaserJet printer, a program must begin the print job by sending the special code sequence ESC E. For other printer makes and models, different initialization codes may be required.
The writeChars() function will copy the value you provide to the outputStream variable, but this in and of itself does not guarantee that it will be immediately sent to the printer. This is because the DataOutputStream class buffers output for efficiency. Buffering means that DataOutputStream sends data out over a connection only when it has filled up its memory block with a specific count of bytes kind of like waiting for a bucket to be completely filled with water before you dump it out. If you need your data to be sent immediately, you need to use the flush() member function, which forces DataOutputStream to send whatever it has in its memory buffer, regardless of whether it is full, like so:
outputStream.flush();
254
Although you print only a trivial Hello World character string in the example, this is pretty much a ready-made printing function that will work for larger and more complex print jobs. However, you need to take care of one more final detail before you are done, and that is to put the printing code inside of a thread. Now, if you are not an experienced programmer, topics such as threads and multitasking may sound complicated and scary, but for the purposes of this program, its really not all that bad. To give a very brief and simple background, a thread can be thought of as a job or task that you do while you are also simultaneously doing another job. For example, at the same time as you read this page you are also breathing, your heart is beating, and maybe you are even listening to background music. Your brain is somehow able to do all of these tasks at once, without them interfering with one another. This is called multitasking, and computers multitask in the same way. A computer program can accept user input, perform calculations, display information, and wirelessly communicate with other computers and peripherals, all at the same time. In order to multitask safely so that each of these tasks can work independently and does not interfere with any other task, a BlackBery program uses a Thread class. A BlackBerry program always has at least one thread running, which is the main program thread. Your program can also create additional threads if it needs to initiate tasks that should not interfere with the main application thread. Here is a simple code snippet that illustrates how a thread is created in a BlackBerry program:
public MyApp() { // other initialization code goes here // . . . // Start a new thread by creating an instance of the thread // class new MyThread().start(); } // The thread class, derived from the basic Java Thread class private class MyThread extends Thread { public void run() { // Do stuff here } }
255
256
The complete program BluetoothPrint has a simple trackwheel menu that creates the PrintThread instance and then goes about connecting and printing.
Debugging BluetoothPrint
Unfortunately, Bluetooth communications are not supported at all within the BlackBerry simulator, so developers need to test and debug their programs on an actual device. This is an inconvenience and definitely makes for a slower edit-compile-test cycle during code development, but thats the way it is, at least for the currently available simulators from RIM. To debug on the device, you can either sprinkle your program liberally with message boxes that will tell you what is happening inside the code, or you can actually conduct a complete debugging session with your device over USB from within the JDE debugger. In order to use this feature of the JDE, follow these steps: 1. Make sure your BlackBerry device is attached to your computer via the standard USB cable. 2. Make sure you have installed your program to the device. (The debugger will not do this for you!) 3. In the JDE choose Attach To Handheld from the Debug menu. If all goes well you will see a Debugger attaching screen on your device. 4. Set a breakpoint in your source code. 5. Go to the device and run your program. The JDE debugger follows your programs execution, just as it would if your program were running in the simulator.
257
258
All of the real action happens in the run() method, which gets kicked off any time your custom menu gets selected by the user. When this method gets called, your code is really in the context of the MemoPad View screen. Unfortunately RIM has not seen fit to document a Memo object; otherwise you would simply be able to reference the contents of the memo via the passed-in Object variable. Not to worry, however. You are able to hack around this problem by simply obtaining the onscreen field that has the focus and grabbing its text. Although not the most elegant solution, because the MemoPads View screen just has the one input field, this technique will suffice, and indeed it works just fine. The other interesting thing about the menu item class is the toString() method, which offers you the opportunity to give your custom menu item a name. This name will be the label for the custom menu item that appears within the MemoPad View menu. You can choose any label you like, but in this example, name the menu Print Memo. Now that you have a menu item class to handle the Print Memo menu from MemoPad, you need to register the menu with the ApplicationMenuItemRepository. (As with the Bluetooth SDK functionality described earlier, the ability to add custom menu items is understandably also a protected piece of functionality, and because of this you will need to register with RIM to obtain the ability to sign your code.) The following source code is called from the constructor of the BluetoothPrint application class. After it instantiates the Print Memo menu item class, it goes on to register the menu item with the ApplicationMenuItemRepository such that it is injected into the MemoPad View menu.
public BluetoothPrint() { // Other program initialization code goes here . . . // Now create a menu item that will insert itself into // the BlackBerry MemoPad application MyMenuItem myMemoPadMenuitem = new MemoPadMenuItem(0); ApplicationMenuItemRepository instance = i ApplicationMenuItemRepository.getInstance(); instance.addMenuItem (ApplicationMenuItemRepository. i MENUITEM_MEMO_VIEW,myMemoPadMenuitem); }
Figure 15-6 shows the menu item appearing on the MemoPad menu for the View Memo screen. Figure 15-7 offers proof that you were able to successfully obtain the text for the currently selected memo item.
259
FIGURE 15-6: The custom Print Memo menu item appears in MemoPads menu
FIGURE 15-7: Successfully hacking into the MemoPad screen to obtain the memo text!
Now, inside of the PrintThread code, instead of printing the boring old Hello World text like this:
String value = Hello World; outputStream.writeChars(value);
260
Summary
This chapter covered quite a variety of topics, including Bluetooth communications, wireless printing, using digital signatures for protected areas of BlackBerry functionality, and even how to hack your own menu into a built-in BlackBerry application. Obviously each one of these topics is rich enough to fill a chapter by itself, if not more, and this chapter only scratches the surface on each of them in order to put together the BluetoothPrint demonstration printing program. Whether you decide to pursue more information on Bluetooth, printing, or application integration, the BlackBerry JDE and SDK documentation is a great place to go to learn more.
Index
A
Access database, viewing software, 16, 139 Aces Texas Hold em No Limit, 17, 148150 Add, shortcut key for, 13 Address Book editing contacts, 12 finding contacts, 12 shortcut key, applications screen, 9 Address lookup, Berry 411, 7071 Agenda view, shortcut keys for, 1011 Airline flights, WorldMate travel tool, 135136 Alarm clock, shortcut key, 9 Alert mechanisms and audio capabilities, 208 vibrate versus buzzer, 232233 ALT key, location on keyboard, 3 Application Loader, 112 Application program interfaces (APIs), 171 Applications, 813 Address Book, 12 Applications screen (home screen), 89 Calculator, 13 Calendar, 1011 icons, changing, 910 multiple, running, 10 Applications screen (home screen), 89 shortcut keys in, 9 use on newer devices, 8 Appointment, new, shortcut key for, 11 AskMeAnything, 69 AskMeNow, 6970 Assisted search service, 6869 @ symbol, auto entry, 5 Atom XML, blogs, 78 Audio capability alert mechanisms, 208, 213 and BlackBerry model, 207208 ringtones, 17 See also PianoBerry program Automatic backup, 123124 AutoText shortcut letter replacement, 4 spelling correction with, 4 Avvenu, 98101 issues related to, 99
B
Backspace key, location on keyboard, 3 Backups, 120124 automatic, 123124 BlackBerry Desktop Manager, 2224 full backup, 121122 restores from, 122123 selective backup, 122 Bartender, Mobile Bartender, 17, 162164 Battery drain, sources of, 125 extending life of, 125 level, information screen, 5
262
Index B
BDicty, 16 Beiks dictionaries and phrasebooks, 138 Berry 411, 7071 BerryVine RSS Reader, 7376 adding feed, 75 information source on, 76 loading feed, 7375 updates, 75 Bible-related references, software application, 16 Bitmaps, and drawing program, 202204 BizTrackIt, 144145 BlackBerry applications, 813 backing up, 120124 battery life, 125 Bluetooth on, 246250 erasing information, 124125 file system, 109112 games, 147162 Internet and browsing, 6181 memory storage, 107109 owner information, 118 printing from. See Printing from BlackBerry productivity tools, 131146 programming. See Java programming rebooting, 124, 124125 remote control of desktop, 91104 resetting, 124 security, 117120, 125129 software applications, 1527 system information, 58
typing shortcuts, 45 vibrate mode, 231233 Web site information on, 14 as wireless modem, 8390 BlackBerryBlog, 18 BlackBerry Browser. See Internet Browser (BlackBerry Browser) BlackBerryCool, 18 BlackBerry Database Viewer, 16 BlackBerry Database Viewer Plus, 139 BlackBerry Desktop Manager backups, 121124 restore, 122123 software, installing from, 2224 BlackBerry Enterprise Server (BES), 94, 104 BlackBerry Ring Tone Megaplex, 17 Blogger.com, 78 Blogging, 7781 Mail-to-Blogger, 8081 online tools, 78 posting from BlackBerry, 7981 reading from BlackBerry, 7879 Bluetooth on BlackBerry, 246250 BlackBerry as wireless modem. See Wireless modem/BlackBerry device BlackBerry discovery, preventing, 120 Bluetooth compared to Wi-Fi, 246 Bluetooth radios, 247 Bluetooth Settings screen, 247 pairing BlackBerry/Bluetooth, 247250 and wireless printing. See Printing from BlackBerry
Index BD
263
Board games, Medieval Kings Chess, 158159 Bookmarks, speed dial and Opera Mini, 67 BrickBreaker, 147 Browsers HTML capable, 62 Internet Browser (BlackBerry Browser), 6266 Minuet Browser, 68 Opera Mini, 6768 proxy browser, 67 shortcut key, applications screen, 9 WAP browser, 6162 Business software, 1516 Buzzer, versus vibrate, 232233
C
Cable replacement, and Bluetooth, 247 Caffeine Finder, 136137 Calculator 7100 model keyboard shortcuts, 13 shortcut key, applications screen, 9 shortcut keys in, 13 Calendar, 1011 Enable Quick Entry and shortcut keys, 11 navigating, shortcut keys, 1011 shortcut key, applications screen, 9 Calorie Counter, 17 CAP key, location on keyboard, 3 Capital letters, typing shortcut, 5 Card games, 147151 poker, 17, 148150 Solitaire, 17, 150151
Clear Entry, shortcut key for, 13 Clear Screen, shortcut key for, 13 Clock display add-on program, 17 World Clock, 135 Cocktail recipes, software for, 17 Coffee shops, Caffeine Finder, 136137 Communications software, add-on programs, 16 Compose E-mail, shortcut key, applications screen, 9 Connected Limited Device Configuration (CLDC), 170 Contacts, Address Book, 12 Copy files from BlackBerry to desktop, 112 from desktop to BlackBerry, 113115
D
Database viewers, 16, 139 DataVault, 129 Debugging, and Event Log, 56 Desktop/BlackBerry connection backups, 120124 BlackBerry as external storage drive, 104115 copying files between, 113115 remote control. See Remote control of desktop restore, 122123 software, installing from desktop, 2224 Device information, myver display of, 78 Dictionary software, language translation dictionaries, 16, 138
264
Index DG
Digital signature, 245246 Directory, BlackBerry files, 110111 Divide, shortcut key for, 13 DocHawk, 16, 139 Document management tools database viewers, 16, 139 e-mail attachment handling, 139 Word and Excel viewing and editing, 16 Drawing program. See SketchBerry program
E
EasyReach, 101102 EDGE connection, 84, 95 Educational programs, 16 eFile Desktop, 113114 files, copy to BlackBerry, 113115 E-mail address, @ symbol auto entry, 5 attachment handling tools, 138 BlackBerry Attachment, 139 blogging from BlackBerry, 8081 Compose, shortcut key, 9 Enable Quick Entry shortcut keys caution, 11 turning off, 11 Entertainment software, 17 eOffice, 16, 139 Erasing information, 124125 ESC key functions of, 3 location on keyboard, 3
Etch-A-Sketch simulation. See SketchBerry program EV-DO connection, 84 Event Log accessing, 5 to view system events, 56 Excel documents, viewing/editing software, 16, 139 ExpenseLog Pro, 144 Expense Report Wizard, 16, 144 Expense Tracker, 144 Expense tracking, 142144
F
FeedDemon, 73 File sharing, remote, applications, 98102 File system BlackBerry deficiencies, 108109 BlackBerry files, copy to desktop, 112 desktop files, copy to BlackBerry, 113115 JavaLoader, 110112 Firewall, remote control barrier, 9394 Fitness-related software, 17 Flash memory, 107108 Frequency, musical notes, 209210 FTP sites Idokorro Mobile FTP, 102103 uses of, 102103
G
Games, 17, 147162 board games, 158159
Index GI
265
card games, 17, 147151 golf simulation game, 155157 puzzle games, 160162 Gmail Mobile, 16 Golf scorecard software, 17, 151155 simulation game, 155157 Google Google Local for Mobile, 132134 Google Maps, 132 as mobile-friendly, 6465, 68 Go to Date, shortcut keys for, 1011 GotoMyPC, 92 Graphics on BlackBerry. See SketchBerry program
Help Me! accessing, 5 system information screen, 5 Home screen. See Applications screen (home screen) HTML-capable browsers, 62
I
Icons for applications, changing, 910 hiding, 10 Idokorro Mobile Admin, 104 Mobile Desktop, 9496 Mobile FTP, 102103 Im In Touch, 100 IM+, 16 Information tracking, 140141 InHand, 26 Instant messaging software, 16 Integrated Development Environment (IDE) basic facts, 172174 launching, 173 output, 174 source editor, 174 workspace, 173176 See also Java programming Internet BlackBerry as wireless modem, 8590 blogging, 7781 browsing tools, 6164, 6768 mobile-friendly sites, 6466
H
Handango Store, 1821 InHand software catalog, 26 navigating guidelines, 1920 positive aspects of, 1819 Health and fitness software, Running Log, 17, 164166 HelloBlackBerry program, 180190 building program, 185186 debugging, 188189 install program to BlackBerry, 190 Java 2 Micro Edition ( J2ME), 170 running program, 187188 Simulator, running program, 186189 source code, writing, 180185 source file, 180 testing program, 186187
266
Index IL
Really Simple Syndication (RSS) feeds, 7277 search tools. See Internet search Internet Browser (BlackBerry Browser), 6266 Berry 411 information service, 70 bookmarks, use of, 6466 pros/cons of, 6263 shortcut keys, 6364 Internet search, 6872 AskMeNow, 6970 assisted search service, 6869 Berry 411, 7071 Google, 6465, 68 YubNub, 7172 IP address, remote control difficulty, 9394, 98
Java programming, 169190 basics of. See HelloBlackBerry program drawing program. See SketchBerry program Integrated Development Environment (IDE), 172174 Java Development Environment ( JDE), 109, 171173 music program. See PianoBerry program printing application. See Printing from BlackBerry project, creating, 176178 project properties, review of, 178179 system requirements, 172 versions of JDE/BlackBerry versions, 172 vibrate mode, control of. See Masseuse program workspace, creating, 175176
J
Java basic facts, 169170 as object-oriented language, 170 programming BlackBerry. See Java programming JavaLoader, 109112 command-line options, 110 copying files to desktop, 112 features of, 109 file loading, 112 file system with, 110112 limitations of, 112 screen shot with, 112
K
Keyboard important keys, location of, 34 typing shortcuts, 45 Keyboard Lock, shortcut key, applications screen, 9
L
Language translation dictionaries, 16, 138 Laptop, BlackBerry as wireless modem. See Wireless modem/BlackBerry device LD, local date display, 7 Links Scorecard, 17, 152 LT, local time display, 7
Index MO
267
M
Mail-to-Blogger, 8081 Maps, Google, 132134 Masseuse program, 233242 application skeleton, creating, 233234 force vibrate mode, 236237 function of, 232 installing on BlackBerry, 239 source code for, 239242 trackwheel menu, adding, 234236 vibrateDone, 237238 Math Trick Trainer, 16 Medieval Kings Chess, 158159 MemoPad, print menu, adding, 256258 Memory storage, 107109 capacities, 108 types of memory, 107 Messages, shortcut key, applications screen, 9 Microsoft Windows BlackBerry as wireless modem set-up, 8590 Remote Desktop Protocol (RDP), 9293, 96 Terminal Services, 9293, 9697 Word documents, viewing/editing software, 16 MIDP Record Store, 109 Mileage tracker, 140141 Minuet Browser, 16 positive aspects of, 68 Mobile Bartender, 17, 162164 Mobile Data Service (MDS), 94
Mobile-friendly Web sites, 6466 examples of sites, 6566 Mobile Information Device Profile (MIDP), 170171 Mobile Sudoku, 160162 Modem, BlackBerry as. See Wireless modem/BlackBerry device MortgageSolver, 15 mScorecard, 152155 MSDict Oxford Dictionary of the Bible, 16 Multiply, shortcut key for, 13 Music program. See PianoBerry program MyClock, 17 My Mileage Tracker, 140141 mypin, PIN display, 7 MySafe+, 128 mysig, owner information display, 7 My Time Tracker, 16 myver, device/version information, 78
N
Notes, shortcut key, applications screen, 9
O
Opera Mini, 6768 Operating system version, information screen, 5 Options, shortcut key, applications screen, 9 Output, IDE screen, 174 Over-the-air (OTA) applications, sources for, 26 downloading, 25 software applications from, 2426
268
Index OP
P
Pairing, BlackBerry/Bluetooth, 247250 Par 3 Golf, 155157 Passwords hard reset situation, 120 Password Keeper, 126127 Password Manager, 17 setting, 119 timeout function, 119 PCAnywhere, 92, 94 Periods, inserting, shortcut, 5 Persistence Model, 109 Phone, shortcut key, applications screen, 9 Phone numbers, Address Book, 12 Phrasebooks, 138 PianoBerry program, 207229 application skeleton, creating, 210211 and frequency values for notes, 209210 frequency values for notes, 209210 installing on BlackBerry, 222 keypad/piano keys correspondence, 217221 menu system, adding, 211215 piano key mappings, 219220 playing notes, Alert.start Audio() function, 215217 source code for, 222229
PicoNews, operation of, 7677 PINS mypin display of, 7 Password Manager, 17 Poker games, 17, 148150 Positive (negative), shortcut key for, 13 PowerPoint, viewing software, 16 Printing from BlackBerry, 250260 Bluetooth as serial port, 250252 Bluetooth enabled printers, 244 Bluetooth printer adapters, 244 debugging, 256 pairing BlackBerry/Bluetooth, 247250 printer adapters, 244 printers for mobile use, 244 print function, adding, 259 print menu, adding, 256259 source code for, 253256 with TCP connection, 244 writing text to printer, 252253 Productivity tools, 1516 business/professional, 1516 database viewers, 16, 139 dictionaries, 16, 138 document management, 16, 139 e-mail attachment handling, 138 expense tracking, 16, 142144 information tracking, 140141 phrasebooks, 138 time-tracking, 16, 144145 travel-related, 15, 132137 Profiles, shortcut key, applications screen, 9
Index PS
269
Programming BlackBerry application program interfaces (APIs), 171 and digital signature, 245246 projects, 175 workspace, 175 See also Java programming Projects programming BlackBerry, 175 See also Java programming Proxy browser, 67 Puzzle games, Mobile Sudoku, 160162
R
RDM Online, 98 Readers. See Really Simple Syndication (RSS) feeds Really Simple Syndication (RSS) feeds, 7277 BerryVine RSS Reader, 7376 blogs, 78 operation of, 72 PicoNews, 7677 RSS Client, 72 RealVNC, 94 Rebooting, 124125 Reference-related software, 16 Remote control of desktop, 91104 Avvenu file sharing, 98101 EasyReach, 101102 file sharing tools, 98102 firewall as barrier, 9394 host IP address difficulty, 93
Idokorro Mobile Admin, 104 Idokorro Mobile Desktop, 9496 Idokorro Mobile FTP, 102103 Im In Touch, 100 network administration tools, 104 remote control software programs, 92 Remote Desktop for Mobiles, 9798 Terminal Services, 9293, 9697 TSMobiles, 9697 Virtual Network Computing (VNC), 9394 Remote Desktop for Mobiles, 9798 Remote Desktop Protocol (RDP), 9293, 96 Repligo, 139 Resetting, 124 Restore BlackBerry Desktop Manager, 2224 full restore, 122124 selective restore, 122123 Ribbon. See Applications screen (home screen) Ringtones, software for, 17 Running Log, 17, 164166
S
Saved messages, shortcut key, applications screen, 9 Scorecards, golf scorecard software, 17, 151155 Screen shot, with JavaLoader, 112 Search, shortcut key, applications screen, 9 SearchMagic, 17
270
Index S
Security, 125129 Bluetooth discovery, preventing, 120 CryptMagic, 127128 DataVault, 129 digital signature, 245246 MySafe+, 128 passwords, 118120, 126127 Selective backup, 122 Selective restore, 122123 Serial port, Bluetooth as, 250252 Shortcuts and applications, 813 for Internet Browser (BlackBerry Browser), 6364 typing. See Typing shortcuts Signal strength display mode, 67 Help Me! information screen, 5 Simulator HelloBlackBerry program, 186189 SketchBerry program, 205 SketchBerry program, 191206 application skeleton, creating, 194195 bitmap technique, 202204 and BlackBerry Graphics class, 198 drawing mode start/stop, 197198 drawing procedure, 198202 navigation methods, 192193, 199202, 205 project plan, 193 running program, 204205 Simulator, running program, 205 trackwheel handling, 195197
Smart system codes, listing of, 78 Sodoku, Mobile, 160162 Software applications, 1527 bartending recipes, 162164 buying options, 2122 communications/wireless, 16 education/reference, 16 games, 17, 147162 Handango Store for, 1821 health/fitness, 17, 164166 installing from desktop, 2224 installing from over-the-air, 2426 Internet browsers, 6172 remote control software programs, 9498 remote file sharing, 98102 security programs, 127129 utilities, 17 See also Productivity tools Solitaire, 17, 150151 Sol Mania, 17, 150151 Source editor, IDE screen, 174 SPACE key, to insert period, next capital letter, 5 Special characters, entering, 5 Spell checker, AutoText, 4 Square root, shortcut key for, 13 SRAM (Static Random Access Memory), 107 Storage, information screen, 5 Subtract, shortcut key for, 13 Sudoku, 2526 Switch to Day view, shortcut keys for, 1011 Switch to Month view, shortcut key for, 10
Index SW
271
Switch to Week view, shortcut keys for, 1011 Synchronization BlackBerry Desktop Manager, 2224 eFile Desktop, 114 System information, 58 event Log, 56 information screen, 5 signal strength display mode, 67 smart system codes, 78
Typing shortcuts for @ symbol, 5 AutoText letter replacement function, 4 for capitalizing, 5 to insert period, next capital letter, 5 for special characters, 5
U
USB cable, BlackBerry as wireless modem, 85, 86 Utilities, add-on programs, 17
T
Tasks, shortcut key, applications screen, 9 Telephone number lookup, Berry 411, 7071 Terminal Services, 9293, 9697 Third-party applications. See Productivity tools; Software applications Time-tracking software, 16, 144145 Total Fitness, 17 Traffic Edge, 134135 Travel-related tools, 15, 132137 Caffeine Finder, 136137 expense tracking, 142144 Google Local for Mobile, 132134 Google Maps, 132134 language translation dictionaries, 16, 138 mileage tracker, 140141 Traffic Edge, 134135 WorldMate, 15, 135 Troubleshooting, and Event Log, 56 trackIT: Expense Edition, 142144 TSMobiles, 9697
V
Version, myver display of, 78 Vibrate mode, 231233 control program. See Masseuse program editing settings, 231232 vibrate versus buzzer, 232233 Virtual Network Computing (VNC), 9394 downloads for, 94
W
WAP browser, 6162 best use of, 62 Bookmarks, shortcut key, applications screen, 9 Windows. See Microsoft Windows Wireless add-on programs, 16 and Bluetooth, 247 over-the-air (OTA) software installation, 2426 signal strength information screen, 5
272
Index WY
Wireless Access Protocol. See WAP browser Wireless Markup Language (WML), and WAP browser, 6162 Wireless modem/BlackBerry device, 8390 BlackBerry models for, 8485 Bluetooth capability, 85 configuring modem, 8687 data plan, recommended, 84 information sources on, 85, 90 initialization string errors, 8687 Internet access, scope of, 84 network connection, 8788 testing connection, 8889 USB cable connection, 85, 86 Windows set-up, 85 Wireless printing. See Printing from BlackBerry
Workspace functions of, 175 IDE screen, 173174 See also Java programming WorldMate, 15, 135136
X
XML format blogs, 78 Really Simple Syndication (RSS) feeds, 72, 75
Y
YubNub, 7172
The best place on the Web to learn about new technologies, find new gear, discover new ways to build and modify your systems, and meet fascinating techheadsjust like you.
Visit www.extremetech.com.
Wiley and the Wiley logo are trademarks of John Wiley & Sons, Inc. and/or its affiliates. The ExtremeTech logo is a trademark of Ziff Davis Publishing Holdings, Inc. Used under license. All other trademarks are the property of their respective owners.