mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-29 08:34:37 +01:00
The not-yet-working activities around SMS....
This commit is contained in:
parent
e271358307
commit
e013cbd79d
2 changed files with 56 additions and 0 deletions
|
@ -0,0 +1,35 @@
|
|||
/* -*- compile-command: "cd ../../../../../; ant reinstall"; -*- */
|
||||
|
||||
package org.eehouse.android.xw4;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.telephony.SmsMessage;
|
||||
|
||||
import org.eehouse.android.xw4.jni.*;
|
||||
|
||||
public class ReceiveNBS extends BroadcastReceiver {
|
||||
|
||||
@Override
|
||||
public void onReceive( Context context, Intent intent )
|
||||
{
|
||||
Utils.logf( "onReceive called: " + intent.toString() );
|
||||
|
||||
Bundle bundle = intent.getExtras();
|
||||
SmsMessage[] smsarr = null;
|
||||
if (bundle != null) {
|
||||
Object[] pdus = (Object[]) bundle.get("pdus");
|
||||
smsarr = new SmsMessage[pdus.length];
|
||||
for ( int ii = 0; ii < pdus.length; ii++){
|
||||
smsarr[ii] = SmsMessage.createFromPdu((byte[])pdus[ii]);
|
||||
Utils.logf( "from " + smsarr[ii].getOriginatingAddress() );
|
||||
// buf.append( smsarr[ii].getMessageBody() );
|
||||
// XwJni.handle( XwJni.JNICmd.CMD_RECEIVE,
|
||||
// smsarr[ii].getMessageBody() );
|
||||
}
|
||||
}
|
||||
} // onReceive
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
/* -*- compile-command: "cd ../../../../../; ant reinstall"; -*- */
|
||||
|
||||
|
||||
package org.eehouse.android.xw4;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import org.eehouse.android.xw4.jni.*;
|
||||
|
||||
public class StatusReceiver extends BroadcastReceiver {
|
||||
|
||||
@Override
|
||||
public void onReceive( Context context, Intent intent )
|
||||
{
|
||||
Utils.logf( "StatusReceiver::onReceive called: " + intent.toString() );
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue