J2ME JNI and Media Playing

13/07/06 Permalink

I was looking at a way to call native methods from a MIDP application and came across http://www.midpjni.com/. What it's saying is that you can in theory call native events from Java over TCP/IP. It looks at a custom client /server approach. It would mean installing both a Symbian .sis and Java .jar though unless there's some clever workaround.

Core J2ME api classes do use native method calls - the Player used with createPlayer eventually dumps a byte[] in a native method call which I would guess would be a native media player. The Symbian media player streams nicely without lag between player buffers in C++ but cannot be used efficiently in J2ME - streaming in J2ME always results in a slight time delay when changing buffers. It's a real pain for Java developers and there a countless forum posts about J2ME streaming or lack of.

Update 23 July - I've just noticed this on the SE dev site

Play media files instantly using progressive download on the W600

The implementation of the FileConnection API on the Sony Ericsson W600 mobile phone uses progressive download to give instant access to media files to the MMAPI.

Progressive download is a technique used to play media while the media is still being downloaded to the player (you may have noticed this when looking at video clips on the internet). The video is being played while the player is still downloading and buffering the content. Before the implementation of the progressive download, the entire media file was loaded into the memory before it was played, resulting in long waiting times from the media being loaded to it actually was played (more obvious when the media file was large).

The benefit of this is obvious when playing large media files and especially when using play list functionality.

To use progressive download you need to create a player using the file scheme like this: Manager.createPlayer("file:///c:/");

Share It: Digg | del.icio.us | Furl | reddit | Facebook | Yahoo! | Send to Phone

mobile-utopia.com | Feedback