Tuesday, February 15, 2011

[android-developers] Receive a notification when a call is answered

I am creating an application for API Level 7 and above that receives a
notification every time a phone call is answered and logs that
information to a sqlLite databas. When I run the application in the
emulator, I never receive the notifications.

Here is the class i created. It's simple logs a message to logCat
when it receives the intent:

package ed.app.commTracker;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.SmsMessage;
import ed.app.messageLog.systemOutput;
import java.lang.String;

public class callReceiver extends BroadcastReceiver {
private final String ACTION_ANSWER ="android.intent.action.ANSWER";


@Override
public void onReceive(Context context, Intent intent)
{
systemOutput m_systemLog;
m_systemLog = new systemOutput(systemOutput.LOG_ALL,
"commTracker" );
m_systemLog.logMessage("Log Started: CallReceiver");
m_systemLog.logDebug("CallReceiver::onReceive()");

}

}


and Here is my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ed.app.commTracker"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="7" />

<application android:icon="@drawable/icon" android:label="@string/
app_name">
<activity android:label="@string/app_name" android:name="main">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<receiver android:name="callReceiver">
<intent-filter>
<action android:name="android.intent.action.ANSWER" />
</intent-filter>
</receiver>

</application>
</manifest>

I'm sure I'm doing something wrong, but I can't figure out what. Any
help is appreciated. Thanks

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate