Android 2.3 vs 2.2.1 Bluetooth - android

Can anyone tell me if there have been any changes to the bluetooth functionality in the Android update?
I have an app which uses transmission and reception concurrently with a total of 5 connected devices and this works perfectly on a Motorola Droid2 with 2.2.1 but not on the ATRIX running 2.3
There may of course be a hardware element involved but I wanted to establish this first.
thanks in advance.
John

I had the problem that the bluetooth connection worked only on the second try - the first one almost always fails internally (IOException). And you don't have much time in between trials. This was on my 2.3.3 Sony phone. Logcat showed some messages that might imply an internal problem in bluez or with the bluez/java integration.
This problem did not manifest on a 2.2.x Samsung phone. Note that my program only uses one connection at a time.

Android website says "updated BlueZ stack", but that's all.
Did you check the logs, what are the errors you're getting?
Also, I guess you can try running different emulators with different versions of Android and see how that behaves.

Related

Android 6 / Samsung network issue

I've developed an Android app for remote controlling some special hardware devices. The communication is done via udp and wifi. The app already runs on ~60k devices without any problems but since the rollout of Android 6 I'm getting more and more reports from users who get some strange errors:
Usually the app searches for the hardware with a broadcast package. The app then requests all data from the hardware to stay in sync (~4000 packages in both directions). This sync process is heavily tested with all wifi conditions possible and does work as intended (also on Android 6).
User with a Samsung device and Android 6 are now having the issue, that the sync is unable to complete (no reply from the hardware within 20 seconds). The odd thing is that the broadcast search does work just fine, as well as the beginning of the sync. Usually the timeout happens when 5-15% of the sync was completed.
As I have no idea what could cause this issue I wanted to ask if there is any known problems with Samsung / Android 6 and udp communication via wifi?
Also were there any other changes on the network stack in Android 6 that could cause this issue? On my test devices (HTC mostly) everything runs fine so I'm currently out of ideas.
Edit:
I narrowed the issue down to the following devices:
Samsung Galaxy 6
Samsung Galaxy 6 Edge
Samsung Galaxy Note 5
Edit 2:
I got a Samsung Galaxy 6 device for testing purposes and of course it does work for me. I also tried all sorts of network setup, power saving, anti virus and general settings combination but it's just working all the time.
Edit 3:
After getting some Galaxy S5 and S6 test devices I was not able to reproduce the problem. Comparing the ROM version I found out that these devices all have a newer rom than the devices which got the issues.
Turns out that Samsung simply broke something in their wifi stack which causes the wifi to stop working properly after some udp packages. So only fix for this issue is to wait and hope they fix it in all countries soon.

Android bluetooth: Device specific connection issues

The problem is the following: I'm working on an Android project at the moment that involves the connection of two Android devices. I've got the connection and data transfer working with the guidelines of http://developer.android.com/guide/topics/connectivity/bluetooth.html but my application only works with two specific devices, the Sony Xperia LT22i (Android 4.0.4) and the Samsung Galaxy S Plus (Android 2.3.6).
When I try it on other Smartphones, they can successfully connect and they receive the test-byte '1', with which I check if the connection is working. But when the actual data transmission starts, they don't receive anything and there is no Exception thrown.
I can add the code if needed, but it's the same as on the mentioned Android Developers page, with a few app-specific changes. Has anyone had this problem or knows how to fix it? Thanks in advance.

Testing Issues on Particular Android Devices for Mobile Website

I am trying to recreate an issue which is only caused on HTC One XL phone running Android 4.2.2. It is a styling issue which can be fixed with CSS. The problem is that the Chrome Developers Tool does not have a profile for HTC One XL phone running Android 4.2.2.
I do not have a real device! How can I test for an issue that only exists on particular phone running a particular Android version?
FInd someone with the device to test a beta or debug info gathering build. There's three reasons one particular device has issues.
1)Hardware problem. No emulator will solve this as they won't perfectly emulate hardware.
2)Software bug on this device's framework. Since each OEM ships their own set of patches, there's no way to know what is actually running, except for having the device.
3)Something weird in the system of an individual user. Some odd combo of software, hardware, and data. You need that actual phone to fix this, but it generally only effects a handful of users.
But none of these are solvable without access to the device, or a real Eureka moment. More logging helps, but you'd still need to get those logs which requires a device.

Android Lollipop 5.0 Bluetooth Low Energy central role's bad performance

Since the recent release of Android 5.0 Lollipop I am experiencing very bad performance of the Bluetooth Low Energy API in my Nexus 4 device. With the previous OS version (Android 4.4.4 Kit-Kat) it worked like a charm, and the very same app run on 5.0 has the following behavior:
Frequently it does not detect any advertising packet from the peripheral.
The ADVERTISING_INTERVAL of the peripheral is 20ms, so the app should detect at least one advertising in 60ms in the worst case. I have tried with BluetoothLeScanner (with SCAN_MODE_LOW_LATENCY settings) not to use the deprecated mBluetoothAdapter.startLeScan(mLeScanCallback) with no success.
When it does, when I try to connect to the GATT server it rarely does.
I have checked with a BLE sniffer that the CONNECTION_REQUEST packet
is not even sent to the peripheral.
It seems I'm not the only one with this kind of errors and some other users have posted similar questions. Does anybody know what has happened?
--
Update 1: (2014/12/17)
I have also tested the same app with a Nexus 5 running Lollipop and it rarely connects to the GATT server. Every time I send a connection request, it never does because the peripheral does not receive the packet. Before upgrading this Nexus 5 to Lollipop, it worked perfectly on Kit-Kat 4.4.4 though.
Update 2: (2014/12/17)
Android 5.0.1 does not solve the problem at all.
Update 3: (2015/04/23)
Android 5.1 does not solve the problem either. Today I've had the opportunity to test Android 5.0.1 on a SAMSUNG Galaxy S4 and it works perfectly. I have also tested on the Nexus 5 with a fresh Android 5.1 install, and it works fine too. The problem still remains in the Nexus 4. They made something strange on the the firmware of Android 5.0 and subsequent releases that broke the perfect compatibility Android 4.4.4 had with the Bluetooth API.
reedited to a clearer answer
Last week i had some problems with bt after upgrading to 5.0 . Maybe
you can stop the bt process from apps in settings and it possibly
will reset everything like so:
Settings -> Apps -> Scroll over to All -> Select Bluetooth Share -> Clear Cache.
Shutting those services in instantiate them have been known to solve
this issue in some cases. you can also follow this link if it is
more clear:
http://www.gottabemobile.com/2014/12/01/nexus-lollipop-problems-fixes/
In my case i am nor expert in Bluetooth but I did solve this problems
after many trials. And I discovered that unplaging the bt dongle from
pc help also.
It is not generally recommended to upgrade so soon without checking
competency to bluetooth. As far as I have understood bt is known to
have issues at each upgrade
Good luck with your endeavor. If this answer is not enough I hope you find help from someone else.
I Think I may have found the answer
I had the same problem, it took 2-5 minutes to connect to my device AFTER I upgraded to Lollipop
This took 5 seconds before the upgrade.
The Fix:
Old code :
mBluetoothGatt = mBluetoothDevice.connectGatt(this, true, mGattCallbackSync);
new code :
mBluetoothGatt = mBluetoothDevice.connectGatt(this, false, mGattCallbackSync);
I just changed the autoConnect argument to false. It takes 5 seconds to connect now.
I hope this works for you.

How to use Broadcom BLE SDK (SMART 4.0) in Android 4.X

