开发者

Detect if mobile device supports J2ME WMA

开发者 https://www.devze.com 2023-03-24 10:48 出处:网络
Is it possible to detect if the mobile开发者_JAVA技巧 device supports J2ME WMA?Use this code, public static boolean isWMAPresent(){

Is it possible to detect if the mobile开发者_JAVA技巧 device supports J2ME WMA?


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.


@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;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消