Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Java Micro Edition and the fly likes api for knowing api j2me device supports Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Reply Bookmark "api for knowing api j2me device supports" Watch "api for knowing api j2me device supports" New topic
Author

api for knowing api j2me device supports

Avinash Mangipudi
Greenhorn

Joined: Jan 01, 2004
Posts: 26
Hi,
Is there any API querying which the midlet application can know whether or which version of cldc/midp/wma/mmapi.... the device supports?
thanks
James Reilly
wrangler
Ranch Hand

Joined: Oct 01, 2003
Posts: 30
Some of these might help, depending on what you are trying to accomplish:

- checking the values of system properties 'microedition.profiles', 'microedition.configuration', etc.

- Using a try / catch block for 'Class.forName(String className)' and ClassNotFoundException might help an application to infer that some API (e.g. from an optional package) is available or not. This might be helpful in some specific cases (e.g. sound effects). But it ought to be used judiciously, if at all.

- Some optional package APIs may also provide some additional support. For example, the JSR-82 Bluetooth API allows one to query a device property 'bluetooth.api.version', using the JSR-82 API specific class javax.bluetooth.LocalDevice.
[ July 13, 2004: Message edited by: James Reilly ]
Avinash Mangipudi
Greenhorn

Joined: Jan 01, 2004
Posts: 26
thanks that solves my problem...rgds.
Robert Virkus
Greenhorn

Joined: Jun 26, 2004
Posts: 16
This stuff is best done during the preprocessing phase, e.g.



Or:


The above examples assume that you are using J2ME Polish (http://www.j2mepolish.org), which has an integrated device database and powerful preprocessing capabilities.

Using this approach saves you a lot of runtime and jar size.

Best regards,
Robert


J2ME Polish<br />A suite of tools for J2ME developers.<br /><a href="http://www.j2mepolish.org" target="_blank" rel="nofollow">http://www.j2mepolish.org</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: api for knowing api j2me device supports
 
Similar Threads
File Connection API(Please reply me asap)
Can I use Flex in mobile apps?
j2me: upload an image file captured by cell camera
Capturing the remote desktop
Quick Sort in Java