How to record voice for incoming and outgoing calls?

I received a code for recording voice during incoming and outgoing calls, but without receiving, how to link this code to make a call to record a voice when there are incoming and outgoing calls?

+3
source share
1 answer

It is very simple, it is completely event based. Let me give you the logic for this.

  • Create a BroadcastReceviver that will check incoming and outgoing calls.
  • Create a method that will record voice for both events.
  • Whenever BroadcastReceiver starts, just call this init method.
  • Done.

eg.

Declare a receiver in AndroidManifest

<receiver android:name=".CallRecoderBroadcast">   
    <intent-filter>
        <action android:name="android.intent.action.PHONE_STATE" />
    </intent-filter>
</receiver>

Grant read permission to the phone in AndroidManifest

<uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>

SD- ,

http://www.devlper.com/2010/12/android-audio-recording-part-1/

http://www.devlper.com/2010/12/android-audio-recording-part-2/

+4

All Articles