I'm trying to retrieve SMS messages from device:
Cursor cursor = mContext.getContentResolver().query(Uri.parse("content://sms/inbox"), null, null, null, null);
while (cursor.moveToNext()) {
SmsMessage smsMessage = new SmsMessage(cursor);
smsMessages.add(smsMessage);
}
//.....
public SmsMessage(Cursor cursor) {
mSender = cursor.getString(cursor.getColumnIndex("address"));
mText = cursor.getString(cursor.getColumnIndex("body"));
mTimestamp = cursor.getLong(cursor.getColumnIndex("date"));
}
SMS messages are in Russian, but SMS are not UTF-8 encoded. There is no encoding settings on Samsung devices, but, for example, on Motorola Moto G it's set to "auto". So, how should I determine the encoding programmatically and encode the SMS body in UTF-8?
The problem was on server-side, not on Android.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With