aspose file tools*
The moose likes Java Micro Edition and the fly likes J2ME need to find out if a package exists Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "J2ME need to find out if a package exists" Watch "J2ME need to find out if a package exists" New topic
Author

J2ME need to find out if a package exists

Ilnur Galimzyanov
Greenhorn

Joined: Oct 17, 2006
Posts: 2
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

Joined: Feb 05, 2001
Posts: 17259
    
    6

"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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Ilnur Galimzyanov
Greenhorn

Joined: Oct 17, 2006
Posts: 2
Does anybody know?
Eduardo Marques
Ranch Hand

Joined: Feb 19, 2005
Posts: 231
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 ]

Eduardo Marques
Get ready for your SCMAD certification at J2MECertificate.com - See what all the buzz is about ...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: J2ME need to find out if a package exists