[GH-ISSUE #366] Not syncing messages from me #263

Closed
opened 2026-02-28 01:23:55 +03:00 by kerem · 0 comments
Owner

Originally created by @spollard on GitHub (Dec 16, 2015).
Original GitHub issue: https://github.com/ushahidi/SMSSync/issues/366

The Android client does not seem to be POSTing to my server all the messages sent FROM me. Messages that I sent to myself are send to my server. I have around 3,000 messages sent TO me and only ~20 sent from me.

I'm using Android 6.0.1 and SMSSync 2.7.3 and a WSGI Python SMSSync server (it just saves all the POST variables for all messages to a file) behind Apache 2.4.

Here's what I've figured out so far:

The list of messages gets imported into the local data storage in smssync\src\main\java\org\addhen\smssync\smslib\sms\ProcessSms.java on line 187 in the function importMessageKitKat() because I'm using Android version 6 > KitKat (the check is at ProcessSms.java:152).
ImportMessageKitKat() queries the OS for the messages using SmsQuery.INBOX_CONTENT_URI as the URI for the query.
SmsQuery.INBOX_CONTENT_URI is defined to be Telephony.Sms.Inbox.CONTENT_URI in ProcessSMS.java:281, which of course only includes messages in your inbox and does not include messages sent from you (unless they are also to you). See https://developer.android.com/reference/android/provider/Telephony.Sms.Inbox.html

I can see two possible ways to fix this (but I don't know if they will work):

  1. Perhaps we should set SmsQuery.INBOX_CONTENT_URI = Telephony.Sms.CONTENT_URI (<- note the missing "Inbox") so it will include ALL text messages. I'm not positive this will give us only one copy of every message. See https://developer.android.com/reference/android/provider/Telephony.Sms.html
  2. Include another variable named SmsQuery.SENT_CONTENT_URI and set it to Telephony.Sms.Sent.CONTENT_URI (See https://developer.android.com/reference/android/provider/Telephony.Sms.Sent.html) and gather messages from both the Inbox and the Sent messages. We might get duplicates of messages we sent to ourselves.
Originally created by @spollard on GitHub (Dec 16, 2015). Original GitHub issue: https://github.com/ushahidi/SMSSync/issues/366 The Android client does not seem to be POSTing to my server all the messages sent FROM me. Messages that I sent to myself are send to my server. I have around 3,000 messages sent TO me and only ~20 sent from me. I'm using Android 6.0.1 and SMSSync 2.7.3 and a WSGI Python SMSSync server (it just saves all the POST variables for all messages to a file) behind Apache 2.4. Here's what I've figured out so far: The list of messages gets imported into the local data storage in smssync\src\main\java\org\addhen\smssync\smslib\sms\ProcessSms.java on line 187 in the function importMessageKitKat() because I'm using Android version 6 > KitKat (the check is at ProcessSms.java:152). ImportMessageKitKat() queries the OS for the messages using SmsQuery.INBOX_CONTENT_URI as the URI for the query. SmsQuery.INBOX_CONTENT_URI is defined to be Telephony.Sms.Inbox.CONTENT_URI in ProcessSMS.java:281, which of course only includes messages in your inbox and does not include messages sent from you (unless they are also to you). See https://developer.android.com/reference/android/provider/Telephony.Sms.Inbox.html I can see two possible ways to fix this (but I don't know if they will work): 1. Perhaps we should set SmsQuery.INBOX_CONTENT_URI = Telephony.Sms.CONTENT_URI (<- note the missing "Inbox") so it will include ALL text messages. I'm not positive this will give us only one copy of every message. See https://developer.android.com/reference/android/provider/Telephony.Sms.html 2. Include another variable named SmsQuery.SENT_CONTENT_URI and set it to Telephony.Sms.Sent.CONTENT_URI (See https://developer.android.com/reference/android/provider/Telephony.Sms.Sent.html) and gather messages from both the Inbox and the Sent messages. We might get duplicates of messages we sent to ourselves.
kerem 2026-02-28 01:23:55 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SMSSync#263
No description provided.