0

i have read through all the documentation and the questions posted previously, but i couldn't find myself an answer. by writing the below code, i would like to send an sms whenever i am within the proximity.

Firstly, i would like to check that if the intent only creates the sms and not send it? if it doesn't, is there a way which i can send sms for the proximity alert. secondly, the proximityalert did not fire up due to some reasons, is there something wrong with the code ?

thanks.

Intent smsintent = new Intent(android.content.Intent.ACTION_VIEW);

smsintent.putExtra("address", "96424127"); 
smsintent.putExtra("sms_body", "child alert");
smsintent.setType("vnd.android-dir/mms-sms"); 

PendingIntent pendintent = PendingIntent.getService(this, 0, smsintent, 0);
lm.addProximityAlert(103.8497215, 1.3630663, 1000, 100000000, pendintent);`

Dai
  • 141,631
  • 28
  • 261
  • 374
  • Have a look on this issue http://stackoverflow.com/questions/2372248/launch-sms-application-with-an-intent http://stackoverflow.com/questions/5013651/android-send-sms-intent-help http://stackoverflow.com/questions/4967448/send-sms-in-android if you still have issue than go for this two tutorials http://android-er.blogspot.in/2011/03/send-sms-using-intentactionsendto.html http://www.mkyong.com/android/how-to-send-sms-message-in-android/ I hope by one of this link you will get solution – Aamirkhan Jul 16 '12 at 04:38

1 Answers1

0

try this smsintent.setData(Uri.parse("sms:"));

  • still it only activate the sms application, create the sms but it does not send it automatically. is there a way to send it automatically after the creation of the sms – 齐裕雄 Jul 16 '12 at 10:08