smsmanager

this requires android.permission.INTERACT_ACROSS_USERS_FULL

无人久伴 提交于 2019-12-12 03:36:28
问题 This problem related to this question send and receive sms to verify mobile number I have unlocked samsung at&t device. I am trying to send message by code. But my code is not working so i connected my device with USB and track whats the problem is. I found that i am getting this exception 981/? E/DatabaseUtils﹕ Writing exception to parcel java.lang.SecurityException: Permission Denial: get/set setting for user asks to run as user -2 but is calling from user 0; this requires android

Sending sms error Generic failure again and agian

只愿长相守 提交于 2019-12-11 14:53:47
问题 Here is my code.. private void sendSMS(String phoneNumber, String message) { String SENT = "SMS_SENT"; String DELIVERED = "SMS_DELIVERED"; PendingIntent sentPI = PendingIntent.getBroadcast(this, 0, new Intent( SENT), 0); PendingIntent deliveredPI = PendingIntent.getBroadcast(this, 0, new Intent(DELIVERED), 0); // ---when the SMS has been sent--- registerReceiver(new BroadcastReceiver() { @Override public void onReceive(Context arg0, Intent arg1) { switch (getResultCode()) { case Activity

SmsManager not working in Android 4.4.x

牧云@^-^@ 提交于 2019-12-10 23:16:49
问题 I am developing an Android app, which needs to send a message to multiple recipients. I used this code to send an SMS to a phone: SmsManager smsManager = SmsManager.getDefault(); smsManager.sendTextMessage("9030500259", null, "sms message", null, null); I have read many questions in this site which said the above is correct. On Googling I found this: http://android-developers.blogspot.in/2013/10/getting-your-sms-apps-ready-for-kitkat.html According to the article in the above link, some

SMSManager returns RESULT_ERROR_GENERIC_FAILURE despite trying everything

情到浓时终转凉″ 提交于 2019-12-10 11:26:30
问题 I am trying to create a feature in my app which can send SMS to multiple contacts in background. I am using SMS Manager API to do the same. However, everytime RESULT_ERROR_GENERIC_FAILURE returns. I read lot of similar posts on stack overflow and tried all the solutions but none of them seems to work for me. To be specific, I have tried following: Change phone number format to "+91xxxxxxxxxx", "9xxxxxxxxx", "91xxxxxxxxxx" Checked the SIM balance SMS Service centre number is also valid SMS

How to send Google Maps location by SMS

…衆ロ難τιáo~ 提交于 2019-12-08 18:54:30
how do I assign a variable LocationManager in the text string of SMSManager ? I want to send the sms with coordinates as text message. private LocationManager lm; private LocationListener locationListener; lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE); locationListener = new MyLocationListener(); lm.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, 0, locationListener); lm.requestLocationUpdates( LocationManager.NETWORK_PROVIDER, 0, 0, locationListener); btnSendSMS = (Button) findViewById(R.id.btnSendSMS); btnSendSMS.setOnClickListener(new View.OnClickListener() {

Send SMS in android programmatically

跟風遠走 提交于 2019-12-08 09:50:45
问题 I am using below code for sending sms in background for multiple peoples(Contacts) at a time. It is working for smaller text but however it not working for text which has more than 160 characters. I am getting GENERIC FAILURE. public class SendSMS { private int mMessageSentParts; private int mMessageSentTotalParts; private int mMessageSentCount; private String message; private String[] array; private Context mContext; public SendSMS(Context context,String array[]) { // TODO Auto-generated

Write received message to SMS provider ( API level 19+ )

孤街浪徒 提交于 2019-12-08 06:42:29
I am creating an SMS manager for KitKat and later version. I have implemented all the receivers as directed in the official doc by android . I have to receive the SMS SMS_DELIVER broadcast receiver and read it and then have to write to the SMS provider. till now I am able to read the SMS received. I have set my app as the default SMS app in the device. I am also parsing the SMS and can see it in the log. problem I am unable to write the SMS to the SMS provider. here is the broadcast receiver: public class SmsReceiver extends BroadcastReceiver { @Override public void onReceive(Context context,

Write received message to SMS provider ( API level 19+ )

喜欢而已 提交于 2019-12-08 03:15:36
问题 I am creating an SMS manager for KitKat and later version. I have implemented all the receivers as directed in the official doc by android. I have to receive the SMS SMS_DELIVER broadcast receiver and read it and then have to write to the SMS provider. till now I am able to read the SMS received. I have set my app as the default SMS app in the device. I am also parsing the SMS and can see it in the log. problem I am unable to write the SMS to the SMS provider. here is the broadcast receiver:

Pending Intents for sending SMS not working well while sending many messages

丶灬走出姿态 提交于 2019-12-07 07:25:18
问题 I am Developing an App , In which I send SMS and I need to find if It's delivered or not. Every thing seems to be well if I send A message to a person. But In some situations I got wrong Information , for example , First I send A message to number 0000 (But It will not deliver) and after it I send a message to number 0001 and It delivers (message to 0000 is still not delivered) but I got a toast with : sms delivered to 0000(But only message to 0001 is delivered) , What Should I do to fix this

Android Receive SMS Intent: Get Message Id or Thread Id

喜夏-厌秋 提交于 2019-12-06 01:57:21
问题 I have register a Broadcast listener to receive the android.provider.Telephony.SMS_DELIVER Intent action. I seem to be able to get the body, and sender phone number of this new message. However I am not able to get the Message Id or Thread Id of this new message. The only way I have found is to search the message and conversation tables for matching content. But this seems a little messy and I feel like there should be a neater way. Side note: Is there some SMS documentation that I have