Android Bluetooth getService returns null - android

I am trying to connect a device with phone via bluetooth by calling following two function for the service. First one "mBluetoothGatt.getService(uuid)" and "BluetoothGattCharacteristic.getCharacteristic(UUID)".
Problem is sometimes one of the service returns null. Sometime back it was working correctly, but now its not working at all.
But it works when i restart the bluetooth of the phone. After sometime (5-6 mins) it again stops working.
Please help, on what steps to follows to debug further for getting it work.
Thanks in Advance.

Test using a second device. It is very possible that there might an issue with your current device.

You said you're checking multiple devices, are you also checking on multiple software versions. From what I have found a lot of android 4.4.X have this issue. From what I have found there is no push to the latest version that fixes the issue. This is a resolution that worked for some people.

Related

Android Speech Recognition Stopped Working Overnight

I have developed a Ionic app that uses Android Speech Recognition API via a Cordova plug-in. It worked fine a few days back, but one day it stopped working. I did not change any source code. Sometimes it immediately returns me an error: ERROR_NO_MATCH. Sometimes it worked for one second, gave me one or two words and stopped listening abruptly, regardless that I was still talking to it.
I reflected what has happened in recent days that may have caused problem.
Changes to Google speech recognition server? It is not likely. I did not
find anything about it from the web. But a weird thing is: I installed some other simple voice-to-text apps, they all seem to terminate listening prematurely.
Changes to my computer? I have re-imaged my hard drive and reinstalled everything.
Changes to my mobile phone? Maybe some auto update has affected the voice recognition part.
Anyone has the same problem? Any help is appreciated.
Edit 08/09/2016
What I have tried:
Factory reset of my mobile phone
Building the app with different Android API levels
Uninstalling all updates to Google App, and disabling it
However, none worked.

Android BluetoothSocket.connect ask for pairing code every time

I'm trying to build a bluetooth connection between a phone and a sensor.
I have two Galaxy S3. My code works fine on one of them, but for the other, my code will always pause at the call mSocket.connect(), asking for the pairing code every time even if I have already paired the sensor with the phone in the Settings->Bluetooth
Please help!
Thanks!
Jake
I have figured this out. It's because one of my Galaxy phone is in Android 4.04 and the other is in 4.1. Update the Android version will do the trick.

Wrong password issue in Samsung Galaxy SII

I am developing one SIP based application to make and receive a call.I have used shared preference to store the all the registration related data like user-name,password,context etc.This data are also stored in A2billing.And i have used Asterisk Realtime to register sip user in application.
The main issue is that when i am running my application it works fine in all the other devices except Samsung Galaxy S2. On this device SIP user is not get registered and on asterisk console it gives me a error of Wrong password.
I cant configure what the actually issue is because its runs perfectly on other devices except galaxy SII(4.0.3).currently i have tried with HTC phones and galaxy SII(2.3.6) and it worked fine
If you have any idea and suggestion regarding this please share with me so i can workaround with this.
Thanks in Advance
Solved:
Finally the problem is solved when i uninstalled the Avast Antivirus from the device. i think Avast was causing a problem while accessing the data from sharedPrefrences don't know why. yeah but now i need to searched about that about, how do we avoid this kind of problems.
Are you using the native Android SIP stack or your own, linked in your app? If you are using the native one, might be a bug in the firmware. Debug your app and check if it is reading/writing the proper password. Then capture traffic with Wireshark, etc. and check what exactly is being sent over the wire(less). Then compare with traffic from other devices that work. Rinse and repeat until you pinpoint whose fault the error is.

NetlinkListener and NetlinkEvent error messages

My application does not break during Runtime. However, the following error messages always show up
NetlinkListener: ignoring non-kernel netlink multicast message
NetlinkEvent: NetlinkEvent::FindParam(): Parameter 'UDEV_LOG' not found
The app I'm developing uses sockets to receive packages from a specific IP source (with specific enabled port number). I set up a set of Log outputs (I even tried 'System.out.println' calls) to verify the data flow and everything seems to be fine.
Can anyone tell me what those errors messages are exactly related to?
The device I'm using for testing purposes is a Motorola Atrix 4G (MB860) with the latest OTA update (Android 2.3.6). Because of compatibility issues, all the development we do have to be done using API 8 (or earlier).
Having the same issue, it's a bug on 2.3.6, reported on Motorola and Android.
Link to Android bug report.
In the bug report, I added the info for my phone plus the search I did on the forums. If anyone has the same issue please add a star and/or comment to make them know that the issue exists and it's not related to only one country/cell provider.
It seems to be something else on the Atrix. I have an Atrix and looking at LogCat those errors come out a lot, so its not your app.
After I rooted my Atrix phone I noticed this problem. Logcat outputs it constantly :(

Android 2.3 vs 2.2.1 Bluetooth

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.

Categories

Resources