|
|||
| Home | News | Reviews | Features | Tips | Mobile Product Watch | Forums | |||
|
BlackBerry Hacks from O'Reillydelivers tips, tools, and other ways to best use your BlackBerry wireless handheld's phone, inbox, organizer, and browser features for phone calls, instant messaging, email, organizing, Web browsing, receiving RSS feeds, and more. In these article, we excerpt a number of tips or hacks from the book:
View the Event Log
Your device has a hidden Event Log that can be viewed using a certain key combination. Similar to the event log on a Windows computer, there is an Event Log on your BlackBerry device where applications and the BlackBerry operating system itself can log information. Not only does this provide a central place to view all events from the system and applications, but it allows application developers to use an easy and consistent API for logging events so that each developer doesn't have to create his own. You can view the Event Log on your device and even filter certain events, copy them to the clipboard—even email the entire log to someone. You won't find an icon for the Event Log viewer program. You'll have to enter a "secret" key combination to get it to appear. View the LogFrom your Home screen, type the following key sequence: Alt-L,G,L,G. This should bring up the Event Log viewer as shown in Figure 1-19.
From within the Event Log, you can view the details of each event by pressing the Enter key. Figure 1-20 shows the details of an event. You can copy specific events to the clipboard on your device by clicking the trackwheel when viewing the details of an event and selecting Copy Event. From the main viewer, you can copy a summary of the current day's events to the clipboard by using the trackwheel to access the menu and selecting Copy Today's Contents. Once the summary is on your clipboard, you can paste it into any other program, including in a new message, by using the trackwheel menu and choosing Paste.
Customize Event Log OptionsYou can use a number of options to filter the events or even expand your view to include events that have a lower severity. To access the filter options, click on the trackwheel and choose Options from the menu. By default, the Event Log displays events with a severity of Warning. You can change the Minimum Log Level setting in your Event Log as shown in Figure 1-21.
You can also control which applications' events show up in the Event Log. By default, the events from all applications are displayed in the Event Log. To modify which program events appear, uncheck the checkbox beside the applications you'd like to not appear in the log. Be sure and save your changes after you make modifications to the Options screen. This is useful for troubleshooting a specific application you're having problems with. The Event Log program also gives you the ability to clear the log. Choose Clear Log from the trackwheel menu to purge all entries in the Event Log as shown in Figure 1-22 to start from scratch when troubleshooting a problem.
About the Author Put Notes in the Call Log
Save notes from your phone calls and recall that information when you need it. While you are on an active call with your BlackBerry, press in the trackwheel and choose "Notes" from the menu. You will be greeted with a nice clean slate of text input, ready to accept your notes, as shown in Figure 1-56.
This will, of course, be most convenient when you're using a headset or speakerphone. The way I use this feature is that I jot down notes relevant to that call such as confirmation numbers or meeting notes, and save them. I can return to the Messages application, find the call in the list of calls I've placed, and find my notes there. From here, you can also copy text and put it into its final destination, whether an email, task, or appointment. If you don't remember to take notes during your call, don't fret: you can add notes to a previous call by opening the call in the Messages list and selecting "Add Notes" from the menu. If you have decided to not show calls in your Messages list, you can magically make them appear by pressing Alt-P [Hack #24]. You can then surf your messages list and get these useful little pieces of metadata and put them to use. If you discussed a budget, an invoice, or something else that you may need to reference later, make a note of it in the call and you can find this information later. If you need to remember what you talked about last time you spoke to Client X, the notes will be right there in the call detail! You can also highlight a phone call that has notes, click the trackwheel, and select Forward (see Figure 1-57) to forward it (notes and all) to an email address.
This lets you quickly shove the notes from that important conference call to your helpless subordinates. —R. Emory Lundberg
About the Author Send a Message to a Group of Users
Do you have a group of people you'd like to communicate with regularly? Here are some tips for sending email or peer-to-peer (PIN) messages to several addresses. If you use distribution lists (DLs) to address email in the enterprise, you can use those same DLs to address email to groups of people from your BlackBerry. Also, it is pretty simple to create and send a PIN message to a person [Hack #27]. You can also include the PINs of several people, if you'd like the same message to go to multiple recipients. That works for an occasional message, but if you have a particular group of people to which you would like to send PIN messages frequently, you'll find yourself getting tired of adding the individual recipients each time you create a message. You cannot use an Address Book group to send PIN messages, but you can still accomplish the task in other ways! Use Distribution ListsAny distribution list can be added to your Outlook Contacts in the same manner you would add any other entry from your enterprise Global Address List (GAL). Simply select the name in the GAL or email message, right-click, and select Add to Contacts. When your contacts are synchronized with the Address Book on the handheld, those entries will be copied to your handheld, and therefore can be used to address email from the handheld. Alternatively, if you have a message that was addressed to a distribution list, that has been received on the BlackBerry handheld, you can also use that to save it in your Address Book for future use. Here's how:
Now you can use this DL in the To line of any message you address! Create a Boilerplate PIN MessageNext, you need to create a sample PIN message and address it to a group of users. But don't send it just yet!
Use Your Saved Message to Send a PIN MessageNow you have a saved message in your saved messages application that you can use over and over to send a message to the users who were added as recipients. Simply open the Saved Messages application and locate your sample message. Then follow these steps:
You can use this sample message over and over again. You can also modify this message to add or remove recipients at any time, or to change the PIN of a recipient. —Shari Kornberg
About the Author
Play Zork on Your BlackBerry
With this Java-based mini Infocom interpreter, you can play retro text adventures on your BlackBerry. You can even write your own games if you want! "Open mailbox. Take leaflet and read it." Those are the sentences you need to kick off a game of Zork, which is, to many, the prototypical text adventure. You're more likely to hear these games referred to as interactive fiction these days, and although many things have changed since the days when Infocom and Adventure International owned the genre, these games are very much alive. You'll find a thriving community of interactive fiction gamers and authors at the Interactive Fiction Archive (http://www.ifarchive.org/). On this site, you'll find hundreds of games, tools to create your own, and all sorts of information. As a text-friendly handheld, the BlackBerry is the perfect platform for interactive fiction. There are a couple of ways you can play these games on your BlackBerry. Z2ME (http://gpf.dcemu.co.uk/) is a port of ZPlet (http://sourceforge.net/projects/zplet/), a Java-based interpreter for the Z-Machine, the virtual machine that Infocom used for their interactive fiction games (compiled games are said to be in the Z-code format and have a file extension indicating which version they were compiled for, such as .z3, .z5, and so on). Many modern interactive fiction titles use the Z-Machine, so you'll find plenty of games for it. Another J2ME Z-Machine interpreter is ZeeME (http://www.gizmo-a-gogo.org/ZeeME/index.html). Both Z2ME and ZeeME will run fine on the BlackBerry, but there is a customized version of Z2ME that is more BlackBerry friendly. However, I was unable to get it to work on the 7100 series of BlackBerry handhelds, since Z2ME did not work correctly with the SureType input methods. Find Games to PlayOne of the problems with both Z2ME and ZeeME is that they come with one game (Mini-Zork). To add another game, you'll need to modify the jar file and install it on your device. Because there is a limit on the size of a jar file (the biggest jar I've been able to load is 76K), you need to pick small games. To see a directory listing of all the Z-code games in the interactive fiction library, visit ftp://ifarchive.org/if-archive/games/zcode/. If you open that URL up in a filesystem viewer, such as the Mac OS X Finder or Windows Explorer, you'll be able to sort by file size. Look for small Z-code files, and cross-reference what you find with the listings at Baf's Guide to the Interactive Fiction Archive: visit http://www.wurb.com/if/platform, scroll down to "Z-code," and click the link. Then you can look up a game you're interested in and read a synopsis and review. Not all games are listed, but Baf's is authoritative enough that you safely use the absence of a review as a filter. If you've got all the time in the world, though, you should try everything. There are worse things you could do with your time. For example, suppose 905.z5 catches your eye. It's 60.5K and might be small enough. So you head on over to Baf's, locate a review, and see that it got a decent review (four stars). Then you download the file, and use the instructions listed in the next sections to package it. Next, create a .jar (or .alx), post it on a web site for an OTA download (or use the Application Loader) [Hack #97], and start playing the game on your BlackBerry.
Use Z2MEZ2ME is available from http://gpf.dcemu.co.uk/ as an over-the-air installation (OTA). There are also Application Loader versions available if you have problems with the OTA install (see Phillip Bogle's post at http://www.thebogles.com/blog/2005/06/play-infocom-classics-on-your.html if you are determined to do an OTA install). When you launch Z2ME, Mini-Zork will appear. Figure 3-18 shows an intrepid adventurer doing something very wise.
Although Mini-Zork will keep you busy for a while, you might want to play some other games. It takes a bit of effort to set this up (and it's lot easier with ZeeME), but it's well worth it. Unfortunately, Z2ME only supports Inform Version 3, and you may not be able to find many compiled games in that format (Versions 5 and higher are more common). But if you search the archive (and Baf's guide), you'll find some. Suppose you download dejavu.z3 from the Interactive Fiction archive. You now need to rebuild the Z2ME jar file to hold this new game. You'll need to grab the source code to the BlackBerry version of Z2ME from http://gpf.dcemu.co.uk/ and open it in the BlackBerry JDE. Remove minizork.z3 from the project and replace it with dejavu.z3. Then, find the blackberryZ2ME.jad file in the project and change the
to:
Save and compile the project, and you'll have a jar that contains a different game. ZeeMEZeeME's user interface is a bit rougher than Z2ME's, but it supports newer Z-code files, and also has a nifty packager that lets you easily create jars of games. To use ZeeME on a BlackBerry, scroll all the way to the bottom of the screen, type your command in, and click the trackwheel to bring up the menu. Click Input, as shown in Figure 3-19, to enter your command. Be sure to use the Settings menu to set a comfortable screen width as well. You can download ZeeMe at http://www.gizmo-a-gogo.org/ZeeME/index.html. Both the .jar and .jad files are included on the site. Since the jar's MANIFEST contains everything ZeeME needs to know to function, you can install directly from the .jar rather than from the .jad. As with Z2ME, ZeeME includes Mini-Zork. If you want to run additional games, you'll need to create a separate .jar file for each of them. Also available on the ZeeME web site is the ZeeME Packager, which is a simple application you can use to create ZeeME jars (you should be able to double-click on the packager .jar file to run it). Simply specify the Z-code file, the game name, and the name of the jar you want to create, as shown in Figure 3-20.
Post this .jar online for an OTA download (as described in "Find Games to Play"), or use the Application Loader to install it. If you need to create a .jad for it, it's pretty easy. Use Set up the .jad as follows:
You can also peek in the jar's META-INF/MANIFEST.MF file to get the needed values. Hack the HackIt's amazingly easy to make your own game. Graham Nelson's Inform (http://www.inform-fiction.org/) will let you create Z-code games. Here's the code for a simple game where you are trapped in a lousy place until you can get your BlackBerry working again:
Download an Inform compiler and the libraries (a bunch of .h files) and copy them into the same directory. At the time of this writing, the latest Inform compiler (6.3) was creating Z-code files that were too large to create a reasonably sized .jar, so I suggest that you grab a Version 5 compiler and libraries from http://www.ifarchive.org/indexes/if-archiveXinfocomXcompilersXinform5.html. Save the code into a file in the same directory, and call it bbgame.inf. When you look at the contents of your working directory, if you see these files, you know you're good to go (if you're on Unix, Linux, or Mac OS X, Inform won't have an .exe extension):
Compile bbgame.inf to a .z5 file with:
You should now have a file called bbgame.z5. Use the instructions from the previous sections to package it up in a .jar file, and play it on your BlackBerry. For more information about hacking your own interactive fiction games, see http://www.inform-fiction.org/index.html. —Brian Jepson
About the Author Track MDS HTTP Requests
Figure out where your users are going using the BlackBerry Browser. You may even find some useful site that you want to visit. Do your users use the Mobile Data Service? How frequently? Do your users go to Internet sites or intranet sites more often? Which sites are visited most? All these questions are interesting ones that will be different in any environment. The more data you mine from the logs will translate into more knowledge about how your users are using the service and how their experience can be improved. Perhaps an intranet application that you know has not been optimized for the BlackBerry is nevertheless being visited but not fully utilized by your BlackBerry users. You may want to go to the application developer to push for better wireless support in the web application. You might even see frequent access to various HTTP traffic for online games [Hack #32]. Perhaps you would want to disallow access to these and other non–business related sites. A single HTTP request in your MDS logs takes up at least 16 lines, and the hostname and the rest of the URL are on different lines. This makes using a simple grep command to extract the URLs impossible. Here is some Perl code that keeps track of HTTP GET requests, reconstructs the original URLs and prints them by the number of requests made to each. The Code
Your MDS logs appear with your other BlackBerry logs in the following directory where YYYYMMDD is the current date (assuming you've installed your BES on the C: drive):
The Mobile Data Service logs will start with your BES name followed by the string
Type the code into your text editor and save it as site_extract.pl. Run the CodeBring up a command prompt, change directory (cd) to the directory where you saved the file, and type the following command to run the script:
You'll get a list of URLs preceded by the number of instances they appear in your logfile, as shown in the following:
You could easily pipe the output to a file and open the data using a spread-sheet program such as Microsoft Excel.
About the Author Integrate the Browser into a Java App
Combine the richness of a Java client with the extensibility and power of a web backend. Berry 411 is built using a Java client that launches a web browser. This is a powerful and convenient way to build mobile applications. The Java client provides instant accessibility from the Home screen and a rich native BlackBerry UI. The browser results screen allows for zero-install deployment of new features, easy display of rich text and graphics, and linking to the expanding array of mobile-friendly web content. The BlackBerry is especially well suited to building this sort of application. The Back button works as expected when going back from a browser page to the client application that launched it. Using the built-in browser network configuration avoids many of the configuration hassles of direct network access, which requires a number of carrier-specific parameters. Launch the Browser from JavaIn this hack, we'll build an application to do reverse phone number lookups, going from a phone number to a name and address. The Java client displays a titlebar and input field, filtered to limit the user's input to 10 digits. When the user selects Search from the menu (see Figure 9-4), the application launches a web page (in this case, an existing Infospace service) to display the results, shown in Figure 9-5. Even in this very simple form, the hybrid approach has advantages over a pure browser solution. The application launches instantly and has a degree of control over the user's input, which could not be achieved in a browser. It would not be difficult to extend this application to take further advantage of the rich Java client; for example, it could allow the user to select a phone number from his Address Book to look up. The Code
Save the code as BrowserLauncher.jav'a: this is the sole class in this application. The key function is Compile and Run the ApplicationTo compile this code, use the Research In Motion JDE, which you can download from the BlackBerry web site. The code has been successfully tested with Versions 3.7 and 4.0 of the JDE. Create a new workspace and project in the JDE, and add BrowserLauncher. java to the project. (If you'd like to save yourself the typing, you can download a ZIP archive, including the entire project, from http://thebogles.com/browserlauncher.zip.) Select "Go" from Debug menu, and the JDE will build the application and launch the BlackBerry simulator, including the application. You should also launch the MDS simulator from the JDE Start menu item to allow the application to access the network. Once the simulator is launched, you can scroll to the BrowserLauncher application on the Home screen and click on it, by using your mouse scroll-wheel. Type in a listed 10-digit phone number, click on "Search in the menu, and you should see the results displayed in the browser. Sign and Distribute the ApplicationLaunching the browser is considered a "controlled API" by Research In Motion. To run the application on a real BlackBerry, you will also need to register for a code signing key and sign the application [Hack #98]. —Phil Bogle
About the Author |