The Source for Java Technology Collaboration
User: Password:



Kathy Sierra

Kathy Sierra's Blog

MIDP 2.0 is just too much fun.

Posted by kathysierra on January 14, 2004 at 08:52 PM | Comments (9)

I've spent the last few weeks playing with the Wireless Toolkit and MIDP 2.0. I've been in EJB-land for the last several years, so it's quite a shock going from big ol' gravel-hauling apps where it takes about a dozen objects to do Hello Bean, to these tiny little things where each object is precious.

But man oh man is it ever fun! The MIDP 2.0 Game API is so easy to use. In about 15 minutes after flipping through the API and the MIDP spec, I built a multi-frame animation, fully user-controllable, with automatic double-buffering, in about a dozen lines. And that 15 minutes includes creating the graphics! Until I started playing with it, I really had no idea how simple and clean it is to use GameCanvas and Sprite.

Of course, developing and deploying games for *real* devices is a *lot* more involved--I'm just using the emulators that come with the Wireless Toolkit. But I'm paying attention to the JTWI spec and trying to work within the constraints recommended for portability. And there's that little issue of, well, virtually no devices in the US that currently support MIDP 2.0. Still, I haven't done something so quickly and simply since the old Applet days. Except that was Java 1.02, when I had to walk uphill in the snow both ways to do my own double-buffering and, oh yeah, roll my own scrolling text area because the original one in AWT didn't exactly *work*.)

And it's a walk down memory lane, too. I'm looking at the new MIDP 2.0 Style Guide, and I could swear I'm reading word for word some of the things we used to all do and say about writing games 10 years ago--reduced indexed color palettes, extreme caution with object creation, putting up a splash screen while you wait for your first offscreen buffer to be displayed... but it's great fun and so satisfying to use the Wireless Toolkit--you get instant gratifcation. So different from writing enterprise beans or even servlets/JSP. You sit down at your editor, and a few minutes later you have this cool thing running in your choice of faux phones. (Although I have NO idea what's up with that scary-looking thing in the toolkit they call the "querty device". Yikes.)

So here's the part that sucks--NO SUPPORT FOR MAC OSX! Yes, you can do MIDP development on the Mac, with a little effort and configuration, but you cannot run the Wireless Toolkit. And apparently the Borland tool is no longer supported on the Mac either. In fact, there are apparently NO useful J2ME development environments for OSX. That just sucks. I *did* manage to get the Wireless Toolkit to run under Virtual PC on my Mac (thanks to Michael Yuan for letting me know that he got it running, or I wouldn't have tried). It's painfully slow, of course, but no slower than my ancient PC. And all because of one small piece of the toolkit that's apparently native? I've talked to Ariel, the lead developer of the WTK, I think, and he was happy to hear I had it running under Virtual PC, but did not know of--or have plans for--a Mac version. (He's still my hero for making the toolkit, though). I talked to the "Java guy" at Apple (Dan Steinberg introduced me to him at MacWorld, but I forgot his name) and Dan and I both made our points about wanting J2ME developer support on the Mac. I'm sure tons of other people have complained about this... I know there have been other blogs here and on O'Reilly about it. But I just thought I might as well add my own special way of complaining. : )

It's so easy to get started playing around with MIDP 2.0, that I don't know why more folks aren't trying it out. It takes, like, five minutes to install the toolkit (45 minutes if you have to first install Virtual PC on the Mac!), and you're good to go (all you need to do is tell it where your JDK lives). After that, it's so simple to write, build, and run (in emulation) your first little app:

1) Launch the KToolbar part of the toolkit. It comes up immediately with a little window and waits for you to Create or Open a project.

2) Create a new project just by giving it a name for your project and a class name for your MIDlet.

3) Most helpfully, the tool builds a complete directory structure for you in the "apps" directory within the toolkit home. It makes *everything* you need, and even tells you where to place your source file.

4) Open your editor and type in a little MIDlet (a class that extends MIDlet). These are tiny little things, mostly, with lifecycle callbacks that work much like applets. There are plenty of examples that come with the toolkit. Be sure to name the class with the name that you specified when you created the new project.

5) Click the Build button. Really. That's it. It compiles your little MIDlet and (assuming you don't get compiler errors) it's ready to run.

6) Click the Run button. Up pops the default, garish-yet-somehow-stylish emulated phone. You'll see your project name and a "launch" button. Select the "launch" button and there you go! Wow!

7) Oh, you made a mistake and it doesn't work correctly? No worries. Change your source code, hit "save" in your editor, and click Build again. It really is that simple. Geez. Compare this to the steps to try even the simplest bean or--these days--even a simple web application requires some effort to configure and deploy into Tomcat correctly. Yes, we have Ant scripts for everything, but there's just a hundred and one picky little things that can always get you, especially when moving to a new machine, new version of Tomcat, etc. But this Wireless Toolkit, well, like I said--instant gratifcation.

The best news today seems to be that most developers doing MIDP development *are* in fact doing games. Small games. That means that some lucky folks are doing real-world development where you can have a complete product built and delivered in a week or less. Yeah, there are plenty of headaches for those doing real deployment, but these Java-enabled devices finally *are* starting to appear now, even in the US, in a Big Way. (Sure, 2.5 years after it was announced at JavaOne that these days were just around the corner, but still. It HAS finally happened.) And MIDP 2.0 support can't be *that* far behind.

