Editor's Note: MIDP support for the hiptop is supposed to be out "Real Soon Now" but Danger has not published a specific date. MIDP support gets sent out to all current subscribers as an OTA update. Danger’s hiptop device is a mobile communication product that is as famous for its celebrity devotees as for its innovative design and feature set. The hiptop is available from a number of wireless operators around the world, notably T-Mobile USA and its larger cousin T-Mobile Germany, where the hiptop is marketed as the T-Mobile Sidekick. Because Danger, Inc. is now a licensee of the Java Platform Micro Edition (Java ME), you can program for it using the industry-standard APIs of the Mobile Information Device Profile (MIDP) 2.0. This article will provide an overview of the hiptop as a development platform, then show you how to get started creating your own applications. What's a hiptop?
Genealogically somewhere between a RIM Blackberry and the Nokia N-Gage, and with a helping of what was good about the Apple Newton, the hiptop is a development platform unlike any other.
The unconventional hardware design of the hiptop, shown in Figure 1, gives a developer much to consider. Unlike most MIDP devices, the display on the hiptop has a wide aspect ratio, measuring 240 by 160 pixels, and the device sports a number of interesting buttons and controls as well. Aside from the directional pad, four navigation buttons frame the corners, and two "shoulder" buttons appear at the top of the device. A scroll wheel akin to the one on a Blackberry is bounded by page-up and page-down buttons. If that weren’t enough buttons, when you open the hiptop’s signature flip-top screen, as seen in Figure 2, you have access to a full QWERTY keyboard. The good news is that the MIDP input APIs afford you the flexibility to take advantage of these hardware features in a platform-independent manner.
Equally compelling as the hardware is the software running inside it, and the two work together to create a seamlessly pleasant user experience. The user interface has a rich selection of GUI components, more nearly comparable to those found on a desktop computer or a PDA than on the typical mobile phone. The implementations of the MIDP Form APIs map directly to this component library. Multitasking is at the core of the interface design: Installed applications can be simultaneously active and resident in memory. How this affects the conventional MIDlet life-cycle I’ll discuss later.
The hiptop is a very network-friendly device. In some respects it operates as a thin client, off-loading certain processing and data storage tasks to a server hosted by the mobile operator. For example, the hiptop's implementation of the Record Management System (RMS) stores data on the device and automatically synchronizes it with a backup copy on the server. Because each hiptop is in constant communication with its server, most mobile operators that support the device do so with a flat-rate data plan. A reasonable inference is that the networking facilities available to you through the MIDP connector framework will be robust. Despite this network-centric design, the hiptop is not capable of conventional over-the-air software installation from a public web server. Hiptop users install applications and ringtones exclusively from a carrier-operated catalog of content, available directly on the device, shown in Figure 3.
The hiptop SDK
The built-in merchandising capabilities of the catalog give developers a clear path to market for their applications. To test applications on the device, developers must join the Danger developer program and apply for a digital signature key. Developers must also agree to waive customer support from their mobile operator.
At the core of the hiptop software environment is Danger's Java runtime and custom frameworks. All applications and some portions of the operating system and UI toolkit are completely written in Java. A complete hiptop-specific application framework with supporting utility frameworks affords easy subclassing to create software that conforms to users' expectations of the hiptop environment. On top of this framework, Danger has implemented the Connected Limited Device Configuration (CLDC) 1.1 and MIDP 2.0. This architecture gives developers tremendous flexibility in building their applications, using either the familiar and generic MIDP APIs, or the more powerful but hiptop-specific APIs. To get started, the first thing you need is the hiptop software developer kit (SDK), available from the Danger developer web site at http://developer.danger.com. The SDK is available only to members of the Danger developer program, but it’s free to join the program, and to download the SDK. Once you acknowledge your agreement to the licensing terms, you’ll be allowed into the site, where you’ll find the SDK download links, as well as FAQs, documentation, and a discussion forum. The forum is actively maintained, and a quick search will typically turn up answers to most questions.
If you have the Java Development Kit 1.3 or later and the Ant build utility 1.6 or later, all you need to add to start building applications for the hiptop platform is the SDK. While most of the tools, libraries, and, importantly, the hiptop simulator are written in Java and thus portable to virtually any development platform you’d use, a few important utilities exist only as native binaries. For this reason, development is supported only on Windows, Linux, and Mac OS X. The build environment is completely driven by Ant. You may use the text editor and IDE of your choice, so long as it can drive an Ant build script. You may find the Sun Java Wireless Toolkit (formerly the J2ME Wireless Toolkit) very useful. The SDK’s examples directory contains a diverse collection of sample projects that build and run out-of-the-box with a single call to Ant.
You'll find a set of MIDP-oriented sample projects in the
For testing, the SDK includes a version of the hiptop operating system software called the simulator. The simulator is based entirely on Java technology, reasonably quick to launch, and it provides a convenient environment in which to test applications before deploying them to a device. You may need to keep a cheat sheet of the keyboard mappings handy because the simulator uses the development machine’s keyboard, including the numeric pad, to simulate all of the input methods on a hiptop.
As I noted earlier, the hiptop is in some respects a thin-client device, deferring some tasks like web-page rendering, network proxy, and data storage to a server hosted by the mobile operator. In hiptop parlance, the functionality offered by this server is called the Service. Danger maintains a separate instance of the Service for developers working with the SDK, although access to it is permitted only on request. Danger's developer web site has a simple form you fill in to request permission to use the Service.
For deployment to a hiptop device, the SDK includes a utility called htconsole. This command-line program opens a terminal-style serial connection to the hiptop over a USB cable, and displays the contents of
To install applications onto a hiptop device, developers must request from Danger a development key, a file used to sign applications so that they can be installed on a hiptop. Developers that show a sincere interest in writing applications should have no trouble obtaining a key.
At this writing, MIDP support is not available on any hiptop device currently in production. Version 2.3 of the hiptop operating system includes MIDP and is expected to be deployed as an over-the-air update for T-Mobile USA subscribers in late 2005. Until then, developers can write and test MIDlets on the simulator, but won’t be able to test them on the device. Porting a MIDlet to the hiptop
The easiest way to get started with MIDP on the hiptop is to port an existing MIDlet. This scenario is the most common because a vast number of MIDlets have already been written, and Danger makes this process as easy as it can. The supplied build script effectively takes an existing JAD and JAR file and converts them into an application bundle suitable for running in the hiptop environment.
The first step is to duplicate the
Next, modify your project's build.xml file, replacing references to HelloWorld with references to your project. The fields to update are the project name, the
Now, in your project's bin directory, replace the existing
Last, in your project's This resource file is also where you specify custom icons and splash screens. Because the defaults are reasonable for now, don't make any other changes.
Here are the contents of
That's all you need to do. Launch the build script from your project directory with the ant command and the JAR will be repackaged as a hiptop bundle and launched in the simulator. Figure 6 shows JBenchmark2 running on the hiptop.
Building a MIDlet for the hiptop
If you want to tweak your MIDlet to take better advantage of the hiptop hardware or optimize the user experience, you need to build your projects from the source code instead of the compiled JAR file.
This time, the first step is to duplicate the
Next, replace the contents of your project’s bin and src directories with the contents of the MicroTank project's bin and src directories. Add a res directory to your project and copy the files from MicroTank's res directory. Now the bin directory should contain the files
Update the build.xml file to reflect the project name, the application's main class, and the package that class is in. Because MicroTank’s classes have no declared package, just remove the
It's important that you now rename the JAD file to match your
Likewise, you must change the name of the resource file in the locale/en_US directory to match your
Because absolutely no code changes are required, you're now ready to compile and run. Execute the build with the ant command from your project directory. The source code will compile, the resources, JAD file, and classes will be packaged into a hiptop application bundle, and the simulator will launch. Figure 7 shows MicroTank playing on the hiptop. (The prerelease build of the SDK seems to have some problems with transparency.)
More Considerations
MIDlets running on the hiptop are meant to look and feel as much like native applications as possible. As such, they are expected to conform to the platform usability standards in a way not typically required of most MIDlets. There are several aspects of the hiptop platform that developers should keep in mind.
While the life-cycle of a MIDlet on the hiptop conforms to the MIDP specification, it may be different from what some developers would expect. The first time the user launches the application, the hiptop runtime instantiates the MIDlet and calls
Because hiptop users are incessant multitaskers, MIDlets must be sure to pause their threads and generally minimize their resource consumption when
The hiptop screen has a completely different aspect ratio from most other MIDP devices. While form-based MIDlets won’t have a problem, games and other canvas-based applications should scale their user interface to take better advantage of the full screen, based on the dimensions the Canvas class’s To make this transition easier, Danger has provided some compatibility modes, configurable from the resource file, that force Canvas to return the dimensions of many other popular MIDP devices.
User input is handled through the Canvas class’s For ease of transition, Danger supports a compatibility mode, where certain buttons on the keyboard (see Figure 2) map to the 12-key pad found on most phones. You enable this mode through a property in the application’s resource file. The Audio Building Block implementation required by the MIDP 2.0 specification allows applications to produce sounds and music. The hiptop supports MIDI through its embedded high-quality Beatnik audio engine. Neither MMAPI nor video capture through the built-in camera is yet available.
A final word of caution: You might want some MIDlets to take full advantage of the platform-specific APIs available on the hiptop platform. Be aware that the hiptop doesn’t support mixing its own UI toolkit with MIDP’s Conclusion
The Danger hiptop is certainly one of the more striking MIDP-capable devices on the market, and developers will need to be cognizant of the platform's myriad idiosyncrasies if they plan to bring an application to market. Danger's toolset makes it easy to take existing MIDP code and get it running on the hiptop. The rest is up to you.
Editor's Note: MIDP support for the hiptop is supposed to be out "Real Soon Now" but Danger has not published a specific date. MIDP support gets sent out to all current subscribers as an OTA update. | ||||||||||||||||||||||||||||
|
| ||||||||||||