I am trying to send sms from my android app using intent, i have checked out other links too to get the delivery report, but all of them are using SMS-Manager, but here I'm using intent and i am calling the device default sms app.
the code is like this:
Intent inten = new Intent(Intent.ACTION_SEND);
inten.setType("text/*"); //for text
inten.putExtra("sms_body", body);
inten.putExtra("sms_body", body);
But if suppose the user doesn't have the sms balance, or the minimum balance required to send the sms, then obviously the sms won't be send, then how to
1> get the notification,
2> notify the user that his sms is not sent, and
3> the reason because of which it is not sent. (may be insufficient balance, or incorrect phone number, or any other possibilities)
basically i need to get the delivery report, is it possible to get that
and if I am sending the sms to multiple person then out of that list who got that sms, and who didn't
Thanks
Related
I'm creating an app that will use email message body to send SMS to a number. Anytime new mails are sent, the app gets the message and sends to a number.
Gmail api provides a way to fetch inbox messages passing the message id as a parameter
But is there a way to listen to a new mail? So that my function runs anytime a new mail is received.
In my Xamarin.Android app I send SMS using the following code :
send.Click += (s, e) =>
{
SmsManager.Default.SendTextMessage(number.Text, null, message.Text, null, null);
}
And in another button, I want to check which messages are delivered and which are not, to send undelivered message again.
How can I :
Find messages? Is there an ID (a unique one for each sms) or I should find messages by Number and Text?
Check the status of each message?
Please try the parameters sentIntent and deliveryIntent. Both are PendingIntents that will be broadcasted upon successful sending and delivery to the recipient. Upon building your intent you can add some id from your app that helps you identify which sms was sent/not sent.
To see how to query the SMSProvider, take a look at
this StackOverflow anwer.
The answer above uses Telephony.Sms.Inbox. I suggest trying to access Telephony.Sms.Conversations, which according to the doc contains all sent text-based SMS messages. As the class extends android.provider.Telephony.TextBasedSmsColumns, you should be able to query several error codes and status.
Hi I using Commercial SDK and I have problem with send sms. When i tried to send by email it works, but when I try to send via sms i get following events: TICKET_CREATED,TICKET_TRACK_CHANGED, TICKET_INVITE_FAILED (handled by listener). My code:
Calling createGlympse method:
Wrapper().createGlympse(3600000, "xxx-xxx-xxx", "Going home!");
"xxx-xxx-xxx" - phone number
In my wrapper:
createGlympse(..){
..
GInvite recipient = GlympseFactory.createInvite(GC.INVITE_TYPE_SMS,null, address);
..
}
What I do worng or what is phone number patter? I tried on device which avaible send sms manualy and via glympse server.
Maybe is the sandbox restriction?
I'm just wondering is it possible to send a Message from the app without using actionView or actionSend ( meaning no asking for chooser to send via google or hotmail etc.. ) from the Intent ?
what I want to make is like a TextView and a Button
the user will enter a text in the textview and then click the Button to send the message, then the message will be automiatlly sent to the developer ( me )
I hope what I'm thinking of is possible.
I'm not sure what kind of message you are trying to send, but you can use the SMS feature of the phone to send not only a SMS, but an email, too.
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage("1"+yourPhoneNumber, userPhoneNumber, message, null, null);
You can replace phone numbers with emails and it will work without user interaction (unlike sending an email through an email client which cannot be done automatically). You can try it out by texting your own email. For your specific situation, you could set up a developer email that handles all of these messages that you are trying to send. The only issue with this is that you may not know who you are receiving messages from. For example, if you send a SMS -> email, it might show up as from something#vz.com or something. However, you can mitigate this by including addition info in the message payload itself.
Yes, it is possible. You can use the internet connection to have the message saved to some cloud storage or something. Personally, I prefer using Parse.com because they have an amazing API that saves you a lot of hassle.
Just add the message from the EditText to a ParseObject and call the saveEventually() method. As soon as the internet is back on, the message will be sent to your cloud storage.
I have a few questions on Android SMSManager.
How do I send long SMS, say more than 160 characters. My application send SMS
as an email when there if no wifi/data connection. The SMS as email
is retrieved by the server and the server sent a msg: "Your email has been
recieved". How do I show this message on the alert dialog box.
How do I retrieve long SMS?
Four of my activity is supposed to send sms, so do i need to have multiple BroadcastReciecver for each activity or can i simple handle with one BroadcastReciever? Can i have a snippet code on such?
Currently i part of code handles as all above. But i know my codes are in-efficeint. Thats one reason i have such question.
Please bear my question.