Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9093691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T23:09:59+00:00 2026-06-16T23:09:59+00:00

When querying Android’s MMS-SMS Content Provider , the date column has different epoch time

  • 0

When querying Android’s MMS-SMS Content Provider, the date column has different epoch time values for MMS as opposed to SMS.

ContentResolver contentResolver = getContentResolver();
final String[] projection = new String[] { "body", "person", "sub",
            "subject", "retr_st", "type", "date" + " as " + "d", "ct_cls", "sub_cs",
            "_id", "read", "ct_l", "st", "msg_box", "reply_path_present",
            "m_cls", "read_status", "ct_t", "status", "retr_txt_cs",
            "d_rpt", "error_code", "m_id", "date_sent", "m_type", "v",
            "exp", "pri", "service_center", "address", "rr", "rpt_a",
            "resp_txt", "locked", "resp_st", "m_size" };
String sortOrder = "date";
Uri uri = Uri.parse("content://mms-sms/conversations/");
Cursor c = contentResolver.query(uri, projection, null, null, sortOrder);

String messageDate = c.getString(c.getColumnIndex("date"));

In the case of MMS, the epoch time that gets saved in the messageDate variable is 10 digits long. However, in the case of an SMS, the epoch time that gets saved in the messageDate variable is 13 digits long.

This becomes an issue when trying to sort by date since the MMS messages show up before SMS messages when sorted by date.

Is there any way to query this Content Provider and get all messages (MMS or SMS) sorted by date correctly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T23:10:01+00:00Added an answer on June 16, 2026 at 11:10 pm

    It looks like the way to sort messages by date, regardless of whether the message is an MMS or SMS, is to change the sort order to normalized_date as follows:

    String sortOrder = "normalized_date";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm querying a database in Android. The table is your ordinary table with values,
I have an android app that a) performs an updateData() function (querying content providers
I'm making an android application using phonegap. I'm using phonegap's Storage api for querying
I am developing an Android application that has a database having 14-15 tables. I
I'm having trouble querying my SQLite database using Android. I keep getting either an
In my android application I am querying a database. I am only able to
In my android application, I am querying a mysql database for a specific food
As explained in Developer documentation Android supports setting different images for different sizes of
When querying a ContentProvider on Android, one specifies the ContentProvider of interest by providing
When querying data via PHP, will it significantly slow down the page loading time

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.