How can I implement the blacklist of SMS?

General topics about the Android-Platform itself.
Coding issues please to the subforum right below.

How can I implement the blacklist of SMS?

Postby jasonxxj » Thu Jun 24, 2010 3:54 am

Hello,I'm new here.I need some help.The question is:
How can I implement the blacklist of SMS?
Thank you for your help.
jasonxxj
Once Poster
Once Poster
 
Posts: 1
Joined: Wed Jun 23, 2010 12:37 pm

Top

Re: How can I implement the blacklist of SMS?

Postby damninggodson » Mon Jul 05, 2010 2:54 pm

i had some ideas but when i tried them on code, something wrong happened...

my thought is:

set a BroadcastReceiver for SMS coming, and when u received an SMS, onReceived() is called. and in onReceived(), call ContentResolver.update() to mark the incoming SMS to status 'read'.


any other ideas?
damninggodson
Developer
Developer
 
Posts: 36
Joined: Thu Mar 25, 2010 3:36 am

Re: How can I show/store receive Message

Postby basit bilal » Wed Jul 28, 2010 10:33 am

can any one help me how to show/store receive msg in text box.

I have wright the code but receive msg show on the top of the emulator screen .

package net.learn2develop.SMSMessaging;




import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.SmsMessage;

import android.provider.MediaStore;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import android.util.Log;



public class SMSReceiver extends BroadcastReceiver {

String txtEncryptedMessage ;
public SMSReceiver(String passedView)
{
txtEncryptedMessage=passedView;
//String incoming_SMS =
//"android.provider.Telephony.Sms.Intents.SMS_RECEIVED_ACTION";

}
public void onReceive(Context context, Intent intent) {
Bundle bundle = intent.getExtras();

Object messages[] = (Object[]) bundle.get("pdus");
SmsMessage smsMessage[] = new SmsMessage[messages.length];
for (int n = 0; n< messages.length; n++)
{
smsMessage[n] = SmsMessage.createFromPdu((byte[]) messages[n]);
}
/* Logger Debug-Output */
Log.i(txtEncryptedMessage, "[SMSApp] onReceiveIntent: " + txtEncryptedMessage);
// show first message
Toast toast = Toast.makeText(context,"Received SMS: " + smsMessage[0].getMessageBody(), Toast.LENGTH_LONG);
toast.show();
//txtEncryptedMessage=smsMessage[0].getMessageBody().toString();

//@SuppressWarnings("unused")
///String message=smsMessage.toString();
// txtEncryptedMessage=toast.toString();
/// txtEncryptedMessage=(View) findViewById(R.id.EncryptedMessage);
}
}

Plz help me to solve my problem

abbilal@hotmail.com
basit bilal
Freshman
Freshman
 
Posts: 3
Joined: Wed Jul 28, 2010 8:03 am

Top

Return to General

Who is online

Users browsing this forum: No registered users and 4 guests