Android BLE scanning - java

O/S Android 11.
I have developed an application with BLE scanning. It does not do any connection to BLE devices. It just get list of near by devices. App works fine. I can see following error registered in the Logcat each time I stop and start the scan. Can any one please tell me what is wrong.
E/BtGatt.GattService: [GSIM LOG]: gsimLogHandler, msg: MESSAGE_SCAN_START, appName: com.ttt.ttt.vctap, scannerId: 11, reportDelayMillis=0
E/BtGatt.GattService: [GSIM LOG]: gsimLogHandler, msg: MESSAGE_SCAN_STOP, appName:com.ttt.ttt.vctap, scannerId: 11, reportDelayMillis=0

The two log lines in the question:
E/BtGatt.GattService: [GSIM LOG]: gsimLogHandler, msg: MESSAGE_SCAN_START, appName: com.ttt.ttt.vctap, scannerId: 11, reportDelayMillis=0
E/BtGatt.GattService: [GSIM LOG]: gsimLogHandler, msg: MESSAGE_SCAN_STOP, appName:com.ttt.ttt.vctap, scannerId: 11, reportDelayMillis=0
do not indicate any error. They indicate normal operation.
These log lines are specific to Samsung devices. They indicate that the Android app with applicationId com.ttt.ttt.vctap has started a BLE scan (first line). The second log line indicates that the scan has been stopped.

Try these, after doing this I managed it to work (not everytime but yes)
Steps:
Bluetooth data clear from system app
Reset Bluetooth data (network settings)
https://youtu.be/eGNKTeS_iDg

Related

Debugger disconnect seconds after reach breakpoint

When I am debugging an application running in my phone device, the debugger is always disconnected 30 seconds after reach a breakpoint. The error message is:
E ANR in com.plm.myapptest
PID: 14911
Reason: Changing to new focus window timeout
Frozen: false
Load: 22.06 / 22.39 / 22.73
----- Output from /proc/pressure/memory -----
some avg10=0.26 avg60=0.13 avg300=0.06 total=1119102705
full avg10=0.12 avg60=0.05 avg300=0.01 total=532509077
The issue not happen running the app in software emulator.
My phone device is Realme 7 running Android 12 and my IDE is Android Studio Electric Eel | 2022.1.1 Build #AI-221.6008.13.2211.9477386, built on January 11, 2023 Runtime version: 11.0.15+0-b2043.56-8887301 amd64
The error message 'Changing to new focus window timeout' not appears in google searchs and in my opinion has not sense. A debug window should take window focus the time that the developer needs. Is there a parameter in amdroid SO to configure this timeout?

About abnormal termination when upgrading the targetSdkVersion from API 30 to 31 while waiting for an alarm on the Android 12 emulator

Put the setAlarmClock of the Android11 (API30) target resource on standby in the Android Emulator of Android12 (API31).
Close the app.
Upgrade to Android12 (API31) target resource.
java.lang.RuntimeException: Unable to start receiver com.xxx.xxx.AlarmReceiver: android.app.ForegroundServiceStartNotAllowedException: startForegroundService() not allowed due to mAllowStartForeground false: service com.xxx.xxx/.AlarmService
The above error occurs.
It operates normally when the above conditions are not met.
Below is the source.
am.setAlarmClock(new AlarmManager.AlarmClockInfo(alarmRun, showIntent1), pendingIntent2);
Receiver
context.startForegroundService(new Intent(context, AlarmService.class));
Is it a bug in the Android Emulator?
Will the situation be the same on the actual machine?
I can't test because I don't own the actual Android 12.

Android Studio debug native code lldb server work infinity

I have Android app which are writed use Java and C++/JNI code. My C++/JNI part work bad. I want to debug native code.
I work in Android Studio.
I did all step which take official site
enter link description here
But when I start debug I see line
Starting LLDB server
And he does not finish. I wait 30 min but he does not finish.
What I must to do. Because I think this bug or I must to take some settings.
I found error. But I did not understand. When I test app from USB cable all work good. But when I want to test my app through wifi (I use Android Wifi ADB) LLDB Debug server start, but not attach to process.
If I debug java code use java debugger all work good.
All output in debug console:
Connecting to org.temp.test
Waiting for application to start debug server
Waiting for application to come online: org.temp.test.test | org.temp.test
Connecting to org.temp.test
Now Launching Native Debug Session
Starting LLDB server: /data/data/org.temp.test/lldb/bin/start_lldb_server.sh /data/data/org.temp.test/lldb unix-abstract /data/data/org.temp.test/lldb/tmp platform-1524470360668.sock "lldb process:gdb-remote packets"

Android (Processing3) Java: "Lost connection while installing device"

I'm using processing 3, and I have been having trouble getting AndroidMode to work. I was asking questions, on their official forums, but they got to the point they just said "Google it".
I keep getting:
"Lost connection while installing device" and:
-post-build:
debug: Failure [INSTALL_FAILED_DEXOPT] Shutting down any existing adb
server...
Sometimes the error output is different, but it always loses connection.
(And I've tried it with the examples, and anything no matter what code you type it fails)

Error overflow reading serial number of USB device

I'm trying to read the serial number of a device using javax usb library,
and I'm getting this error :
[javax.usb.UsbPlatformException: USB error 8: Unable to get string descriptor languages: Overflow]
The line is simply :
device.getUsbStringDescriptor(descript.iManufacturer());
Someone already had this error ?
Thanks,
I had this error because I hadn't the right driver on a CDC device.
With the Zadig application http://zadig.akeo.ie/
I could install the WINUSB driver on my device.
And this worked fine on a Microchip Demo Board.
Yet the exception remained on my own prototype board. The VUSB connection was not correct.This works fine correctly now in the power-off mode (i.e. the power is not provided by the USB)

Categories

Resources