0

I am using the following code to send sms from my application. It works ok on my Galaxy pop device. But getting Readexception in Premium Galaxy devices. Please let me know what could be the problem.

SmsManager smgr = SmsManager.getDefault();


        String msisdn = "8277335968"; //test
         Intent intent = new Intent("SMS_SENT");
         PendingIntent sentIntent = PendingIntent.getBroadcast(this, 0,
              intent, PendingIntent.FLAG_ONE_SHOT);

    PendingIntent deliveryIntent = null;
    String scAddress = null;
    String message = "12345678+23823#21328&121";

    smgr.sendTextMessage(msisdn, scAddress, message, sentIntent, deliveryIntent);
Pravitha V
  • 3,308
  • 4
  • 33
  • 51
user1123931
  • 479
  • 1
  • 8
  • 24

2 Answers2

0

android.telephony.gsm.SmsManager is now deprecated.

make sure you are using android.telephony.SmsManager

Vinay W
  • 9,912
  • 8
  • 41
  • 47
0

please include the following permissions to manifest file before application tag

<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.READ_SMS" />
Fazal
  • 3,374
  • 1
  • 15
  • 20