Bluetooth HFP support for Android App with SIP/VoIP - android

I am trying to add support for bluetooth devices like headsets/headphones/car stereo to my android app which allows user to make SIP/VoIP calls. I am trying to mostly address the requirements of Answering and Ending of calls using button on bluetooth headsets, other buttons/features handling is good to have.
With the search I have done and all the text I have read so far, I have come across the following-
One common way suggested everywhere is registering to ACTION_AUDIO_STATE_CHANGED. But this doesn't really helps me. Intents for it are sent every time the button on Bluetooth headset is pressed And also when we start the ring tone on bluetooth headset.
A very common solution I found was use of Bluetooth Adapter class. There isn't much you could do with it. So again not helpful.
Another approach I came across is the use of Vendor specific headset events. After some efforts I was able to get this working for specific Plantronics Bluetooth headsets. Supporting Jabra is important.
One more approach I came across is binding with IBluetoothHeadsetPhone.aidl, the way the phone app does it. I could find very little information on it, not enough to go ahead and implement any thing.
If anyone has done such things, I think the problem I am facing is not an uncommon one, I just believe it is not documented well.
Any pointer, approach, link would be appreciated.
I will try to add more info as I find any or any other approaches I try. Please ask for details if you need any more on the solutions I have tried. And please suggest changes instead of just flagging the question.
Thanks in adv.

Sorry about the late post. I was able to find a solution for this issue. It is not simple fix.
You need to use ConnectionService from Android telecom framework. Check out this link here & here. After this your VoIP calls will have cellular call like treatment.

Related

Android Bluetooth Server

Checked so far : this stack post, this one and official docs
I am not really familiarised with the Bluetooth api, yet I couldn't find something to clarify based on my need.
What I am trying to achieve is: Using my android device (as server in this bluetooth connection) to push data to the other device (which can be on any platform)
Seems simple, and I might think about it in a complicate way (was thinking I might provide some interfaces / callbacks to the client part)
Also, my implementation should not affect the client side.. I am a bit stuck into this, if anyone could clarify it a bit, or come up with a decent sample where the code is described a bit,
Thanks in advance, and Happy Coding !
your phone can act as a master(host) device Here is a example you can implement
https://github.com/bauerjj/Android-Simple-Bluetooth-Example
this example uses Bluetooth to connect with HC-06 module but you can use it with other devices

How to built a Android Single App Mode

I want to use a Android Phone as a controlling unit for one of my projects.
In this the Smartphone is fixed on the hardware.
Tasks for the smartphone are:
Communication via Bluetooth
Handling User Input (e.g. PIN-Entry)
Turning on/off vibration, led ,...
So I wrote a App which does all the things I want.
Now I want that the Smartphone can only be used for this application.
Maybe you can give me some Ideas how to manage this.
I heard about 'kiosk-mode', could this be a solution.
Another option would be a custom ROM or is it possible to get a 'basic-android' without a launcher an just one single app.
I just want some ideas and usefull suggestions from you:)
If you are using Android version "L" there is a way to do that. It is called Task Locking, however it needs root access.
There is a lot of tutorials on this site. I just don't want to copy-paste it.
Take a look here: http://www.sureshjoshi.com/mobile/android-kiosk-mode-without-root/
Pretty good article about task locking and device ownership. And unlike Evgeniy said, root is not needed.

Intercept the outgoing call data, alter it & then write it back out- Why it is not possible?- Android

We are working on an application similar to "Funny Call" on Google Play.
When user makes a call to another another contact, we would be intercepting the call and will add some effects to it and then this modified sound will reach the recipient.
I've searched for the solution to this problem and found out that many developers say Android does not support this.
Android API for call sound stream manipulation
Can the Android API be leveraged to modify the caller's voice during the call?
But, I would still like to know if its really not possible straight from the horse's mouth. I would like to know if there is any specific reason behind this.
Is there really no way to achieve this?
Can you please also tell me if there is any possibility of this being possible in near future?
Is there really no way to achieve this?
If you read through the comments on the app you cited, it would appear that they are doing VOIP, and that their servers are then actually placing the call, as that is why there are calling rates to different countries. I see no evidence that they are using the on-device telephony capability. You, of course, are welcome to supply such evidence, if you have any.

Android: Set up a local VPN, used to intercept packets

I want to intercept packets and get the IP/Port numbers, along with the PID/UID of the connection. Things I'm thinking about and what not below...
VpnService: When using the app tPacketCapture, you can clearly see that they start a VpnService. This is where I think I'll be able to do it. However, what would I search on Google/what do I need to look up about the VpnService so that it just acts as a channel for all the packets to go through so I can read what they contain? I've emailed the company that worked on tPacketCapture, but they've yet to get back to me. If anyone has any idea on this, please say what you know.
/proc/[pid] file system. This area of the OS has valuable information, most importantly, /proc/net/tcp and /proc/net/udp which are both of interest, but I'd rather not constantly read these files and build everything up myself. Hence the VPN solution above.
Their are minor other things, but ultimately, they won't work as well as the VpnService, so if anyone can help me with that and making it "local" only, or even what to search to find other examples in other languages, that'd be great.
So, ultimately, my question is, how do you make a VpnService to just reroute the packets to and from where they were originally going to/from.
Any help on this matter would be greatly appreciated.
Thanks!

Android ASR multi locutors

I'm looking for an Automatic Speech Recognition solution for Android that can handle many locutors at the same time. I need a solution that can understand who is speaking what.
For example, if I have two users in front of my app, and if they are speaking at the same time, I need to know who said "YES" and who said "NO". My grammar is very simple, if it helps...
I've already tested both Android Recognizer Intent and implemented SpeechRecognizer, so I can already recognize the words, but I cannot associate them to specific locutors.
By the way, If you know this kind of solution for other platforms such as iOS or web-based app, I'll take it as well :).
Thank you.

Categories

Resources