How to restore a long SMS (Text) message from multiple short text messages stored in Android database?
up vote
0
down vote
favorite
I have a ContentObserver
listening content://sms/inbox
. When I send long SMS message from one Android emulator to another Android emulator, this ContentObserver
fires multiply (depending on the number of short sms messages in the long sms message). I need to concatenate short messages in one long message, but I have no a feature to decide were these messages sent as parts of one long message or they are independent succesive short messages. It seems available cursor
columns does not contain such a feature at all:
0 = "_id"
1 = "thread_id"
2 = "address"
3 = "person"
4 = "date"
5 = "date_sent"
6 = "protocol"
7 = "read"
8 = "status"
9 = "type"
10 = "reply_path_present"
11 = "subject"
12 = "body"
13 = "service_center"
14 = "locked"
15 = "sub_id"
16 = "error_code"
17 = "creator"
18 = "seen"
As I know there is a way to do desired concatenation thru receiver
and "pdus"
. Is it the only way to proceed?
P.S. I have found that real (not emulator) Android SMS client does not keep a long message as series of short messages. It concatenates short messages in storeMessage
method and saves them as a whole long message in database. So the question is why Android emulator SMS client is differ from the real one!?
UPDATE: SmsObserver
class:
public class SMSObserver1 extends ContentObserver
private Context context;
private SmsListener listener;
public SMSObserver(Context context, Handler handler, SmsListener listener)
super(handler);
this.context = context;
this.listener = listener;
@Override
public void onChange(boolean selfChange)
super.onChange(selfChange);
Uri mUri = Uri.parse("content://sms");
Cursor mCursor = context.getContentResolver().query(mUri, null, null, null, null);
if (mCursor != null && mCursor.moveToNext())
SmsEntity entity = null;
int type = mCursor.getInt(mCursor.getColumnIndex("type"));//now we need to decide SMS message is sent or received
if (type == 1) //it's received SMS
entity = getSMS(true);
else if (type == 2) //it's sent SMS
entity = getSMS(false);
mCursor.close();
if (entity != null)
listener.addSms(entity);
private SmsEntity getSMS(boolean isIncoming)
SmsEntity entity = null;
Uri uri = Uri.parse(isIncoming ? "content://sms/inbox" : "content://sms/sent");
Cursor cursor = context.getContentResolver().query(uri, null,null, null, null);
if (cursor != null && cursor.moveToNext())
entity = printSms(cursor, isIncoming);
cursor.close();
return entity;
private SmsEntity printSms(Cursor cursor, boolean isIncoming)
int type = cursor.getInt(cursor.getColumnIndex("type"));
long msg_id= cursor.getLong(cursor.getColumnIndex("_id"));
String phone = cursor.getString(cursor.getColumnIndex("address"));
long dateVal = cursor.getLong(cursor.getColumnIndex("date"));
String body = cursor.getString(cursor.getColumnIndex("body"));
Date date = new Date(dateVal);
String str = (isIncoming ? "Received" : "Sent") + " SMS: n phone is: " + phone;
str +="n SMS type is: " + type;
str +="n SMS time stamp is:" + date;
str +="n SMS body is: " + body;
str +="n id is : " + msg_id;
Log.v("Debug", str);
return new SmsEntity(msg_id, dateVal, true, isIncoming, phone, body);
Registering/unregistering happens in onResume
/onPause
callbacks of Fragment
:
@Override
public void onPause()
super.onPause();
unregisterContentObserver();
public void unregisterContentObserver()
if (mSmsObserver != null)
try
getActivity().getContentResolver().unregisterContentObserver(mSmsObserver);
catch (IllegalStateException ise)
Timber.w(ise.getMessage());
finally
mSmsObserver = null;
@Override
public void onResume()
super.onResume();
registerContentObserver();
private void registerContentObserver()
mSmsObserver = new SMSObserver(getActivity(), new Handler(),this);
getActivity().getContentResolver().registerContentObserver(Uri.parse("content://sms/inbox"), true, mSmsObserver);//To track an incoming SMS only
android sms smsmanager contentobserver pdu
|
show 10 more comments
up vote
0
down vote
favorite
I have a ContentObserver
listening content://sms/inbox
. When I send long SMS message from one Android emulator to another Android emulator, this ContentObserver
fires multiply (depending on the number of short sms messages in the long sms message). I need to concatenate short messages in one long message, but I have no a feature to decide were these messages sent as parts of one long message or they are independent succesive short messages. It seems available cursor
columns does not contain such a feature at all:
0 = "_id"
1 = "thread_id"
2 = "address"
3 = "person"
4 = "date"
5 = "date_sent"
6 = "protocol"
7 = "read"
8 = "status"
9 = "type"
10 = "reply_path_present"
11 = "subject"
12 = "body"
13 = "service_center"
14 = "locked"
15 = "sub_id"
16 = "error_code"
17 = "creator"
18 = "seen"
As I know there is a way to do desired concatenation thru receiver
and "pdus"
. Is it the only way to proceed?
P.S. I have found that real (not emulator) Android SMS client does not keep a long message as series of short messages. It concatenates short messages in storeMessage
method and saves them as a whole long message in database. So the question is why Android emulator SMS client is differ from the real one!?
UPDATE: SmsObserver
class:
public class SMSObserver1 extends ContentObserver
private Context context;
private SmsListener listener;
public SMSObserver(Context context, Handler handler, SmsListener listener)
super(handler);
this.context = context;
this.listener = listener;
@Override
public void onChange(boolean selfChange)
super.onChange(selfChange);
Uri mUri = Uri.parse("content://sms");
Cursor mCursor = context.getContentResolver().query(mUri, null, null, null, null);
if (mCursor != null && mCursor.moveToNext())
SmsEntity entity = null;
int type = mCursor.getInt(mCursor.getColumnIndex("type"));//now we need to decide SMS message is sent or received
if (type == 1) //it's received SMS
entity = getSMS(true);
else if (type == 2) //it's sent SMS
entity = getSMS(false);
mCursor.close();
if (entity != null)
listener.addSms(entity);
private SmsEntity getSMS(boolean isIncoming)
SmsEntity entity = null;
Uri uri = Uri.parse(isIncoming ? "content://sms/inbox" : "content://sms/sent");
Cursor cursor = context.getContentResolver().query(uri, null,null, null, null);
if (cursor != null && cursor.moveToNext())
entity = printSms(cursor, isIncoming);
cursor.close();
return entity;
private SmsEntity printSms(Cursor cursor, boolean isIncoming)
int type = cursor.getInt(cursor.getColumnIndex("type"));
long msg_id= cursor.getLong(cursor.getColumnIndex("_id"));
String phone = cursor.getString(cursor.getColumnIndex("address"));
long dateVal = cursor.getLong(cursor.getColumnIndex("date"));
String body = cursor.getString(cursor.getColumnIndex("body"));
Date date = new Date(dateVal);
String str = (isIncoming ? "Received" : "Sent") + " SMS: n phone is: " + phone;
str +="n SMS type is: " + type;
str +="n SMS time stamp is:" + date;
str +="n SMS body is: " + body;
str +="n id is : " + msg_id;
Log.v("Debug", str);
return new SmsEntity(msg_id, dateVal, true, isIncoming, phone, body);
Registering/unregistering happens in onResume
/onPause
callbacks of Fragment
:
@Override
public void onPause()
super.onPause();
unregisterContentObserver();
public void unregisterContentObserver()
if (mSmsObserver != null)
try
getActivity().getContentResolver().unregisterContentObserver(mSmsObserver);
catch (IllegalStateException ise)
Timber.w(ise.getMessage());
finally
mSmsObserver = null;
@Override
public void onResume()
super.onResume();
registerContentObserver();
private void registerContentObserver()
mSmsObserver = new SMSObserver(getActivity(), new Handler(),this);
getActivity().getContentResolver().registerContentObserver(Uri.parse("content://sms/inbox"), true, mSmsObserver);//To track an incoming SMS only
android sms smsmanager contentobserver pdu
Are you sure you're correctly interpreting what you're seeing? Incoming multipart SMS should always be stored in a single record. As you mention, there's really no other way to group or collect them after writing. Please post yourContentObserver
, and the code for its registration.
– Mike M.
Nov 14 at 16:38
Please post yourregisterContentObserver()
call.
– Mike M.
Nov 15 at 2:52
I have updateted my question. I would like to stress the problem exists on Android emulator SMS client only. I have posted correspondent issue to Google bug tracker issuetracker.google.com/issues/119319859
– isabsent
Nov 15 at 3:10
Yeah, I noticed you'd mentioned that. I'm trying to reconcile your description with what I believe should be happening. However, things have changed, apparently. That is, previously, registering oncontent://sms/inbox
didn't work at all. You'd have to register oncontent://sms
, and sort out what actually changed inonChange()
. Which API levels are you testing this on? Both emulator and devices.
– Mike M.
Nov 15 at 3:20
Also, as a debugging tip, assuming you're testing on API level 16 or above, overrideonChange(boolean selfChange, Uri uri)
, and see whaturi.toString()
is for each time it's firing unexpectedly.
– Mike M.
Nov 15 at 3:23
|
show 10 more comments
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a ContentObserver
listening content://sms/inbox
. When I send long SMS message from one Android emulator to another Android emulator, this ContentObserver
fires multiply (depending on the number of short sms messages in the long sms message). I need to concatenate short messages in one long message, but I have no a feature to decide were these messages sent as parts of one long message or they are independent succesive short messages. It seems available cursor
columns does not contain such a feature at all:
0 = "_id"
1 = "thread_id"
2 = "address"
3 = "person"
4 = "date"
5 = "date_sent"
6 = "protocol"
7 = "read"
8 = "status"
9 = "type"
10 = "reply_path_present"
11 = "subject"
12 = "body"
13 = "service_center"
14 = "locked"
15 = "sub_id"
16 = "error_code"
17 = "creator"
18 = "seen"
As I know there is a way to do desired concatenation thru receiver
and "pdus"
. Is it the only way to proceed?
P.S. I have found that real (not emulator) Android SMS client does not keep a long message as series of short messages. It concatenates short messages in storeMessage
method and saves them as a whole long message in database. So the question is why Android emulator SMS client is differ from the real one!?
UPDATE: SmsObserver
class:
public class SMSObserver1 extends ContentObserver
private Context context;
private SmsListener listener;
public SMSObserver(Context context, Handler handler, SmsListener listener)
super(handler);
this.context = context;
this.listener = listener;
@Override
public void onChange(boolean selfChange)
super.onChange(selfChange);
Uri mUri = Uri.parse("content://sms");
Cursor mCursor = context.getContentResolver().query(mUri, null, null, null, null);
if (mCursor != null && mCursor.moveToNext())
SmsEntity entity = null;
int type = mCursor.getInt(mCursor.getColumnIndex("type"));//now we need to decide SMS message is sent or received
if (type == 1) //it's received SMS
entity = getSMS(true);
else if (type == 2) //it's sent SMS
entity = getSMS(false);
mCursor.close();
if (entity != null)
listener.addSms(entity);
private SmsEntity getSMS(boolean isIncoming)
SmsEntity entity = null;
Uri uri = Uri.parse(isIncoming ? "content://sms/inbox" : "content://sms/sent");
Cursor cursor = context.getContentResolver().query(uri, null,null, null, null);
if (cursor != null && cursor.moveToNext())
entity = printSms(cursor, isIncoming);
cursor.close();
return entity;
private SmsEntity printSms(Cursor cursor, boolean isIncoming)
int type = cursor.getInt(cursor.getColumnIndex("type"));
long msg_id= cursor.getLong(cursor.getColumnIndex("_id"));
String phone = cursor.getString(cursor.getColumnIndex("address"));
long dateVal = cursor.getLong(cursor.getColumnIndex("date"));
String body = cursor.getString(cursor.getColumnIndex("body"));
Date date = new Date(dateVal);
String str = (isIncoming ? "Received" : "Sent") + " SMS: n phone is: " + phone;
str +="n SMS type is: " + type;
str +="n SMS time stamp is:" + date;
str +="n SMS body is: " + body;
str +="n id is : " + msg_id;
Log.v("Debug", str);
return new SmsEntity(msg_id, dateVal, true, isIncoming, phone, body);
Registering/unregistering happens in onResume
/onPause
callbacks of Fragment
:
@Override
public void onPause()
super.onPause();
unregisterContentObserver();
public void unregisterContentObserver()
if (mSmsObserver != null)
try
getActivity().getContentResolver().unregisterContentObserver(mSmsObserver);
catch (IllegalStateException ise)
Timber.w(ise.getMessage());
finally
mSmsObserver = null;
@Override
public void onResume()
super.onResume();
registerContentObserver();
private void registerContentObserver()
mSmsObserver = new SMSObserver(getActivity(), new Handler(),this);
getActivity().getContentResolver().registerContentObserver(Uri.parse("content://sms/inbox"), true, mSmsObserver);//To track an incoming SMS only
android sms smsmanager contentobserver pdu
I have a ContentObserver
listening content://sms/inbox
. When I send long SMS message from one Android emulator to another Android emulator, this ContentObserver
fires multiply (depending on the number of short sms messages in the long sms message). I need to concatenate short messages in one long message, but I have no a feature to decide were these messages sent as parts of one long message or they are independent succesive short messages. It seems available cursor
columns does not contain such a feature at all:
0 = "_id"
1 = "thread_id"
2 = "address"
3 = "person"
4 = "date"
5 = "date_sent"
6 = "protocol"
7 = "read"
8 = "status"
9 = "type"
10 = "reply_path_present"
11 = "subject"
12 = "body"
13 = "service_center"
14 = "locked"
15 = "sub_id"
16 = "error_code"
17 = "creator"
18 = "seen"
As I know there is a way to do desired concatenation thru receiver
and "pdus"
. Is it the only way to proceed?
P.S. I have found that real (not emulator) Android SMS client does not keep a long message as series of short messages. It concatenates short messages in storeMessage
method and saves them as a whole long message in database. So the question is why Android emulator SMS client is differ from the real one!?
UPDATE: SmsObserver
class:
public class SMSObserver1 extends ContentObserver
private Context context;
private SmsListener listener;
public SMSObserver(Context context, Handler handler, SmsListener listener)
super(handler);
this.context = context;
this.listener = listener;
@Override
public void onChange(boolean selfChange)
super.onChange(selfChange);
Uri mUri = Uri.parse("content://sms");
Cursor mCursor = context.getContentResolver().query(mUri, null, null, null, null);
if (mCursor != null && mCursor.moveToNext())
SmsEntity entity = null;
int type = mCursor.getInt(mCursor.getColumnIndex("type"));//now we need to decide SMS message is sent or received
if (type == 1) //it's received SMS
entity = getSMS(true);
else if (type == 2) //it's sent SMS
entity = getSMS(false);
mCursor.close();
if (entity != null)
listener.addSms(entity);
private SmsEntity getSMS(boolean isIncoming)
SmsEntity entity = null;
Uri uri = Uri.parse(isIncoming ? "content://sms/inbox" : "content://sms/sent");
Cursor cursor = context.getContentResolver().query(uri, null,null, null, null);
if (cursor != null && cursor.moveToNext())
entity = printSms(cursor, isIncoming);
cursor.close();
return entity;
private SmsEntity printSms(Cursor cursor, boolean isIncoming)
int type = cursor.getInt(cursor.getColumnIndex("type"));
long msg_id= cursor.getLong(cursor.getColumnIndex("_id"));
String phone = cursor.getString(cursor.getColumnIndex("address"));
long dateVal = cursor.getLong(cursor.getColumnIndex("date"));
String body = cursor.getString(cursor.getColumnIndex("body"));
Date date = new Date(dateVal);
String str = (isIncoming ? "Received" : "Sent") + " SMS: n phone is: " + phone;
str +="n SMS type is: " + type;
str +="n SMS time stamp is:" + date;
str +="n SMS body is: " + body;
str +="n id is : " + msg_id;
Log.v("Debug", str);
return new SmsEntity(msg_id, dateVal, true, isIncoming, phone, body);
Registering/unregistering happens in onResume
/onPause
callbacks of Fragment
:
@Override
public void onPause()
super.onPause();
unregisterContentObserver();
public void unregisterContentObserver()
if (mSmsObserver != null)
try
getActivity().getContentResolver().unregisterContentObserver(mSmsObserver);
catch (IllegalStateException ise)
Timber.w(ise.getMessage());
finally
mSmsObserver = null;
@Override
public void onResume()
super.onResume();
registerContentObserver();
private void registerContentObserver()
mSmsObserver = new SMSObserver(getActivity(), new Handler(),this);
getActivity().getContentResolver().registerContentObserver(Uri.parse("content://sms/inbox"), true, mSmsObserver);//To track an incoming SMS only
android sms smsmanager contentobserver pdu
android sms smsmanager contentobserver pdu
edited Nov 15 at 3:08
asked Nov 10 at 17:06
isabsent
1,96811434
1,96811434
Are you sure you're correctly interpreting what you're seeing? Incoming multipart SMS should always be stored in a single record. As you mention, there's really no other way to group or collect them after writing. Please post yourContentObserver
, and the code for its registration.
– Mike M.
Nov 14 at 16:38
Please post yourregisterContentObserver()
call.
– Mike M.
Nov 15 at 2:52
I have updateted my question. I would like to stress the problem exists on Android emulator SMS client only. I have posted correspondent issue to Google bug tracker issuetracker.google.com/issues/119319859
– isabsent
Nov 15 at 3:10
Yeah, I noticed you'd mentioned that. I'm trying to reconcile your description with what I believe should be happening. However, things have changed, apparently. That is, previously, registering oncontent://sms/inbox
didn't work at all. You'd have to register oncontent://sms
, and sort out what actually changed inonChange()
. Which API levels are you testing this on? Both emulator and devices.
– Mike M.
Nov 15 at 3:20
Also, as a debugging tip, assuming you're testing on API level 16 or above, overrideonChange(boolean selfChange, Uri uri)
, and see whaturi.toString()
is for each time it's firing unexpectedly.
– Mike M.
Nov 15 at 3:23
|
show 10 more comments
Are you sure you're correctly interpreting what you're seeing? Incoming multipart SMS should always be stored in a single record. As you mention, there's really no other way to group or collect them after writing. Please post yourContentObserver
, and the code for its registration.
– Mike M.
Nov 14 at 16:38
Please post yourregisterContentObserver()
call.
– Mike M.
Nov 15 at 2:52
I have updateted my question. I would like to stress the problem exists on Android emulator SMS client only. I have posted correspondent issue to Google bug tracker issuetracker.google.com/issues/119319859
– isabsent
Nov 15 at 3:10
Yeah, I noticed you'd mentioned that. I'm trying to reconcile your description with what I believe should be happening. However, things have changed, apparently. That is, previously, registering oncontent://sms/inbox
didn't work at all. You'd have to register oncontent://sms
, and sort out what actually changed inonChange()
. Which API levels are you testing this on? Both emulator and devices.
– Mike M.
Nov 15 at 3:20
Also, as a debugging tip, assuming you're testing on API level 16 or above, overrideonChange(boolean selfChange, Uri uri)
, and see whaturi.toString()
is for each time it's firing unexpectedly.
– Mike M.
Nov 15 at 3:23
Are you sure you're correctly interpreting what you're seeing? Incoming multipart SMS should always be stored in a single record. As you mention, there's really no other way to group or collect them after writing. Please post your
ContentObserver
, and the code for its registration.– Mike M.
Nov 14 at 16:38
Are you sure you're correctly interpreting what you're seeing? Incoming multipart SMS should always be stored in a single record. As you mention, there's really no other way to group or collect them after writing. Please post your
ContentObserver
, and the code for its registration.– Mike M.
Nov 14 at 16:38
Please post your
registerContentObserver()
call.– Mike M.
Nov 15 at 2:52
Please post your
registerContentObserver()
call.– Mike M.
Nov 15 at 2:52
I have updateted my question. I would like to stress the problem exists on Android emulator SMS client only. I have posted correspondent issue to Google bug tracker issuetracker.google.com/issues/119319859
– isabsent
Nov 15 at 3:10
I have updateted my question. I would like to stress the problem exists on Android emulator SMS client only. I have posted correspondent issue to Google bug tracker issuetracker.google.com/issues/119319859
– isabsent
Nov 15 at 3:10
Yeah, I noticed you'd mentioned that. I'm trying to reconcile your description with what I believe should be happening. However, things have changed, apparently. That is, previously, registering on
content://sms/inbox
didn't work at all. You'd have to register on content://sms
, and sort out what actually changed in onChange()
. Which API levels are you testing this on? Both emulator and devices.– Mike M.
Nov 15 at 3:20
Yeah, I noticed you'd mentioned that. I'm trying to reconcile your description with what I believe should be happening. However, things have changed, apparently. That is, previously, registering on
content://sms/inbox
didn't work at all. You'd have to register on content://sms
, and sort out what actually changed in onChange()
. Which API levels are you testing this on? Both emulator and devices.– Mike M.
Nov 15 at 3:20
Also, as a debugging tip, assuming you're testing on API level 16 or above, override
onChange(boolean selfChange, Uri uri)
, and see what uri.toString()
is for each time it's firing unexpectedly.– Mike M.
Nov 15 at 3:23
Also, as a debugging tip, assuming you're testing on API level 16 or above, override
onChange(boolean selfChange, Uri uri)
, and see what uri.toString()
is for each time it's firing unexpectedly.– Mike M.
Nov 15 at 3:23
|
show 10 more comments
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53241327%2fhow-to-restore-a-long-sms-text-message-from-multiple-short-text-messages-store%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53241327%2fhow-to-restore-a-long-sms-text-message-from-multiple-short-text-messages-store%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Are you sure you're correctly interpreting what you're seeing? Incoming multipart SMS should always be stored in a single record. As you mention, there's really no other way to group or collect them after writing. Please post your
ContentObserver
, and the code for its registration.– Mike M.
Nov 14 at 16:38
Please post your
registerContentObserver()
call.– Mike M.
Nov 15 at 2:52
I have updateted my question. I would like to stress the problem exists on Android emulator SMS client only. I have posted correspondent issue to Google bug tracker issuetracker.google.com/issues/119319859
– isabsent
Nov 15 at 3:10
Yeah, I noticed you'd mentioned that. I'm trying to reconcile your description with what I believe should be happening. However, things have changed, apparently. That is, previously, registering on
content://sms/inbox
didn't work at all. You'd have to register oncontent://sms
, and sort out what actually changed inonChange()
. Which API levels are you testing this on? Both emulator and devices.– Mike M.
Nov 15 at 3:20
Also, as a debugging tip, assuming you're testing on API level 16 or above, override
onChange(boolean selfChange, Uri uri)
, and see whaturi.toString()
is for each time it's firing unexpectedly.– Mike M.
Nov 15 at 3:23