Search code examples
javaandroidmedia-player

Why I can't use JMF on Android?


I don't really have or want to use the Java Media Framework (JMF) on Android but I am looking for detailed information about why it's not possible to use it. (I know that it's considered as outdated anyway and I am aware that there may be better ways to achieve certain things in Android using this for example: http://developer.android.com/guide/topics/media/index.html)

Nevertheless I need more information regarding JMF on Android but all I could find is, that "JMF isn't working on Android" - but I wonder why.

So I have two questions:

  • Do you know any kind of "official" statement, for example from Google or Oracle, saying that JMF isn't supported on Android? I wasn't able to find something like that.
  • Why is JMF supposed to be not working on Android? I am interested in the technical details and would be grateful for all kind of references.

Thank you!

EDIT:
To be a bit more specific and clarify my approach: I built a tiny test-app and tried to play an audiofile the same way as I have done in a standard java desktop application (which was working as expected). I included the JMF.jar (for now without any modification) compiled, deployed and started the app - no problems so far. The (first) exception (javax.media.NoPlayerException) is thrown when calling Manager.createPlayer(). That was actually the point where I stopped and wondered if it's worth digging deeper, although the result is kind of predictable. I decided to ask about the technical background first, instead of figuring it out the hard way in hours of testing and debugging (the reason is not a lack of interest but unfortunately a matter of time at the moment).


Solution

  • I am looking for detailed information about why it's not possible to use it

    Because it was not included in the Android SDK. Lots of things from Java SE were not included in Android.

    Do you know any kind of "official" statement, for example from Google or Oracle, saying that JMF isn't supported on Android?

    I am not aware of such a statement. They also have not released a statement indicating why Android does not integrate with the Hubble Space Telescope, why it does not include shoe-shining APIs, etc. There are an infinite number of things that are not in Android; it would be impossible to list them all.

    More generally, Google faces pressure to keep a lid on firmware size, as the bigger the firmware, the more expensive things get (required storage, OTA update costs, etc.). Hence, they only include a subset of the Java SE SDK as one way of helping reduce firmware bloat.

    Why is JMF supposed to be not working on Android?

    Because it was not included in the Android SDK. I have no idea if it is possible, let alone practical, to create a fork of JMF that offers a JMF-like API but uses Android media capabilities under the covers.