I have some code to send SMS from my application but this code only send 160 characters and cannot send more than 160. This is my code :
protected void sendMessage(String message){
String phoneNumber = "xxxx";
try {
if(message.length() < 161){
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(phoneNumber, null, message, null, null);
Toast.makeText(getApplicationContext(), "SMS Send !", Toast.LENGTH_LONG).show();
}else{
Toast.makeText(getApplicationContext(), "Character too long !", Toast.LENGTH_LONG).show();
}
}catch (Exception e){
Toast.makeText(getApplicationContext(), "SMS Failed !", Toast.LENGTH_LONG).show();
e.printStackTrace();
}
}
How to send SMS with more than 160 characters ?