Created
January 18, 2014 14:26
-
-
Save jasonrogena/8491303 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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