public static boolean canSendSms(Context context){
  Uri smsUri=Uri.parse("smsto:12345");
  Intent smsIntent=new Intent(Intent.ACTION_SENDTO,smsUri);
  PackageManager smspackageManager=context.getPackageManager();
  List<ResolveInfo> smsresolveInfos=smspackageManager.queryIntentActivities(smsIntent,0);
  return smsresolveInfos.size() > 0;
}

public static boolean canSendSms ( Context context ) { Uri smsUri = Uri . parse ( "smsto:12345" ) ; Intent smsIntent = new Intent ( Intent . ACTION_SENDTO , smsUri ) ; PackageManager smspackageManager = context . getPackageManager ( ) ; List < ResolveInfo > smsresolveInfos = smspackageManager . queryIntentActivities ( smsIntent , 0 ) ; return smsresolveInfos . size ( ) > 0 ; }
checks if the device can send sms messages .
