1

I would like to know how to detect what coding has been used for SENT SMS (in case I read it from "content://sms/sent"). I check all columns and I didn´t find any information about it there. Reason why I am looking for this is to know, how many messages has been sent. I believe when it is sent as: 160 GSM characters = 1 SMS ; 70 Unicode characters = 1 SMS

Columns: _id thread_id address person date date_sent protocol read status type reply_path_present subject body service_center locked error_code seen deletable hidden group_id group_type delivery_date app_id msg_id callback_number reserved pri teleservice_id link_url

Thank you for any help in advance.

Michal
  • 2,071
  • 19
  • 30
  • I haven't tried it yet, but I assume you must check BOM marker in a text if you want to relate to its encoding. Try to read this answer: http://stackoverflow.com/questions/4520184/how-to-detect-the-character-encoding-of-a-text-file – Cob013 Jun 20 '13 at 20:18
  • Thank you Rob013. It seems that this solved my problem. – Michal Jun 21 '13 at 18:26
  • Good to know Michal :) I have posted my comment as answer so that you can accept and close your question :) – Cob013 Jun 21 '13 at 20:30

2 Answers2

0

I haven't tried it yet, but I assume you must check BOM marker in a text if you want to relate to its encoding. Try to read this answer: this

Community
  • 1
  • 1
Cob013
  • 1,057
  • 9
  • 22
0

the SmsMessage.calculateLength method does that pretty well !

  1. read the message's body string from the sms content provider
  2. throw that to calculateLength(body, true)

  3. read the results :

Cheers !

baramuse
  • 360
  • 2
  • 10