Dealing with optional APIs in J2ME

On top of MIDP, there are optional packages that a phone may or may not support. Say, the MMAPI may not be supported by many phones.

I am trying to write an application which, after installation, either plays a video, or informs the user that "This application cannot play video on this phone".

Certainly System.getProperty("javax.microedition.media") may help, but what I am afraid of is that if an application has been compiled using "import javax.microedition.media", it may not even install on a device which doesnt support MMAPI, and all my user will get is an "Installation failed" message.

What is a solution to this. I dont want to have multiple versions of my midlet (ie, with and without MMAPI part of the code)

[747 byte] By [anand_amarsha] at [2007-11-26 13:27:48]
# 1

I believe you can use the fully qualified package location to get around this. Instead of importing, refer to the class directly when you need it. (Can you make a reference to it then?)

I did some research to kinda make sure: http://discussion.forum.nokia.com/forum/archive/index.php/t-36314.html

ccsgraphica at 2007-7-7 20:29:36 > top of Java-index,Java Mobility Forums,Java ME Technologies...