• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Help Prevent mic spyware from listening in background

KingNeil

Newbie
If you were to use a recording app on a phone, would this prevent someone listening to the microphone in the background... picking up background noise...?? I have noticed on a computer that a microphone can only be accessed by one application at a time... Like, if you use Audacity and Windows sound recorder at the same time, it won't let you.... So, if I had an app constantly recording in the background, would that prevent someone from using a hack to listen to me in the background...?

So..... this is why I wanted to create some kind of app for Android that essentially records in the background constantly, and deletes the recording constantly too... The purpose is to use up the mic all the time, so it can't be used by Spyware.

I just want to know whether this works, or whether it really is possible for mics to be used by 2 apps simultaneously anyway.

Thanks
 
I've no idea but I have a hunch you're right.
Can i ask why you think you're being spied on btw? Surely it would be a lot easier to address that.
Not to mention the battery drain caused by an app using the mic constantly
 
Not to make light of your concern in any way, but as Funky pointed out, I would imagine that odds of someone spying on a "regular Joe," even if it were possible, are pretty slim for sure.
 
I wasn't sure myself that the audio capturing resource (microphone, etc.) were shareable or exclusive or not, so I did a quick test using this sample code:


I created two separate apps from this example and they both recorded audio when launched/switched separately.

However, they both recorded because the onPause() method releases an app's resources when a new app is launched.

I commented-out the resource releases in each app and re-launched.

The first app that starts recording keeps control of the audio resources and does not allow recording by the second app.

So, KingNeil, your idea seems feasible given my limited testing of the above.

If you do implement such a function, I would advise posting an icon in the notification/status bar indicating that the (normally shareable) microphone resource has been locked-down.

edit/btw: I'm not 100% sure you'd actually have to record and delete all of the time--you'll have to look at the code and do further testing to see if you could save that resource hit by not actually writing to internal/external storage (but not sure if that is intrinsically linked to the audio API, etc.)

Best of luck!
 
Back
Top Bottom