Reputation: 22257
Is it possible to detect if the mobile device supports J2ME WMA?
Upvotes: 0
Views: 286
Reputation: 8671
@Bharath's answer is a good one.
Alternative is to check for the existence of SMSC system property as follows:
public static boolean isWMAPresent() {
return System.getProperty("wireless.messaging.sms.smsc") != null;
}
You can also check to see if MMS is supported by checking for MMS property:
public static boolean isWMAPresent() {
return System.getProperty("wireless.messaging.mms.mmsc") != null;
}
Upvotes: 1
Reputation: 14453
Use this code,
public static boolean isWMAPresent(){
try {
Class.forName(
"javax.wireless.messaging.MessageConnection" );
return true;
}
catch( Exception e ){
return false;
}
}
For more info see this article, J2ME Optional Packages.
Upvotes: 1