I'm building an android app where there's a requirement to show the temperature in the app from the sensor in Raspberry Pi Controller. For this purpose, I'm trying to connect my android device to Raspberry Pi through USB. So the idea is I can send command to controller where it can send the temperature data back to the app.
I've created a Broadcast Receiver with permission <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"/>
But the problem is, when I connect the android device to the controller. This event is not firing at all.
I'm using Type C Usb Cable and Android 11 Samsung device and my Pi Model is Raspberry Pi 3 Model B Rev 1.2.
Do I've to change any settings in Pi or install any drivers in Pi ? Any other solutions except Socket over Wifi.