Skip to content

Instantly share code, notes, and snippets.

@jasonrogena
Created January 18, 2014 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonrogena/8491303 to your computer and use it in GitHub Desktop.
Save jasonrogena/8491303 to your computer and use it in GitHub Desktop.
smsManager.sendMultipartTextMessage(SMS_SERVER_ADDRESS, null, multipartMessage, sentPendingIntents, deliveredPendingIntents);
long startTime = System.currentTimeMillis();
if(waitForResponse){
while(true){
long currTime = System.currentTimeMillis();
long timeDiff = currTime - startTime;
if(getSharedPreference(context, SP_KEY_SMS_RESPONSE,"").length()>0){
return getSharedPreference(context, SP_KEY_SMS_RESPONSE,"");
}
else if(timeDiff>SMS_RESPONSE_TIMEOUT){
Log.w(TAG, "SMS response timeout exceeded");
return null;
}
}
}
else{
return ACKNOWLEDGE_OK;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment