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 7169977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:07:08+00:00 2026-05-28T15:07:08+00:00

This is the SMS observer code. I need to check only sent sms. When

  • 0

This is the SMS observer code. I need to check only sent sms. When I use the content://sms/ I get the result. But why don’t I get results when I use the content://sms/sent/? I’m using Android 2.1.

import android.app.Service;
import android.content.ContentResolver;
import android.content.Intent;
import android.database.ContentObserver;
import android.database.Cursor;
import android.net.Uri;
import android.os.Handler;
import android.os.IBinder;
import android.util.Log;

public class smsSentService extends Service 
{
    ContentResolver contentResolver;
    Uri uri=Uri.parse("content://sms/sent");
    Handler handler;

    @Override
    public IBinder onBind(Intent arg0) 
    {
        return null;
    }

    @Override
    public void onCreate() 
    {
        contentResolver=getContentResolver();
        contentResolver.registerContentObserver(uri, true, new contentObserver(handler));
        super.onCreate();
    }

    @Override
    public void onStart(Intent intent, int startId) 
    {
        super.onStart(intent, startId);
    }

    @Override
    public void onDestroy() 
    {
        super.onDestroy();
    }

    public class contentObserver extends ContentObserver
    {
        public contentObserver(Handler handler) 
        {
            super(handler);
        }

        @Override
        public void onChange(boolean selfChange) 
        {                   
            Cursor cursor = contentResolver.query(uri, null, null, null, null);
            cursor.moveToFirst();
            String content = cursor.getString(cursor.getColumnIndex("body"));
            Log.d("!!!!!!!!!!!!!", content);
            super.onChange(selfChange);
        }
    }
}
  • 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-05-28T15:07:08+00:00Added an answer on May 28, 2026 at 3:07 pm

    Take a look at http://gbandroid.googlecode.com/svn-history/r46/trunk/MobileSpy/src/org/ddth/android/monitor/observer/AndroidSmsWatcher.java

    That code listens for changes to the whole of content://sms and checks the type to see if it is a sent message.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I write application which will get data from received SMS. This is data only
I'm using the following code to send an sms. But this seems to not
I have a content observer that polls content://sms/ in android 1.5 so that I
I'm trying this: function send_sms() { $liveQuery = $this->db->get('liveList'); $counter = 0; foreach($liveQuery->result() as
I have this code to send an SMS message with an attachment that is
I am developing an app which gets outgoing SMS content through content resolver but
I have this code to fire SMS Intent : String uri= smsto:; Intent smsIntent
My app uses a BroadcastReceiver to get sms in this way: SmsBR.java public class
This is simple code send SMS. 47: SmsManager sms = SmsManager.getDefault(); 48: sms.sendTextMessage(12345678901, null,
In my sms-script I read in the text to send with this subroutine: my

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.