The not-yet-working activities around SMS....

This commit is contained in:
eehouse 2010-02-09 14:33:24 +00:00
parent e271358307
commit e013cbd79d
2 changed files with 56 additions and 0 deletions

View file

@ -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
}

View file

@ -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() );
}
}