Unable to send SMS message in Hindi - android

I am facing a strange issue with SMSManager in Android. I am sending SMS messages in two languages, Hindi and English. Message sending works fine for English messages but messages don't get delivered in case of Hindi text. I don't even receive any broadcast of failure or success for Hindi messages.
Here is my code for sending messages.
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(destinationAddress, null, message, null, null);
PS.
I have prepared a sample app that sends messages. It works fine when messages are typed in EditText in Hindi language but unable to send messages when Hindi string is hardcoded.
i.e.
String hindiMessage = editText.getText.toString()// works fine
String hindiMessage = "हिन्दी संदेश"//fails
I am looking for any possible solution or workaround.

This has got resolved by sending message as a multipart message. SMS were working in english language because the length of the messages that i was sending were less than maximum length of one message. But after converting it to hindi its length increases and exceeds the maximum limit of one message.
So sending messages as multipart message worked for me. here is the code for the same:
SmsManager smsManager = SmsManager.getDefault();
ArrayList<String> parts = smsManager.divideMessage(message);
smsManager.sendMultipartTextMessage(destinationAddress, null, parts, null, null);
Thanks
N_JOY.

Related

Android SmsManager Why I get the Sms From destination number

I used the SmsManager to send Sms to destination phone. The problem is that somehow two Sms sent: One Sms to the destination phone, which is fine, but also I get the exact Sms from the destination number in my phone.
The code:
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(destPhoneNumber, null, "Message", null, null);
How is it possible my phone get the message I send to destination number from the destination number itself?

Blocking outgoing SMS in Android. (except for default SMS app.)

How can we generate the pop up if any app sending SMS?
I mean is there any way to block outgoing SMS through any app except default SMS app?
Any application can send SMS through android Phone with help of SMSManager. for example.
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(number, null, "message", null, null);
I want to block such SMS sending process or generate a pop-up on phone that "xyz app is trying to send SMS .. Allow or dont allow..
Any help will be appreciable...

SmsManager not working in Android 4.4.x

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 changes happened in messaging.
I am unable to send SMS in my application.
What is the correct code to send an SMS in Android version 4.4.x?
i was facing same problem .but finally got solution . if u are testing this code in dual sim phone then sim slot 1 always keep active otherwise it " no service" error inn pendingsentintent.

Sms received not the same sent

I am trying to develop an app that send and receive a sms
my sms's are too long so i used a multi partsend sms method
the sms is sent successfully bu when receiving the message the character are wrongly printed in screen
please help me
i tested it in a virtual device
SmsManager sms = SmsManager.getDefault();
ArrayList<String> parts = sms.divideMessage(keyAsString);
sms.sendMultipartTextMessage(getPhoneNo().getText().toString(), null, parts, null, null);
Have you checked the phone sending and the phone receiving are using the same character sets?
I'm not entirely sure how to check because I don't know what phone you're using but if the characters look something like this phenomenon then that might be your problem: http://en.wikipedia.org/wiki/Mojibake

How to send flash messages using android

I am sending SMS by using
Code:
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage(phoneNumber, null, message, sentPI, deliveredPI);
It's working fine and successfully sends a standard SMS that is automatically saved in recipient mobile inbox.
I want send the SMS as flash(notification) SMS. By this I mean that the message should be displayed immediately on recipient mobile screen but not stored.
Please tell me how can I do this.
For sending Flash SMS the Modem used should be compatible to send Flash Messages.
try sending AT+CMGF? command.This will read the value stored by modem for command CMGF Message Format
if AT+CMGF? returns 0 i.e it is in PDU mode (where entire TP data units are used)
then it is compatible
else if it returns 1 then it is in text mode (where the body of
the message and its headers are given as separate parameters)

Categories

Resources