Determines if user device has capability of SMS. - Android Phone

Android examples for Phone:SMS

Description

Determines if user device has capability of SMS.

Demo Code


import android.content.Context;

public class Main{
    private static PhoneNumberUtils phoneNumberUtils;
    /**/*from  w  ww . j  a v  a2  s  . com*/
     * Determines if user device has capability of SMS.<p>
     * 
     * Requires READ_PHONE_STATE Permission must be set to use this function
     * @param context
     *            Context to derive device information
     * @return true if user device has SMS capability; false otherwise
     */
    public static boolean hasSmsCapability(Context context) {
        return phoneNumberUtils.isAbleToReceiveSms(context);
    }
}

Related Tutorials