Send an SMS to one of the contacts

Asked

Viewed 421 times

4

I have an app and at the end I wanted to send a msg to one of the user contacts about my application.

var columnNumber = cursor.GetColumnIndex(ContactsContract.CommonDataKinds.Phone.Number);
            contacto_numero = cursor.GetString(columnNumber);         
            SmsManager.Default.SendTextMessage(contacto_numero, null,msg_texto, null, null);

This is my code, and I don’t understand why not msg none, I think I have everything in order.

My msg is like this and does not have more than 160 characters..

msg_texto= "O seu amigo " + user_nome + " recomendoou a vir fazer o nosso questionario, venha experirmentar a nossa aplicação. Procure-nos na Playstore";

I’m most grateful to anyone who can help

  • remembers that if you use Unicode ç and/or ã, will be much heavier. For example, sending O seu amigo recomendoou a vir fazer o nosso questionario, venha experirmentar a nossa aplicação. Procure-nos na Playstore use 121 characters in two messages, while O seu amigo recomendoou a vir fazer o nosso questionario, venha experirmentar a nossa aplicacao. Procure-nos na Playstore (without) uses 120 in just one message. Why? Because of encoding of the message needed to use these characters.

  • You can see what I’m talking about using this site here, and typing your message, seeing the difference between using çã and ca

1 answer

-2

This will depend on the provider used for SMS. I suggest you use one of the following services: Twilio, Infobip, MARKTEL, Zenvia and Locasms. These services are paid for and have a very simple API to implement.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.