How to know which application is using the microphone [duplicate] - android

Hello everyone i am new to android ndk and want to find two things:
Can we detect whether the microphone is on or not?
Can we detect which application is using the microphone?
It would be good if anyone knows any idea how to do above through C or through android sdk.

1.
AudioManager am = Context.getSystemService(Context.AUDIO_SERVICE)
am.isMicrophoneMute()
But I don't know how to do it using NDK (and no one seems to know).
AudioManager documentation
2.
No you can't.
And that is a security decision. As #AndiJay said, malicious programs could then be used.

Related

Turn On GPS using NDK

I have read a lot of posts about managing GPS in android using code.
All of them saying that it is not possible. But they are all using android SDK to talk about the topic. Since it is not possible with SDK, can it be done using NDK?
I am asking this question, even after reading all those, because the android settings application can enable/disable it, which means it is not impossible.
In my app, it needs to turn GPS for a while and turn it off (for power reduction) and send the GPS data to a server.
Ultimately android is Linux based. So there must a way to turn it on/off using the Linux commands/APIs right? (or using the NDK) can anyone share the ideas about that?
If it is not at all possible (last option), is there any alternate way to get location information using any other functionalists.
In general, the Android NDK interface is much more limited than the SDK interface. To supplement it, you are able to access Java functions through the JNI interface. There is no extra functionality in the NDK that does not already exist in the Java SDK.

Android audio stream and microphone

Im fairly new to Android development but from what I read I am pretty sure there is no direct API access to the in-call audio stream. I need to make something very close to an answering machine so I was wondering if there is any API support to pass an audiostream to the microhpone internally and use that as a workaround for not having access to the call stream. IE someone calls, we get the answer, mute the microphone so that he cant hear the environment and pass an alternative audiostream(some kind of recording) to the microphone while it is muted...That was the only workaround I can think of and I have no idea if something like that is possible, but I will appreciate any feedback. Thanks!
No, Android does not support injection of audio into the voice call uplink.There are some mobile platforms that support this functionality, but it's not something that's available to app developers since there's no API in place for it, regardless of whether you're using the Java APIs or the native APIs.
The accepted answer isn't correct now. I don't know maybe it was true 9 years ago but I know that it's possible to inject audio onto uplink using tinyalsa library.

Can we detect which android application is using the microphone?

Hello everyone i am new to android ndk and want to find two things:
Can we detect whether the microphone is on or not?
Can we detect which application is using the microphone?
It would be good if anyone knows any idea how to do above through C or through android sdk.
1.
AudioManager am = Context.getSystemService(Context.AUDIO_SERVICE)
am.isMicrophoneMute()
But I don't know how to do it using NDK (and no one seems to know).
AudioManager documentation
2.
No you can't.
And that is a security decision. As #AndiJay said, malicious programs could then be used.

How to create equalizer for android

I want to create simple equalizer for android. How can I do it?
Try to find some methods in MediaPlayer class. But all my attempts failed.
Android has built-in qualizer engine, though it isn't located in MediaPlayer class, becouse it's a class itself located in android.media.audioFx package.
http://developer.android.com/reference/android/media/audiofx/Equalizer.html
Simple answer... you can't do it with the framework or with Java (because there is no JMF support in Android). You have to use the NDK and JNI to compile a native library with equalizer support. If you know C/C++ there are plenty of libraries around that will provide this functionality but if you don't know C/C++ or have the means to pay someone that does I would recommend you move on to something else within your means... There are even some working examples for Android, if you look around, that use libmpg123... but libmpg123 only provides an equalizer interface for mp3's. I found that it's pretty buggy in general and compromised the stability of the app in such a way that it would lock up android and I would have to pull the battery to reboot the phone. In addition, there was alot of audio clipping even with the equalizer flatlined. That is my experience...
I hope that below link is useful for you.
https://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/media/AudioFxDemo.html

android bluetooth

Can someone explain to me the concept behind using bluetooth?
My project in my studies is to make an android app using bluetooth, SQLLIGHT and google app
the app itself is a very easy one but I just dont get the tools I need to use :
How does the bluetooth works? Is there a simple example?
the concept behind android GUI (I already made one but I think I am not fully understood his power)?
note : I am using v 2.1
For learning bluetooth on android I guess you should dig into: http://developer.android.com/guide/topics/wireless/bluetooth.html
Should be simple.
Before you learn to program Bluetooth with API on a given platform, you need to read up a few basics first to understand the technology first. There are plenty of resource materials on internet for learning. If you prefer a book, you can try http://www.amazon.com/Bluetooth-Operation-Use-Robert-Morrow/dp/007138779X

Categories

Resources