**Overview of devices known so far:
Nexus 6,
Nexus 9,
Moto E 4G LTE,
LG G4,
Galaxy S6,
Samsung Galaxy S5 (model SM-G900M),
Nexus 5X,
Sony Xperia Z5 Compact,
Samsung Galaxy Tab S2 **
** Also see https://altbeacon.github.io/android-beacon-library/beacon-transmitter-devices.html **
One of the new features of the Android 5 release is support for Bluetooth Low Energy peripheral mode. While it is promoted to work independent of the used device, it seems to be chipset dependent (see the isMultiAdvertisementSupported() function in BluetoothAdapter.java).
It is working for the Nexus 5, but not for the Nexus 7 (called a bug in BLE peripheral support Android-L example, but it might never work because of its chipset?). Also https://code.google.com/p/android-developer-preview/issues/detail?id=589 does not give conclusive statements.
My concern is that, as many older devices are expected to get Android 5, only the newest tablets (and relatively new phones) will support BLE peripheral mode. This might be unclear to the end-user of apps relying on this new Android 5 feature.
For me it is very unclear which chipsets/devices, that will eventually get Android 5, will support the BLE peripheral mode. Anyone who can give me any insights on this? Which chipsets will support the BLE peripheral mode? More specifically, as many of our customers have a Nexus 7 (2013), will the Nexus 7 ever get supported?
Edit 19-2-2015:
Since December 2014 it is not supported anymore for the Nexus 5, only Nexus 6 and 9 seem to have support for BLE Peripheral Mode/ Advertising. Hope the number of devices supporting this will significantly increase in the near future.
More information and discussion here:
https://code.google.com/p/android-developer-preview/issues/detail?id=1570
Edit 6-3-2015: Added overview for quick reference
Edit 17-2-2016: Added some devices that I've checked myself but were not in any of the other lists
The Android 5.0.X will only allow you to use the new API for BLE. This new API comes with a new feature, which you mentioned in your question: The possibility of advertising, from your own Android device, using it in Peripheral mode. However, the disadvantaged of this new feature is that it is hardware dependent. For example, before you start any BLE you need to:
First: Check to see if the BLE is supported, which you can do by adding this line in your manifest: <uses-feature android:name="android.hardware.bluetooth_le" android:required:"true"/>
Second: You need to check if your chipset has support for it, using the following methods:
bluetoothAdapter.isMultipleAdvertisementSupported();
bluetoothAdapter.isOffloadedFilteringSupported();
bluetoothAdapter.isOffloadedScanBatchingSupported();
Also notice that for both of the above methods, the API documentation clearly states that:
"Return true if the multi advertisement is supported by the chipset"
"true if chipset supports on-chip filtering"
"true if chipset supports on-chip scan batching"
That being said, it brings us to the question:
"Which hardware devices are going to support this feature ?"
Well, the answer to that is a little bit more complicated since this is not a mandatory feature for the bluetooth hardware/protocol and it will probably vary from manufacture to manufacture. But for now, the only currently devices that officially are supporting the technology, without major issues, are the Nexus 6 and Nexus 9, since their hardware already comes with the support. The best that you can do it, is not rely solely on the technology for now and try to explore other possible solutions, if any.
Related
The Altlibary is great at detection! One thing we noticed with testing is if we have an app doing both transmitting and receiving we are not picking up the other phones at times. (Very sporadic) With real devices like ibeacons we are constantly able to pick them up.
My question is how do we control the frequency of the transmitter vs the frequency of the scanning (recieving) so that we can both do transmission and detection at the same time?
My goal is to achieve the best of both worlds scanning and transmitting, is that even possible.
https://altbeacon.github.io/android-beacon-library/beacon-transmitter.html
By default, the Android Beacon Library's BeaconTransmitter uses the highest power and frequency allowed by the underlying APIs in the Android operating system. Here are the settings, showing the defaults:
beaconTransmitter.setAdvertiseTxPowerLevel(
AdvertiseSettings.ADVERTISE_TX_POWER_HIGH);
beaconTransmitter.setAdvertiseMode(
AdvertiseSettings.ADVERTISE_MODE_LOW_LATENCY);
While the settings are configurable, presumably you already want the fastest and strongest advertising for you use case. And that is exactly what the library does with no extra configuration. (Note: there is very little reason to lower the transmit power or frequency, because tests show that transmitters use negligible battery. See my blog post here: http://www.davidgyoungtech.com/2015/11/12/battery-friendly-beacon-transmission)
If you are seeing that hardware beacons are reliable, but some phone models' transmitters are not detected infrequently, then the issue may be hardware issues with those phones themselves. You may wish to characterize which ones are problematic.
I can confirm that I see very strong transmissions from the Pixel 3a, Moto G7, Samsung Galaxy S10 and Huawei P9 Lite I have handy.
For example, if there is a gaming console (i.e PlayStation) connected to HDMI input in a TV with Android TV. Then, is it possible to record the video going through this HDMI input with a 3rd party app?
In my question I'm referring to Android's TV input framework
Thanks for the helpers.
The TV Input Framework docs mentions that it supports TV recording APIs.
DVR
For devices on Android 7.0 and above, the TV App must support the
Android framework TV recording
APIs,
to support, list, and play recorded programs.
This allows device manufacturers to plug their DVR subsystems into TIF
and dramatically reduce the integration effort it takes to enable or
integrate DVR functionality on a TV device. It also enables third
parties to provide aftermarket DVR systems that can be plugged into an
Android TV device.
In addition to recording live content, the TV App also handles
resource conflict. For example, if the device has two tuners, it can
record two programs at the same time. If the user asks to record
three, the TV App must handle the conflict and should either surface a
notification or request that the user schedules a priority for these
requests.
However I don't have code samples for you as I haven't experimented with this yet.
Another approach would be to use the MediaProjection API and record this with a MediaRecorder. Jake Wharton's app Telecine follows this approach and you can find the source code on GitHub.
The benefit is that these APIs were introduced with Lollipop, so you can use them on all Android TV devices. However I just started experimenting with Android TV, so I can not tell from personal experiences.
My app required to connect 9 Ble devices concurrently.
In this article and any other resource it write that android 4.4+ can connect only to 7 devices.
Is there anything new in M or N versions?
Thanks.
The number of connections is limited by the constants MAX_L2CAP_LINKS and GATT_MAX_PHY_CHANNEL which is currently (still) set to 7.
If you try to connect the 8th device with autoConnect = true, the stack will hang and fail to connect again until you restart Bluetooth due to a bug introduced in Android M. If you use autoConnect = false to connect an 8th device you will immediately get an onConnectionStateChange callback with newState = disconnected and no attempt to connect will be made.
I don't know why these constants are so low. Often the hardware itself can do more than 7. For example, Nexus 6P can do 15 if you compile AOSP yourself and change the constants.
Samsung seems to have noticed the issue and increased the constants on some of their devices. For example, Samsung Galaxy Tab A 10.1 can handle 15 BLE connections without modifications.
It seems that those constants are global limits, and not per app. I am linking to the source of the BT stack in Android. I wonder why those constants are as they are... seem random.
#define GATT_MAX_PHY_CHANNEL 7
https://android.googlesource.com/platform/external/bluetooth/bluedroid/+/master/include/bt_target.h#1428
#define BTA_GATTC_CONN_MAX GATT_MAX_PHY_CHANNEL
https://android.googlesource.com/platform/external/bluetooth/bluedroid/+/master/bta/gatt/bta_gattc_int.h#89
tBTA_GATTC_CONN conn_track[BTA_GATTC_CONN_MAX];
https://android.googlesource.com/platform/external/bluetooth/bluedroid/+/master/bta/gatt/bta_gattc_int.h#424
NOTE
This is the official Android code. Up until Android 7.2 the vendors used to change that implementation a lot. The theory in Android 8 and above is that vendors should not modify it (not enough Android 8 devices on the field to see how this works in practice... at least at time of writing this reply).
Which Android wear smartwatches return true for the following check:
BluetoothAdapter.getDefaultAdapter().isMultipleAdvertisementSupported();
?
On stackoverflow (Chipsets/Devices supporting Android 5 BLE peripheral mode) there is only a list for Android smartphones and tablets.
Edit: The ASUS ZenWatch 2 returns false.
I read about this article which mentions that Pebble smartwatch contains the sensor for BLE, but the standard has not yet caught on with developers and I also haven't actually checked if it returns true on:
BluetoothAdapter.getDefaultAdapter().isMultipleAdvertisementSupported();
It is, however, mentioned in Android Wireless and Connectivity that
Android 4.3 introduced platform support for Bluetooth Low Energy (Bluetooth LE) in the central role. In Android 5.0, an Android device can now act as a Bluetooth LE peripheral device.
Hope that helps!
I would like to control an Arduino device with a Motorola phone.
I have a Lilypad (preferred), an Uno, and a Mega Arduino board and I have two Motorola phones (a Droid Bionic and a Droid Razr Maxx) both running Android 4.1.2. According to an App called "USB Host Diagnostics" neither phone has USB Host Mode capability.
A variety of sites suggest the problem is that the phone doesn't provide enough power to the Arduino. Their solution requires cutting up and reconnecting the wires inside the cables. Others say the creation of a special "dongle" solves the problem, as long as it is in the phone when it starts to boot up but is removed before it finishes. Others suggest that it requires rooting the phone, which I'm afraid is probably beyond my comfort level and skill set. And many of these postings are several years old.
Has anyone figured out an smarter/better way to either enable or work-around the host mode capability issue of these phones? Or would it just be easier to find a used Nexus or Galaxy phone?