开发者

Detect if mobile device supports J2ME WMA

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