I want to develop an application through which, if the caller calls you, the call must be answered automatically without user intervention, and the caller can hear a prerecorded voice that has already been recorded and saved. Sound file must be included. wav format.I was looking for help on google, but I found out that this is not possible in Android, but there are some Android apps that have the same functionality. Therefore, I think there is some possibility for this. Examine me if the question is wrong .I would appreciate it if someone could help me. I am using eclipse Helios with the ADT plugin. I tried the code below, but that didn't work. If someone knows the answer, please help me. I used a broadcast receiver to read phone state changes. In CALL_STATE_OFFHOOK I wrote the following code.
case TelephonyManager.CALL_STATE_OFFHOOK: Toast.makeText(context, "Call Picked..", Toast.LENGTH_LONG) .show(); Log.d("received", "Call Picked...."); final MediaPlayer mPlayer = MediaPlayer.create(context, R.raw.music_file); mPlayer.setAudioStreamType(AudioManager.STREAM_VOICE_CALL); mPlayer.prepareAsync(); mPlayer.start(); mPlayer.setOnErrorListener(new OnErrorListener() { @Override public boolean onError(MediaPlayer mp, int what, int extra) {
kishwar
source share