When I use Bluetooth on my computer, I have a choice of a few different types of devices to look for. One choice is "headset".
I want to make an application that will connect to another device as though it is nothing but a headset. So the audio and microphone will route from the Android phone to the other device.
Is this possible within the Bluetooth API? If so, is the Bluetooth Chat example the best thing to start with for something like this? Most of the information I can find deals with the opposite situation (using an actual headset with an Android device.)
Most phones are only bluetooth masters, cannot act as devices... I am afraid you are out of luck... Unless what you are doing is on a completely different device and in that case, no, the API will not handle that case.
Related
Actually, this begins with following question:
Can I create a virtual Bluetooth headset to manipulate call stream?
I'm sure this can be done by replacing kernel module for Bluetooth with something made-up. So Virtual bluetooth device on Android? sounds like definitely possible.
And, of course, one may simply use Raspberry Pi, which is capable of emulating a headset (at least, A2DP playback only) bluetooth profile, or even one of these Bluegiga modules, to hook a custom virtual headset with Android and let it play sounds into call. (Oh, well, it's enough to just solder headset's mic input into PC's soundcard..)
It seems, that Android (at least, rooted) allows some flexibility with hacking into other applications by some sort of hooks - https://play.google.com/store/apps/details?id=com.trigonesoft.iti; there's an app which from my desktop experience with JVMTI and jaspects, it also seems that Java-based apps can be tricked well. -
So in theory, there is a way to just make the system think that bluetooth connection manager is actually connected to headset, thus force it to use Bluetooth route to play sound into.
But there's no way to actually "play" into phone conversation, of which I know - so questions like Is it possible to create a simple answering machine in android? are in fact 100% unanswered. I guess it's due to the hardware limitations (and with all that energy-saving audio-routing bells&whistles, it seems to be true)
So, the question is: can the Bluetooth device be emulated without having to replace vendor's bluetooth kernel module (for example, on MTK phones its mtk_stp_bt) with custom stub?
(Honestly it sounds like I'm giving out a bluetooth-sdk-in-userspace idea, well, lets state that I do it for CC-BY-NC license
)
I'm building a Bluetooth device and would like to make it so that once it's paired with an Android device such as a phone or tablet (eg. Nexus 7) it will be able to interact with a custom app on the Android device in a transparent manner without any prior setup.
For example, the behavior I'm looking for is similar to that of a handsfree headset where once you've done the initial pairing you can push a button on your headset, issue a voice command, and it transmits commands to the phone and the phone does it's thing. I have built a Bluetooth device where when a button is pushed it should be able to immmediately send commands to a custom app on my Android device and the custom app should run and do its thing. This should all happen without putting the Android device into some ready state or having my custom app open waiting for commands; it should all be transparent without the user having to do anything (eg. the Android device could be in my pocket or bookbag).
I am a veteran programmer but very new to Android and Bluetooth and would appreciate pointers in the right direction. I imagine that perhaps I would need to install some service-level app on the Android device to implement my own custom profile and/or intercept the Bluetooth commands but these are just guesses; I'm hoping someone would shed light on the actual process so that I can read up on them in detail. I'm also hoping that the solution is a generic one that would apply across the board but right now I'll take anything I can get lol!
Many thanks in advance.
I'm looking for a way to scan for android devices in my area.
It should work without internetaccess nor gps.
Just knowing the mac-address is enough for this app.
The first way I was thinking of was to use bluetooth.
It's possible to scan for bluetooth devices, but it isn't possible to make your own device visibile forever (Android docs say that's possible, but it's limited to max 300 seconds).
The next what came up in my mind was to scan for wifi networks.
Almost every android phone uses wifi.
It's possible to scan wifi networks.
But is it possible to set my device as an accesspoint?
It can with systemsoftware but I would like to do it programmatically.
Does someone know if that's possible? Is there another way to let devices 'see' eachother?
Thnx
But is it possible to set my device as an access point?
This is possible by reflection, but not recommended. However you cannot force others to join your Wifi network. That is entirely their prerogative.
Is there another way to let devices 'see' each other?
Yes it is possible to see other device on the network. Check out these answers. If you have your apk installed on their device you can even try WiFi multicasting.
I've very interested in a new project, but it requires the user be able to access the phone's display via a wireless trackpad and screen. I'm thinking bluetooth is the best way to go. I can find a few resources regarding the bluetooth classes, but I can't find any resources for mirroring the phone's display or manipulating the ui with a trackball using blue tooth.
Are these two things possible? Could someone give me some information or point me towards some resources?
So you want to remotely control your Android Device with a Trackpad using Bluetooth for the connection? Do you need this for the whole Android System or just for your App?
If just for your App, their should be a way of doing this since communication between two Bluetooth-Devices runs over Sockets (like Client-Server communication). See the Androids Bluetooth API. But I'm also not sure how you plan to make the Android Device understand the Bluetooth-Commands which the Trackpad is sending to it (if you can even get both of them to connect to each other).
If you need it for the whole System, I'm not sure if this is possible (without rooting the phone and maybe writing some drivers for it), as I don't know any way of emulating a touch/click on the screen (which is basically what you want).
Although I know that there are some experiments running to connect a Bluetooth-Keyboard with an Android Device. But their is nothing official yet and nothing to look into (like SourceCode) as far as I can tell.
But maybe I'm looking at this a lot too complicated...
I'm hoping to have an Android broadcast to multiple Bluetooth headsets at once - the idea is to have a radio-like stream that users of an app can tap into. It is important that all users hear the music in sync (that is, the song ends at the same time for everyone).
I have not been able to determine if A2DP will allow streaming to multiple receivers, but I'd be open to other streaming solutions if you have them. Extra points if Android and iOS devices can play with each other!
I dont think streaming to multiple devices over A2DP is currently supported.
According to http://developer.android.com/reference/android/bluetooth/BluetoothA2dp.html in BluetoothA2dp class overview: "Android only supports one connected Bluetooth A2dp device at a time".
I have two Creative WP-380 that have ShareMe function that permit to listen the same stream audio in the same time. I and my wife watch movie with our linux notebook using that couple of headsets.
One is the master, bluetooth connected with the notebook, and the second is the slave, paired with the first.
Works excellent with our android tablets!
It was possible with Windows Mobile 6.5 on a HTC Touch Pro 2 (a bad smartphone because of it´s slow CPU). I used two A2PD Headphones simultaneously.