übereinstimmt Wenn ich eine SMS an jemanden sende, der "UPDATE" sagt. damit ich den Standort dieser Person ermitteln kann. Ich werde einen Broadcast-Empfänger machen, der aktiv wird, wenn eine SMS eintrifft. Wenn es mit UPDATE übereinstimmt, wird der Standort des anderen Benutzers gesendet.Den Speicherort von somone erhalten, wenn der SMS-Inhalt mit
Der Sendeempfänger.
public void onReceive(Context context, Intent intent)
{
//this stops notifications to others
this.abortBroadcast();
//---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<msgs.length; i++){
msgs[i] = SmsMessage.createFromPdu((byte[])pdus[i]);
str += "SMS from " + msgs[i].getOriginatingAddress();
from = msgs[i].getOriginatingAddress();
str += " :";
str += msgs[i].getMessageBody().toString();
msg = msgs[i].getMessageBody().toString();
str += "\n";
}
if(checksomething){
//make your actions
//and no alert notification and sms not in inbox
}
else{
//continue the normal process of sms and will get alert and reaches inbox
this.clearAbortBroadcast();
}
}
Haben Sie eine Frage haben? Du hast nichts gefragt. – Kuffs
meine Frage ist, wie ich den Sms-Inhalt (hoffe, dass ich wat ich meine durch Inhalt) übereinstimmen, wenn es UPDATE entspricht, dann sollte der Standort der Person, die Sie die SMS gesendet haben, –