I am trying to develop a BLE bluetooth (SMART) application for Android.
I managed to download the Broadcom BLE SDK, install through the Android SDK Manager as explained on the web site and download the projects examples.
When I tried to push one of the examples into my tests phones (HTC One S, HTC One X both with Bluetooth BLE feature), I am facing the following issue:
INSTALL_FAILED_MISSING_SHARED_LIBRARY
Is there any possibility to include the broadcom library described in the AndroidManifest.xml file ?
<uses-library android:name="com.broadcom.bt.le" android:required="true"/>
Is someone managed to test the broadcom projects examples? And on which phone?
According to this post, a bug has been discovered on Samsung Galaxy S3, but I didn't find any information about HTC products.
UPDATE : What a great news!!!
Last Android version 4.3 (Jelly Bean) now support low-energy Bluetooth Smart accessories.
http://www.android.com/about/jelly-bean/
https://developer.bluetooth.org/Pages/Bluetooth-Android-Developers.aspx
Not sure that every phones will have an update (even the last HTC One M7 for example) but next phones will certainly embed this major release.
The problem is that if your phone doesn't have the .so file installed, this isn't going to help.
And your device will only (as of this writing) have the .so file if Broadcom has blessed the device.
For example, the latest official build (4.0.4) for the reasonably-new Samsung Galaxy Nexus does not.
For those that don't know, there are two different (incompatible) APIs for LOW-ENERGY Bluetooth (BtLE, now apparently called BT Smart). One is from Broadcom, and the other is from Motorola. Unsurprisingly, each only works on a phone that has that vendor's chips in it.
This is a terrible, terrible situation, and Google REALLY needs to get moving on a solution or Android will become totally irrelevant in a little industry known as HEALTHCARE!!!!!
The HTC One X and One S use a Qualcomm Bluetooth chip, not Broadcom. Therefore the Broadcom SDK would not be expected to work. There is an HTC BLE SDK that works with the HTC One X+, Droid DNA, and HTC One that you can sign up for the HTC BLE SDK here:
http://www.htcdev.com/devcenter/opensense-sdk/partner-apis/bluetooth-low-energy/
Confirming BroadCom BLE stack works on HTC 1X+ and cooperates with standard TI KeyFob Demo.
Seems like I'm making a dumb post, but I thought someone might be encouraged to keep going by an unequivocal statement of at least a tiny success.
BleFindMeClient really does work on the HTC 1X+ in conjunction with the TI CC2540-mini Keyfob aka KeyFobDemo in the TI distro.
I've never written an Andoid app., or code for the TI keyfob, so it took me a frustratingly long while to figure out how all the tools worked and how to configure them, but there was no real magic. For me, some of the other Android demos don't compile out the gate without some code tweaks, but that could just be my inexperience.
http://youtu.be/cqWpjU7gJ2Q
On the other issue regarding getDeviceType(), here is a code fragment that works perfectly every time on the HTC 1x+. Hope this helps too.
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
if ( BleAdapter.getDeviceType(device) == BleAdapter.DEVICE_TYPE_BLE ) {
...
}
Someone find the solution here.
The three steps to do are :
Do not include in manifest file.
In project Properties → Java Build Path → Libraries → Add external jar, add broadcom ble jar.
In project Properties → Java Build Path → Order and Export, check the included jar in step 2.
Finally, the Broadcom samples projects run, but crash after few seconds due to an unknown virtual method not implemented on HTC (.getDeviceType(), ...)!
It seems that something might be missing on the HTC phones as well. This error means that there is probably a layer of software missing (or malfunctioning) between the BLE hardware and the API. As for today I have only seen BLE kind of working on an the Motorola Razr but it seems to be limited to the heart rate profile (and it does not use the Broadcom API).
If any body writing a app depending on this SDK, there is one line I want to tell
in DeviceDiscovery they call a method getDeviceType which is not defined anywhere in the entire Android JB codebase hence it crashes there only. so if are trying hard to remove the crash, just keep in mind you can not do it if it is crashing in device Discovery event.
What a great news!!!
Last Android version 4.3 (Jelly Bean) now support low-energy Bluetooth Smart accessories.
http://www.android.com/about/jelly-bean/
https://developer.bluetooth.org/Pages/Bluetooth-Android-Developers.aspx
Not sure that every phones will have an update (even the last HTC One M7 for example) but next phones will certainly embed this major release.
Just to clarify, only starting with these currently available HTC devices will you find BLE support:
the HTC One X+, the HTC Droid DNA, and of course the HTC One and upcoming flagship devices. Note that as of 4.3, you should migrate to use the standard official Android BLE API, to support devices pre-4.3 you can use the HTC BLE API. See https://www.htcdev.com/devcenter/opensense-sdk/bluetooth-smart for more info and sample code supporting both APIs.

Categories

Resources