0

I want to create application in android which will block call recording.if someone has secretly install call recording app in my phone like virus or something then this app will restrict/prevent all call recording.

so my question is

Is there any way to block call recording?

Thank you in advance.

archish
  • 142
  • 1
  • 13
  • why down vote??? can someone explain me??? and whoever down vote can you give me reason ? – archish May 06 '15 at 12:25
  • 1
    StackOverflow is a community to ask for clarification about specific problems regarding parts of code that you developed, not to ask things too general. Who has voted negatively (not me) must have done so for this reason. Check this http://stackoverflow.com/help/on-topic – MikeKeepsOnShine May 06 '15 at 12:45

1 Answers1

1

I think its possible!!! If one android device is running with two different call recording apps, the call will recorded by first app only, which will use the call recording resources in that device, rest of all apps will fail to record, because the resources can be used by one app at a time, its a computation, who will trigger to start using resources will gonna win..it can be your app!!

I'm just giving Idea only, not the perfect solution!!!

Sample code(Not Full code):

       MediaRecorder recorder = new MediaRecorder();

 Log.d(TAG, "RecordService will config MediaRecorder with audiosource: " + audiosource + " audioformat: " + audioformat);
    try {
        // These calls will throw exceptions unless you set the
        // android.permission.RECORD_AUDIO permission for your app
        recorder.reset();
        recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
        recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
        recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
        Log.d(TAG, "set encoder default");
        recorder.setOutputFile(recording.getAbsolutePath());
        Log.d(TAG, "set file: " + recording.getAbsolutePath());
        //recorder.setMaxDuration(msDuration); //1000); // 1 seconds
        //recorder.setMaxFileSize(bytesMax); //1024*1024); // 1KB

        recorder.setOnInfoListener(this);
        recorder.setOnErrorListener(this);

        try {
            recorder.prepare();
        } catch (java.io.IOException e) {
            Log.e(TAG, "RecordService::onStart() IOException attempting recorder.prepare()\n");
            Toast t = Toast.makeText(getApplicationContext(), "CallRecorder was unable to start recording: " + e, Toast.LENGTH_LONG);
            t.show();
            recorder = null;
            return; //return 0; //START_STICKY;
        }
        Log.d(TAG, "recorder.prepare() returned");

        recorder.start();
        isRecording = true;
        Log.i(TAG, "recorder.start() returned");
        //updateNotification(true);

    } catch (java.lang.Exception e) {
        Toast t = Toast.makeText(getApplicationContext(), "CallRecorder was unable to start recording: " + e, Toast.LENGTH_LONG);
        t.show();

        Log.e(TAG, "RecordService::onStart caught unexpected exception", e);
        recorder = null;
    } 
Narendra Baratam
  • 828
  • 1
  • 12
  • 26