Question

I am sending a text (Encrypted text) from one android device to another but while receiving I am getting only part of text.

1.

Text I am sending: O34S/6hQqmbsYeWPVqZK/g==]wwOyeaKvTvV5ytoxGri1kj96jDIukzu45je+U822TM=

Text I am receiving: O34S/6hQqmbsYeWPVqZK/g==] e e =

2.

Text I am sending: B+zbCj1D2DcMO1/j9131TA==]zh5sYADg0v8liAZJjEefik52czrwpNlhZ5VgAMU=

Text I am receiving: B+zbCj1D2DcMO1/j9131TA==] / %

It seems that after "]" the text is trimmed.

Code I am using to send the text

String phoneNo = txtPhoneNo.getText().toString();
            final String sendtext = text_to_send;
            String message = sendtext;                 
            if (phoneNo.length()>0 && message.length()>0)                
                sendSMS(phoneNo, message);  
private void sendSMS(String phoneNumber, String message)
{        
    PendingIntent pi = PendingIntent.getActivity(this, 0,
        new Intent(this, CorporateActivity.class), 0);                
    @SuppressWarnings("deprecation")
    SmsManager sms = SmsManager.getDefault();
    sms.sendTextMessage(phoneNumber, null, message, pi, null);        
}
Was it helpful?

Solution

I found this solution there:

It may be useful to look at how gTalkSMS handles incoming SMS'es, as it appears to handle multipart messages correctly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top