• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

J2ME need to find out if a package exists

 
Ilnur Galimzyanov
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello! I'm newbie to Java, I need to find out if a mobile phone is able to send SMS.. I think the most logical way is to check the version of WMA package on the device. So how can I do it?
Or may be you know other ways to learn this?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Naugrom"

Please click on the My Profile link above and change your display name to meet the JavaRanch Naming Policy of using your real first and real last names.

Thanks

Mark
 
Ilnur Galimzyanov
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anybody know?
 
Eduardo Marques
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, you should have some trouble if your MIDlet if it runs on a non-WMA device and your code references WMA classes (because the device does not have support for it).


I think class verification will fail on MIDlet startup if you do it.
You must patch the MIDlet build not to include WMA related code
when the target device does not support WMA.

Anyway a simple way to check if SMS is supported is trying to open a SMS connection with Connector.open(). If ConnectionNotFoundException is thrown you know SMS is not supported.
[ October 19, 2006: Message edited by: Eduardo Marques ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic