开发者

sending message more 70 characters

开发者 https://www.devze.com 2023-03-02 18:52 出处:网络
I have problem with sending message more 70 characters. On emulator sent is ok, on real phone do not get messages.

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

精彩评论

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