@@ -0,0 +1,904 @@
+package com.fyp.mountainRescue2;%0A%0Aimport android.content.Context;%0Aimport android.content.Intent;%0Aimport android.os.Bundle;%0Aimport android.telephony.SmsMessage;%0Aimport android.widget.Toast;%0Aimport android.content.BroadcastReceiver;%0A%0A%0Apublic class receiveSMSActivity extends BroadcastReceiver%7B%0A%09%0A%09@Override%0A%09public void onReceive(Context context, Intent intent)%0A%09%7B%0A%09%09%0A%09%09Bundle bundle = intent.getExtras();%0A%09%09SmsMessage %5B%5D msgs = null;%0A%09%09String str = %22%22;%0A%09%09if(bundle != null)%0A%09%09%7B%0A%09%09%09%0A%09%09%09Object %5B%5D pdus = (Object%5B%5D)  bundle.get(%22pdus%22);%0A%09%09%09msgs = new SmsMessage%5Bpdus.length%5D;%0A%09%09%09for(int i= 0; i %3C msgs.length;i++)%7B%0A%09%09%09%09%0A%09%09%09%09msgs%5Bi%5D =SmsMessage.createFromPdu((byte%5B%5D) pdus%5Bi%5D);%0A%09%09%09%09str += %22SMS from %22+ msgs%5Bi%5D.getOriginatingAddress();%0A%09%09%09%09str += %22:%22;%0A%09%09%09%09str += msgs%5Bi%5D.getMessageBody().toString();%0A%09%09%09%09str += %22%5Cn%22;%0A%09%09%09%09%0A%09%09%09%09%0A%09%09%09%7D%0A%09%09%09Toast.makeText(context, str, Toast.LENGTH_SHORT).show();%0A%09%09%09%0A%09%09%7D%0A%09%09%0A%09%7D%0A%09%0A%7D%0A

Create recieveSMSActivity.java