开发者

sending message more 70 characters

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