A device is connected to the Head Unit of the car via Bluetooth. There is an active call which is already going on. Then I get another call.
My question is, how should I display or notify user about the second incoming call without disturbing the first call?
Related
I am currently working on AOSP. I wanted to know how to stop the auto connection procedure which is in progress while a user requests for an inquiry of available devices. And I also want to re-start the auto connection once the inquiry is completed or user has aborted the enquiry.
I have to make these changes in the Android Source Code and I am currently working on Android P.
I am not sure if I understood your question well but reconnection or auto connection of bluetooth profiles is always handled by the state machine and there is no way to stop or pause it.
The only way to achieve this type of behaviour is to access the particular profile service via proxy and then on that service call this method:
profileService.setPriority(bluetoothDevice, BluetoothProfile.PRIORITY_OFF);
The above statement will make state machine not to process any connection requests on the specific profile on which you called this method and on the bluetoothDevice which you passed as parameter and once you are done with the query just call the same method again like this:
profileService.setPriority(device, BluetoothProfile.PRIORITY_ON);
I'm integration bluetooth support in my Android app for VOIP calling scenarios. Goal: display caller ID on bluetooth device, allow accept/reject of incoming/active calls through the BT peripheral. Without any work, everything works as expected when calling with the native dialer on Android but I can't find the appropriate APIs to implement the same behavior in our app - are these not exposed?
If a VOIP call is initiated through our app, we start the bluetooth SCO connection and listen for any media /state changes. Pressing the 'answer/reject' button results in a DISCONNECTED state change event (could use this to reject the call but that's not reliable as the same event is received if the BT device is disconnected). I haven't found any leads on displaying the appropriate caller ID (a custom string that I want to provide) or answering calls. Anyone been on this path and have some pointers?
Thanks!
I want to build a simple challenge response protocol in order to authenticate a user to an Arduino via the smartphone (Android and iOS) using BLE. I'm having problems seeing how this would be implemented with BLE. What I want to do:
Arduino sends/broadcasts a challenge
Smartphone receives challenge and computes response
Smarpthone sends response to Arduino
The way I thought about implementing this is to have the Arduino (peripheral and server) start advertising when a button is pressed. Ideally an event would be triggered on the smartphone (central and client) when a certain service shows up. Then the smartphone connects to Arduino, reads the challenge characteristic and writes the response to it. Is this a good approach?
It appears though that it is not possible to trigger an event when a BLE service appears and I would continuously need to scan with the smartphone which is very battery intensive. Not sure how to get around this? Geofencing is not really an option since it can be inside. Maybe detecting if the user is walking, biking, standing still? Any suggestions are greatly appreciated =).
On iOS BLE connectivity looks like this:
initialize CBluetoothManager,
start discovering devices through bluetooth.
when found particular peripheral that u're intrested in, connect to it via core manager and store this peripheral variable in ur Class,
then.. u should STOP discovering cuz it's terrible for batteries ;) (as u said),
after device's found, you can search through services, characteristic and at the end through descriptors <-- IN THIS ORDER otherwise u won't get any of these,
ofc, from now on you're able to store each of these vars in your Class and work with them as you wish to. BLE on iOS's based on delegates and it's own lifecycle, each time when there will be something to read the event will trigger. When you will want to send some msg to Arduino back it shouldn't be a problem. In the partial answer for your question about
'when a certain service shows up. THEN the smarphone connects to
Arduino.'
you have to make steps ABOVE in order to read services. Hope that helps.
hi I am working on android application but I have problem with connection ... I need to connect two android device when of them had program work in back ground and other interact with user
I want when the first device which deal with user send request to the other (back ground device) to send information automatically with out human action
how can I do it ??
I tried TCP/IP but it is not efficient because the ip is static and i cant request from other device (have program work in BG)
I tried using host but there is no host afford client-server-client inter act automatically and then send it back client-server-client
the project idea is to determine location of other device (which have app work in BG) when the user request
so the BG device should sent its exact location (let,lng) and speed and i want to possibility of adding more device working in BG connecting with main app in main device /
.
do you have any better idea for the connection ??
How about parse.com or some other system to send push messages? The automatic system can do whatever you want when it gets a message. The catch is delivery of push messages isn't guaranteed.
The question is based on an observation I made while playing around with the WiFi Direct Demo Application rolled out by google.
Why does the shown list of Available peers tend to shorten even when the WifiDirect enabled devices are in close range? However, if I manually 'search' for available peers again, the list of peers grows. Well the latter seems a normal behavior, whereby mManager.discoverPeers() is called first which subsequently invokes a call to the callback function onPeersAvailable() to give a new set of peers if changed.
But why would onPeersAvailable() get called when the phones are just idle but still nearby and thus shorten the list of peers?
Thanks