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

Finding out the Supported JSR's on the device

 
Punit Raizada
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I was wondering if there was a method within the J2ME api that could give me a list of JSR's that the phone supports.

For instance I use System.getProperty() method to find out the version of the API I need but is there any method that would return the complete list of API's..

Thanks in advance
 
Nidheesh Puthalath
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Punit Raizada,

I was not aware of any API which will give u the complete list of JSR's or API's the phone supports.
But, the method i used in my projects for getting the availability of JSR is,

try {
Class.forName("javax.microedition.pim.PIM");
System.out.println("PIM-API: yes");
} catch (ClassNotFoundException e) {
System.out.println("PIM-API: no");
}
hope this would help u.

If someone else know better ways plz let us know.

Thanks & Regards,
Nidheesh.P
 
Punit Raizada
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the response Nidheesh.

I have been using the same approach.

I guess then to detect the presence of a JSR ..

1) Use a unique class of the JSR in question with the Class.ForName method. If this does not through an exception then the JSR is present.

2) To get the version of the JSR implementation, use the System.getProperty() method.

If someone has a better approach ... please post it on this thread.

Regards,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic