Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Book Reviews Books Media

Pro Java ME MMAPI 20

Cory Foy writes "Several months ago Vikram Goyal emailed me letting me know he had a new book coming out from Apress, Pro Java ME MMAPI: Mobile Media API for Java Micro Edition. Having done mobile device development using J2ME, I knew how difficult it can be to do, or explain, some of the tricks in device development. So I wanted to see if this book could rise up to the challenge." Read below for the rest of Cory's review.
Pro Java ME MMAPI
author Vikram Goyal
pages 250
publisher Apress
rating 8
reviewer Cory Foy
ISBN 1590596390
summary A clear guide for implementing J2ME on your phone


I've noticed as of late that the quality of the technical books I've been reading has deteriorated. Misspellings, wrong calculations, grammatical errors, not the thing to inspire confidence in the subject. In addition, the content can be hard to follow, it's hard to grasp where the author is going, etc, etc.

Not this book. I was immediately struck in the first chapter by how clearly written the book is. Yes, you need to have some knowledge of J2ME device development (specifically MIDlets), but Vikram does a great job easing you in to the subject, and providing good, easy to follow examples.

The subjects he is covering, dealing with media on mobile devices (specifically phones) is a particularly tricky subject. The problem? Many device manufacturers implement standards differently. They claim to support things they don't. They ignore features you would expect. Worse, their emulators, the very thing you develop against, don't always match the phone. In fact, very rarely do they match the phone.

Vikram tackles this by testing his code on several different types of devices, and clearly lists out the dangers of relying on just the spec, or the reference implementation, or the emulator. I've seen versions of the same phone work differently based on what the provider had done to the phone. Verizon will always be evil to me based on my experiences of porting code that worked great on Nextel to Verizon phones, but that's another story.


Chapter 2 provides an overview of the basics of the MMAPI. In particular, how to get data from a DataSource to play in a Player. Since the MMAPI is designed to be implemented by device manufacturers, it is a great read to see how an API can remain simple, yet cover a vast array of inputs and outputs. For example, Player instances can read files, streams, web sites, and a variety of other inputs. It can control audio, video, MIDI and tones. All of this using the same underlying API. Pretty good stuff.

Chapter 3 gets us diving into some code. We write a basic multimedia player, and then improve it to add functionality and increase performance by understanding what is involved in caching Players.

Chapter 4 continues on explaining the more about the underlying architecture, specifically the media player lifecycle and events. Since we are dealing with devices that generally have limited resources, the API provide a way to save claiming those resources until as late as possible. In addition, it provides ways to reclaim those resources, and Vikram covers some of those ways in this chapter. He then moves on to discuss the eventing architecture, and how to respond to custom events (he does briefly describe writing your own events but I can attest that getting anything that low level on a device from US providers is usually pretty difficult).

It wouldn't be a good programming book if we didn't talk about threads at some point, and Vikram touches on it in Chapter 5. Specifically, we're diving into accessing files over the network, and we don't want to block the device while we are doing that. Yes, when you are running a MIDlet, the app thread is the main phone thread, so if it is waiting for network traffic, the phone is unresponsive to the user. So very wise use of threads is necessary. In addition, some security considerations start coming into play, and the book covers what to expect.

Now the fun starts. In Chapter 6, the book discusses Tone Control, the first of 2 entertaining chapters on making your device make noise. The chapter starts off with a very concise explanation of basic music theory to give developers an understanding of what they are going to need to do to generate tones of different pitches. It then moves on to the difference between Mono and Polyphonic notes, and how to create sequences of notes. By the end of the chapter, you too can have your phone playing "Happy Birthday".

Chapter 7 continues on with the party, going into one of my favorite subjects, MIDI. Again, we get a good, concise introduction to the fundamentals of MIDI. We then get to see how to send raw messages to a device that understands MIDI, and how to use MIDI in the MMAPI.

Chapter 8 touches on the other aspect of media — Video. To do this, it first discusses sampled audio, and how to capture and control it. It then goes into capturing video, which many devices may not support, and how to capture snapshots for those devices with cameras. It also covers what to do with the file when you've captured it (for example, save it or display it to the user), and closes with a discussion on streaming media.

I was surprised when I got to chapter 9 because chapter 8 ended by saying what we were going to cover in the final chapter, and I hadn't realized that I had read that much already! Chapter 9 is a great way to end the book. Vikram shows us how to implement our own mobile blogging website, complete with implementing uploads for Text, Audio and Video (if our devices support it). He even provides screen shots and full code, walking through it step by step to help us understand what is going on.

All in all I very much enjoyed the book. If you have a phone capable or supporting J2ME, this is definitely worth a read. The writing is very clear, and entertaining. If there is a downside, it is the poor integration of J2ME in a lot of providers devices, and the inconsistencies in the implementations. But thankfully Vikram guides us through all that so we can quickly be up and running singing along to our favorite dance hit with the words on our phone, mobile blogging the whole thing.


You can purchase Pro Java ME MMAPI: Mobile Media API for Java Micro Edition from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
This discussion has been archived. No new comments can be posted.

Pro Java ME MMAPI

Comments Filter:
  • by perkr ( 626584 ) on Wednesday March 21, 2007 @02:57PM (#18433645)

    Great review. What would have made it even better IMO is if the author's credentials in creating mobile multimedia applications for actual clients were highlighted. Lately I have been disappointed by many books being written by authors who appear to never have actually participated in realistic projects in a corporate/open source setting. The book material in those cases tend to be rather shallow -- more like tutorials than books that can teach you something beyond all free (often great) documentation available on the web.

    A second thought that struck me is that the book sounds very specialized. I wonder how much content of this book that could go into a regular ME book. For instance, threading in order to not block the phone UI is not exactly rocket science... sounds to me there is a lot of filler material in the book.

    • Actually, there isn't a lot of filler (Disclosure: I'm the reviewed ;)). The book is pretty short, and a very fast read. I read it in about 2 hours on a trans-atlantic flight.

      The book is pretty specialized, and it probably would fit well into an ME book, but I think it fills a good niche if you are having to do these kinds of things.

      And, since the story is about to drop off the main screen, looks like this review will set a record for the lowest number of comments on a front-page story. ;)
  • by defile ( 1059 ) on Wednesday March 21, 2007 @03:11PM (#18433813) Homepage Journal

    ...and start developing that great app for your mobile phone. Maybe you too have wondered why no one has developed that killer app, but gosh darnit, you'll just have to be the first!

    Soon you come to realize you weren't the first. The more you look, the more rotting corpses you find. Thousands have come before you and died. What the fuck?

    The sad realization finally sets in: the mobile industry is tightly locked up by manufacturer/carrier imposed DRM, and terms like "net neutrality" are just distant memories. They are the gatekeepers and they don't want just anybody playing inside of their garden.

    Run.

  • Hi,

    I am working at a company where we would like to actually enable users to view our charts and graphs on mobile devices with web connectivity. I have been looking into what the best way to deploy this is. We use chart director to develop our graphs/charts so that's not a problem. But rather how do we develop applications rapidly for use on any mobile with a web connection with/without java installed. What I want to implement is basically business intelligence on a mobile app. At a .NET conference I saw a
    • But rather how do we develop applications rapidly for use on any mobile with a web connection with/without java installed

      I'd suggest dropping the "with/without java installed" requirement - it's an unnecessary handicap, because about 80% of mobile phones support Java ME and the ones that don't are almost all "voice and text only" devices that don't have internet access anyway. The only other solution that will get you reasonable compatibility is to view the charts with the inbuilt web browser.
  • The people on http://doom3.zoy.org/ [zoy.org] are obsessed with books. ^_^

Whoever dies with the most toys wins.

Working...