how to read incoming sms
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2735571/detecting-sms-incoming-and-outgoing">Detecting SMS incoming and outgoing</a>  </p>
</blockquote>



<p>i want to read an incoming sms to check perticular value exist in sms</p>

<p>i found this sms reciving code
i want to check  if reciving sms have following value  xml values</p>

<p>plz help me how i check</p>

<pre><code>//this is response which i check in reciving sms

00
LOG
00
Adeel Aslam
10.00
10/05/2012 10:00
+100


//this is code which i found for sms recive
     public class SmsReceiver extends BroadcastReceiver
  {
@Override
public void onReceive(Context context, Intent intent) 
{
    //---get the SMS message passed in---
    Bundle bundle = intent.getExtras();        
    SmsMessage[] msgs = null;
    String str = "";            
    if (bundle != null)
    {
        //---retrieve the SMS message received---
        Object[] pdus = (Object[]) bundle.get("pdus");
        msgs = new SmsMessage[pdus.length];            
        for (int i=0; i&lt;msgs.length; i++){
            msgs[i] = SmsMessage.createFromPdu((byte[])pdus[i]);                
            str += "SMS from " + msgs[i].getOriginatingAddress();                     
            str += " :";
            str += msgs[i].getMessageBody().toString();
            str += "\n";        
        }
        //---display the new SMS message---
        Toast.makeText(context, str, Toast.LENGTH_SHORT).show();
    }   

} 
</code></pre>
