Android : UTF 8 encoding in Android SMS app

on Saturday, April 18, 2015


I am working on writing creating a new app which will send messages to any mobile devide native SMS app.


while sending messages , instead of ASCII , i am using some UTF-8 encoding characters which are being replaced in between few ASCII characters of a string.


I am facing an exception while sending the message after giving the recipients number.enter code here the above utility method will look up for corresponding UTF code, when i send on button click ,


following exception comes :



java.lang.NullPointerException
android.telephony.SmsMessage$SubmitPdu.<init>(SmsMessage.java:168)
android.telephony.SmsMessage.getSubmitPdu(SmsMessage.java:1114)
android.telephony.SmsManager.sendTextMessage(SmsManager.java:248)
android.telephony.SmsManager.sendTextMessage(SmsManager.java:122)
com.mastpro.dpsu.stegosms.SendCipherMsgActivity.onSendClick(SendCipherMsgActivity.java:60)

0 comments:

Post a Comment