I have problem with sending message more 70 characters. On emulator sent is ok, on real phone do not get messages.
example sending message:
public void sendSMS(String phoneNumber, String message)
{
Log.i(TAG,"sendSMS");
SmsManager sms = SmsManager.getDefault()开发者_StackOverflow中文版;
sms.sendTextMessage(phoneNumber, null, message, null, null);
}
what may be problem?
Sorry for my english ;)
maybe you should try this:
public void sendSMS(String phoneNumber, String message)
{
Log.i(TAG,"sendSMS");
SmsManager sms = SmsManager.getDefault();
ArrayList<String> messageParts = sms.divideMessage(message);
for(String part : messageParts)
{
sms.sendTextMessage(phoneNumber, null, part, null, null);
}
}
Hope, it's help.
Edit 1: look at this answer
Edit 2: Do you try use method sendMultipartTextMessage
?
精彩评论