So if you just want to have some fun, and who knows -- maybe soon you'll have a chance to work full-time or even just on the side on some little mobile device games--download the Wireless Toolkit and play. It's the least painful New Java Thing To Learn that I can think of, and it'll help you get your simple game chops back. Lunar Lander. Asteroids. You *know* you used to make those things when you were *really* supposed to be studying for midterms...

Besides, *small* things are now culturally popular. There's the Mini Cooper. The new iPod Mini. And there's Mini Java. (Yeah, yeah, I know it's MICRO, but "mini" is cooler.) So I'm now unofficially insisting that J2ME is Java 2 Mini Edition.


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • J2ME on OS X
    Yep, I'm waiting for J2ME to reach OS X properly too...

    I'm getting tempted to do it myself.

    Posted by: davidwalton on January 15, 2004 at 06:31 AM

  • J2ME on OS X
    Give in to the temptation... ; )

    Posted by: kathysierra on January 15, 2004 at 06:58 AM

  • Microemulator
    I've not tried this myself, but there's an open-source MIDP (1.0) implementation at http://www.barteo.net/microemulator/, which might run on OS X.

    Posted by: egalluzzo on January 15, 2004 at 11:27 AM

  • Microemulator
    Now I've gone and opened my big mouth about porting it myself I've started looking around to see what else is out there.

    The only other OS X resources I could find were http://homepage.mac.com/drmx/java/ and http://mpowers.net/midp-osx/

    Nothing else seems to have happened since, there's certainly no MIDP 2 stuff available.

    Posted by: davidwalton on January 16, 2004 at 01:22 AM

  • why isn't the J2ME toolkit 100% Java?
    Kathy:

    I was never able to understand why the J2ME toolkit wasn't 100% Java. Obviously, today it isn't a Java capabilities/performance problem, nor was it when the toolkit was created.

    In the interest of efficiently supporting the 3 official Sun supported Java target platforms, as well as enabling other first tier Java platforms like OS X this is both puzzling and problematic.

    From a "we're a Java shop" perspective, this looks really bad. If your contact could make a comment on this, that would be great.

    Best of all, would be to give a rough projection of when native elimination would be done (only partly kidding).

    regards,

    glenn

    Posted by: ga24 on January 18, 2004 at 12:29 PM

  • OS X
    Hi Kathy,

    Michael Powers has a port of MIDP 1.0.3 for OS X here:

    http://mpowers.net/midp-osx/

    Unfortunately I don't know of any MIDP 2.0 implementations yet.

    And yes, it is fun, light, nimble. I've been doing quite a bit of writing about it, including a Game API article that you might like:

    http://jonathanknudsen.com/

    Enjoy!

    Regards,
    Jonathan

    Posted by: jonathan on March 18, 2004 at 02:28 PM

  • It's amusing how SUN keeps pushing the idea of a cross-platform Java while mobbing against APPLE. Both the JDK 6 and the J2ME 2 are not available for OSX native.

    Posted by: ldp on February 21, 2007 at 06:16 AM

  • wow power leveling
    wow powerleveling
    wow power leveling
    wow gold
    wow items
    feelingame.com
    wow tips
    Most Valuable WOW Power Leveling Service
    wow power leveling faq
    cheap wow power leveling
    wow power leveling
    wow powerleveling
    wow power lvl

    Posted by: wowleveling3 on December 14, 2007 at 12:11 AM

  • 网络营销软件
    网络营销软件
    网络营销软件
    群发软件
    群发软件
    ---
    群发软件
    网络营销软件
    论坛群发软件
    网站排名软件
    群发软件
    推广小助手破解版
    论坛群发软件
    网站排名软件
    群发软件
    推荐给你很好的群发软件和信息群发软件和供求群发软件
    推荐给你很好的群发软件和信息群发软件和供求群发软件博客群发软件网络营销软件网络营销软件
    网站排名软件网站排名软件网站优化软件信息群发软件信息群发软件信息群发软件论坛群发软件网站推广软件网站推广软件博客群发软件博客群发软件
    群发软件
    网络营销软件
    网站推广软件
    群发软件群发软件博客群发软件论坛群发软件网络营销软件论坛群发软件
    信息群发软件推广软件网站推广软件网络营销软件网站推广软件群发软件网站排名软件网站推广软件博客群发软件论坛群发软件群发软件网站排名软件网站推广软件博客群发软件论坛群发软件
    网站排名软件
    博客群发软件
    网站排名软件
    网站推广软件
    群发软件信息群发软件
    免费论坛群发软件
    论坛群发软件
    网站排名软件
    免费博客群发软件
    网站推广软件

    群发软件
    博客群发软件
    网站排名软件
    网站推广软件
    群发软件信息群发软件
    免费论坛群发软件
    论坛群发软件
    网站排名软件
    免费博客群发软件
    博客群发软件
    信息群发软件
    论坛群发软件
    信息群发软件
    博客群发软件
    qq群发软件
    邮件群发软件
    博客群建软件
    企业名录搜索软件
    信息群发软件
    邮件群发软件
    论坛群发软件
    博客群发软件
    网站推广软件
    网络营销软件
    全能营销破解版
    网络营销软件
    论坛群发软件
    论坛群发软件
    论坛群发软件
    网络营销软件
    信息群发软件
    信息群发软件
    信息群发软件
    群发软件
    论坛群发软件

    Posted by: sun98989 on December 30, 2007 at 05:06 AM





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds