Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

api for knowing api j2me device supports

 
Avinash Mangipudi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks that solves my problem...rgds.
 
Robert Virkus
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic