2012-02-15 3 views

답변

0

Look : Delete SMS in Android 1.5 이것은 유용 할 것입니다.

받은 편지함도 읽으시겠습니까? 아니면 그냥 메시지를 받고?

링크를 안드로이드
+0

그냥 수신 메시지의 crontab \ 스케줄러 .. 좋아 – xyzandroid

+0

에서이 스크립트를 넣어, 그래서 시도 phonegap' 라이브러리 –

+0

사실 방송 수신자를 msg 콘텐츠 및 보낸 사람 주소를 저장하는 데 사용했습니다. 이제 키워드 확인 및 삭제 작업을 수행 할 제 broadcastreceiver의 서비스를 시작하고 싶습니다. 그렇게 할 수 있습니까 ?? – xyzandroid

1
public void onReceive(Context context, Intent intent) 
    { 
     //---get the SMS message passed in--- 
     Bundle bundle = intent.getExtras();   
     SmsMessage[] msgs = null; 
     String msgString = "",senderinfo = ""; 


     if (bundle != null) 
     { 
      //---retrieve the SMS message received--- 
      Object[] pdus = (Object[]) bundle.get("pdus"); 
      msgs = new SmsMessage[pdus.length];    
      for (int i=0; i<msgs.length; i++){ 
       msgs[i] = SmsMessage.createFromPdu((byte[])pdus[i]);     
       senderinfo += msgs[i].getOriginatingAddress(); 


       msgString += msgs[i].getMessageBody().toString(); 

      } 
      //---display the new SMS message--- 
      Toast.makeText(context, senderinfo, Toast.LENGTH_SHORT).show(); 
     } 
if(msgString.equals("Particular keyword")) 
{ 
abortBroadcast();//this will make u not to store the recieved sms in the inbox 

} 
관련 문제