in my app, I want to send a mass SMS to a bunch of numbers, and I want to know if there is a time threshold or a size limit to the list of recipients of an SMS.
all I saw in previous questions is code that no longer exists in the current builds of Android like references to SMSDispatcher and Settings constants that no longer exist in the current code.
after going through the Android sources for all the APIs supported by my app I cam up with the following code
private void setSmsDefaultLimitations(){
int apiLevel = Build.VERSION.SDK_INT;
String versionRelease = Build.VERSION.RELEASE;
switch(apiLevel){
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
sMaxAllowed = 100;
sCheckPeriod = 3600000;
break;
case 16:
sMaxAllowed = 30;
sCheckPeriod = 1800000;
break;
case 17:
sMaxAllowed = 30;
if(versionRelease.contains("4.2.2")){
sCheckPeriod = 60000;
}else {
sCheckPeriod = 1800000;
}
break;
case 18:
sMaxAllowed = 30;
sCheckPeriod = 60000;
break;
default:
sMaxAllowed = 30;
sCheckPeriod = 1800000;
break;
}
sMaxAllowed = sMaxAllowed - 2; //This is to give us a little buffer to be extra safe (like a condom ;)
Log.d(TAG, "maxAllowed = "+sMaxAllowed+"; checkPeriod = "+(sCheckPeriod/60000) + " minutes");
}