One of the cool things I read about in the October version of the BlackBerry developer newsletter was the Invoke API. First introduced in version 4.0 of the JDE, the Invoke API gives developers the ability to launch native BlackBerry applications like the addressbook, the calendar, email and on the 8100, the camera and map applications. A long time ago I wrote a J2ME application that enabled you to view recipes from my wife's recipe site on your J2ME enabled phone and one of the most obvious features the application was missing was the ability to send a recipe via email to someone else. Using the Invoke API on the BlackBerry would make it easy to do so; you'd end up with something like this:
Invoke.invokeApplication(Invoke.APP_ TYPE_MESSAGE, new MessageArguments(MessageArguments.ARG_NEW, “firstname.lastname@example.org”, “Cool Recipe on KarensRecipes.com”, recipeBody));
A long winded way of saying that the tools that come with the BlackBerry JDE are now also packaged separately and allow you to write applications using something other than the BlackBerry JDE, which is something I ranted about a couple months ago. You can read the release notes (in PDF format, eww) or check out the Application Developer Guide (volume 1) which discusses how you can use the debug tool from within Eclipse on page 195. Nicely done RIM!
The latest issue of SDTimes has a short article about the new MDS Studio which is part of the upgrade pack that RIM recently released. The main feature the article talked about was the ability for developers to point to a WSDL file (which is an XML file that describes a web service for those of you who don't wear propeller hats) in MDS Studio and the IDE will automatically generate an application for you (with the caveat that users who use this application must have the MDS runtime installed on their BB's and the BES you're using must install the MDS Services for Web Services component).
This sounded like pretty cool stuff, so I had to try it out... after digging out some space on my hard drive and clicking past all the open source license agreements (
including Derby, Axis, Bouncy Castle Crypto library and Eclipse / WSDL4J), I opened up MDS Studio and created a new project. The first step when creating a project is to point to a WSDL file, of which I've got a couple... I popped in the WSDL URL, it brought up all the available methods for that endpoint and then automatically created an entire application with screens for every one of the available methods. NICE. Our local BES is running an older version so I couldn't test out a deployment, but I HIGHLY recommend you check this out if you're doing any kind of BlackBerry development. It looks very cool AND it's based on Eclipse (which I've complained about them not using before) so there will be very little cognitive dissonance if you're a avid Eclipse user like I am.
Download MDS Studio now (and make sure you've got about 700MB of free space on your machine)
Cingular is hosting a webcast for BlackBerry developers interested in creating applications for the new BlackBerry 8700c. According to the email I received, the webcast will cover:
· What differentiates the BlackBerry 8700c from other PDAs and how Cingular will market this new device
· How to begin development for the new BlackBerry 8700c including information on the BlackBerry Java Development Environment
· Tips on development shortcuts
· Tools and resources to guide your development efforts
· Developer Support Programs, including resources through Cingular devCentral and RIM Developer Zone.
This is probably old news for some of you (I'm catching up slowly) but the folks at RIM released BlackBerry JDE v4.0.2 a couple weeks ago. Noteworthy in and of itself, but the big note in this release is the inclusion of support for JSR 179, the Location API for J2ME*1. Mobile location based services have to be one of the hottest things going on these days (witness Where 2.0). The ability for your handset to know where in the world it is (and hence where you are) has the potential to enhance just about everything you do on your BlackBerry: the address book can show you where you are relative to one of your contacts, the calendar might be able to alert you that not only do you have a meeting but that you are 100 miles away from a meeting happening in less than hour.. you're gonna be late! Your wireless internet experience is transformed by applications that know where you are automatically, no need to punch in a zip code or an address. Associate your tasks with a location and the Task application could ping you about something that you need to get done that's right around the corner. Maybe it could automatically compute the quickest route between your stops for the day based on your starting point. What about a mobile Amazon-esque application called "WhereShouldIGo?" that pinpointed your location and then suggested places that you might want to visit based on your previous travel history and the clustered results of 5,000,000 other users?
Back to the Location API and the BlackBerry JDE. If you download and install the JDE you'll find a demo application (called GPSDemo) which is a simple travel computer, recording route coordinates, speed and altitude. It retrieves your location from the Location API (technically the LocationProvider) every 10 seconds and then sends it to a server every 100 seconds all the while displaying your latitude, longitude, altitude, heading and speed on the screen. Interested? Read the JavaDocs.
*1For those of you who aren't Java developers, JSR stands for Java Specification Request; it's the process through which members of the Java Community Process (JCP) make additions and modifications to the Java platform, which of course the BlackBerry is based on.
New article which covers the creation of a BlackBerry J2ME application using the BlackBerry JDE was recently posted to Sun's Developer site. I'm more of an Eclipse guy (I'm not sure what the thinking is behind making developers use your development environment, I guess it's a 'make it easy for the corporate guys who can't code unless it's handed to them on a silver platter' kind of thing).
The latest version of the Blackberry IDE is available on Blackberry.com, full release notes below. There actually seems to be some pretty exciting stuff in here.
· Previous Blackberry's didn't offer a TCP/IP stack, if you wanted to make a HTTP connection to retrieve XML from a website, you had to use the WAP gateway that the carrier setup.
· They included an XML parser so that you don't have to go out and use kXML (which isn't that bad, but it's an additional jar in your and every bit counts on mobile phones).
· The mail API includes the ability to set a listener on the inbox, which means you could write an app that listened for a specific type of message (say a message with a certain subject line or body copy) and then perform some sort of action....
· The browser API allows you to register your application with the rendering library to that you application could handle MIME types that the browser doesn't have the ability too (ie: you could write an RSS reader app to handle any invocations of application/xml)
We are pleased to announce that the BlackBerry Java Development Environment (JDE) v4.0 is now available for download from the BlackBerry Developer Zone. The new BlackBerry v4.0 platform includes a number of enhancements that you can take advantage of when building custom applications for BlackBerry, including:
* Enhanced Java API libraries for 3rd Party Applications
* Enhancements to the BlackBerry Browser for Improved HTML Rendering & Offline Capabilities
* Enhanced "Reliable Push" Interfaces Within BlackBerry Enterprise Server's Mobile Data Service (MDS)
* New BlackBerry Handheld Simulators
Where Can I Download BlackBerry JDE 4.0?
(a) The new BlackBerry JDE v4.0 can be downloaded from the BlackBerry Developer Zone:
(b) Developer Guides and Whitepapers for BlackBerry JDE v4.0 can be downloaded from the BlackBerry Developer Zone's Java Documentation site, located at:
What's New? Enhanced BlackBerry Java API's
BlackBerry JDE v4.0 includes a number of enhancements to the Java API libraries available to 3rd party developers, such as:
* MIDP 2.0 and CLDC 1.1 Support
* BlackBerry Phone and Application Invocation APIs
* Enhanced Email, PIM & MenuItem APIs
* Native XML Parser and Generator
* Direct HTTP and TCP/IP Connectivity Support
* PIN-to-PIN Messaging API
* Service Book API
* Shared Game Library
* Bluetooth "Serial Port Profile" API
* "Grouping" API for Improved Memory Management
* Support for Reliable Push (see below)
What's New? Enhanced BlackBerry Browser Features
* Enhanced Rendering for HTML Tables
* Offline Forms: Support for Queuing Form Submissions If Out Of Wireless Coverage
* Support for Animated GIF Images
* Support for Reliable Push (see below)
What's New? Reliable and Managed Push Enhancements for MDS
* Additional Support for Push Access Protocol (PAP) 2.0
* Support for Reliable Push Transport and Notifications Upon Push Content Delivery to Handheld
* New Push Management Features Including: Push Cancelations, Support for "Deliver-Before" and "Deliver-After" Headers, etc.
What's New? BlackBerry Integrated Development Environment (IDE) v4.0
* Performance Ehancements
* New Handheld Simulators for all BlackBerry Handhelds Available Today
* New JavaDocs and Sample Code
Enrique Ortiz of J2MEDeveloper.com wrote an excellent article that shows how you can use Ant (a Java based build tool) to build your J2ME applications for the Blackberry platform (and simultaneously frees you from having to use the Blackberry JDE instead of your own preferred IDE like Eclipse or NetBeans). He truly goes above and beyond the call of duty with numerous illustrations (a suggested project directory structure, build task flowcharts showing Ant, etc..) and a full Ant build file using the Antenna Ant tasks that help you create create Jad files, and run the Blackberry rapc compiler. Grab yourself a copy now.
A couple weeks ago the guys at FeedBurner released a beta version of their RSS Reader for the Blackberry platform (which according to Steve is a pretty straightforward port of the same version they released for phones using MIDP 1.0). I downloaded it this morning to my 7280 on the AT&T Wireless network (no Blackberry Enterprise Server yet, working on that...), the installation went flawlessly and I was able to download and view feeds within a couple minutes. Couple reflections / things that could be better:
a) when viewing a feed that hasn't been updated yet (i.e. a feed that hasn't been downloaded yet), I get a Java error: "Uncaught exception: java.lang.illegalStateException" and the application exits. I'm sure this will be fixed by the time the application goes live, but make sure that you choose 'Menu --> Update" for each feed before you try to view the feed.
b) Pushing the scroll wheel in to view the menu defaults to the 'Exit' option. Is there a way that this can be modified so that 'Exit' is not the default?
c) The 'escape' button doesn't work on all the screens; I think this is as simple as providing a key listener for the escape button on each screen (ie: the 'Preferences' screen, the 'Register' screen)
d) Thinking differently for a second: the Blackberry is really good at reading and writing email right? So why not make a version of this application that can read and write feeds that you want to read and then save those to a server and have the server email you the text of a post (example: rss2email), thus taking advantage of what the Blackberry does well: email. This implementation is only slightly different than what Bloglines does right now... you enter all the feeds you want to read, Bloglines will go out and retrieve the feeds every n minutes and then you read them from any computer. Using a server-side aggregator instead of a desktop aggregator saves the publisher some bandwidth, the server can splice and dice the feed into something readable for the Blackberry and you can read your feeds in your email client. As a sidenote, there's an interesting discussion over on OreillyNet about RSS and email.
e) I know it's possible to add options to the menu; it would be nice to be able to browse a blog using the browser, have the browser auto-discover feeds and then have an option in the menu to add the feed to your list of feeds. This would probably require some hacking in the browser application provided by Blackberry, so it may not be possible, but it sure would save alot of keystrokes.
Finally, it's interesting to hear Steve mention that "... any application that looks remotely like a WAP stack .." was given alot of criticism at a meeting he attended recently and that more and more of the applications being written for portable devices have to be rewritten for each platform to take advantage of the particular nuances of each device.
Great post over on the PDA Street Forums that shows how you can convert a J2ME MIDlet (technically just the JAD file) into a cod file and then goes on to illustrate how you can transfer the MIDlet / cod combination from your local PC to your Blackberry while connected using the USB cable. It's not for the faint of heart and really only necessary if you can't deploy / download the application using OTA:
a) Download and install the RIM Java Development Environment
b) Download and install Java 1.4.2 SDK
c) Copy the jad & jar files in question to the /bin/ directory of your RIM JDE installation.
d) From the command line (make sure you are in the RIM JDE installation directory, on my system it is "C:\Program Files\Research In Motion\BlackBerry JDE 3.7\bin") type:
rapc import="c:\program files\research in motion\blackberry JDE 3.7\lib\net_rim_api.jar" codename=$your_app -midlet jad=$your_app.jad $your_app.jar
where $your_app is the name of the MIDlet you're trying to convert, $your_app.jad is the name of the MIDlet descriptor and $your_app.jar is the name of the MIDlet jar file. If all goes well you'll see a couple files produced: $your_app.debug (which you can discard) and $your_app.cod, which is the whole point of this operation. Once you have that, move to:
e) With your Blackberry connected to your computer via USB and from the command line (again make sure you're in the RIM JDE installation directory) type:
javaloader -usb load $your_app.cod
f) At this point you should see the J2ME application in your home screen.
You can also use the directions on Blackberry.com, but they aren't as straightforward and they require the use of the Blackberry JDE.