Diogo Cardoso
Diogo Cardoso

Reputation: 22257

Detect if mobile device supports J2ME WMA

Is it possible to detect if the mobile device supports J2ME WMA?

Upvotes: 0

Views: 286

Answers (2)

funkybro
funkybro

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

bharath
bharath

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

Related Questions