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

  • SEARCH
  • Home
  • 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 8039567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:36:42+00:00 2026-06-05T03:36:42+00:00

How do I read all SMSes from a particular sender to me? E.g. I

  • 0

How do I read all SMSes from a particular sender to me? E.g. I want to scan a) the body, and b) the date/time of all SMSes that came from ‘TM-MYAMEX’ to the phone.

Some websites seem to indicate this can be read from “content://sms/inbox”. I couldn’t figure out exactly how. Also not sure if it is supported on most phones. I am using a Galaxy S2.

  • 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-05T03:36:44+00:00Added an answer on June 5, 2026 at 3:36 am

    try this way:

    StringBuilder smsBuilder = new StringBuilder();
           final String SMS_URI_INBOX = "content://sms/inbox"; 
            final String SMS_URI_ALL = "content://sms/";  
            try {  
                Uri uri = Uri.parse(SMS_URI_INBOX);  
                String[] projection = new String[] { "_id", "address", "person", "body", "date", "type" };  
                Cursor cur = getContentResolver().query(uri, projection, "address='123456789'", null, "date desc");
                 if (cur.moveToFirst()) {  
                    int index_Address = cur.getColumnIndex("address");  
                    int index_Person = cur.getColumnIndex("person");  
                    int index_Body = cur.getColumnIndex("body");  
                    int index_Date = cur.getColumnIndex("date");  
                    int index_Type = cur.getColumnIndex("type");         
                    do {  
                        String strAddress = cur.getString(index_Address);  
                        int intPerson = cur.getInt(index_Person);  
                        String strbody = cur.getString(index_Body);  
                        long longDate = cur.getLong(index_Date);  
                        int int_Type = cur.getInt(index_Type);  
    
                        smsBuilder.append("[ ");  
                        smsBuilder.append(strAddress + ", ");  
                        smsBuilder.append(intPerson + ", ");  
                        smsBuilder.append(strbody + ", ");  
                        smsBuilder.append(longDate + ", ");  
                        smsBuilder.append(int_Type);  
                        smsBuilder.append(" ]\n\n");  
                    } while (cur.moveToNext());  
    
                    if (!cur.isClosed()) {  
                        cur.close();  
                        cur = null;  
                    }  
                } else {  
                    smsBuilder.append("no result!");  
                } // end if  
                }
            } catch (SQLiteException ex) {  
                Log.d("SQLiteException", ex.getMessage());  
            }  
    

    AndroidManifest.xml:

    <uses-permission android:name="android.permission.READ_SMS" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to read all sim contacts and phone contacts separately in Android. I
I have read all that stuff about time saving and I wan't to create
I want to read all cell value from excel sheet using Apache POI and
I want to read all thumbnails from a folder with images in Windows XP.
I want to read all link and title at the same time to array
I want to read all integers from a file and put them all in
I want to read all data from the following URL. http://m.flickr.com/#/photos/westconn/ I want to
I read all the similar questions but mine is slightly different. The first time
I've read all the posts and know that IndexOutOfRange usually happens because a column
To begin i read all resources from xml in my MergedDictionaries and now I

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.