Closed UnisonControls closed 4 years ago
MOTO G5 with Android 8, Redmi Note 9 pro with Android 10
These devices are not running Android Things, and do not have the necessary libraries to work with UART. Those devices will be unable to run this sample.
Can you please tell me which devices can support android things? We want to make universal app to send and receive data using OTG. Please find attachment for getting clear concept of our project need. Also let me know the error present due to android things activity not support? Is there any solution available to run this project in any device? (our targeted sdk is lolipop version and all higher version of android)
Hi,
Thanks for the clarification and supported links. But right now we are not using any RTOS system as mentioned on your comment links.
We want to make Universal Android device app which can send UART commands to any microcontroller using OTG or data cable or charging cable. Please find attached block diagram on previous comment.
Is it possible to send UART command from android app?
Feel free to ask if you have any query.
The peripheral I/O APIs, such as for UART, are part of the Things Support Library. This library does not exist on any standard Android device, it only exists on the supported hardware I linked to in my previous comment.
The Things Support Library is not third-party library code that you build into your app. It is part of the operating system image and it is linked at runtime, the same as the regular Android APIs are linked at runtime, therefore it is not available on any other hardware. That is why you get the java.lang.NoClassDefFoundError
when you try to use these APIs on a phone.
If you are using a USB cable, perhaps you can try the USB APIs to send data.
Dear all,
We are trying to communicate android device to dsPIC series MCU using PL2303 USB to Uart converter. We check all hardware on windows and linux PC and it is working ok.
We just download this sample source code for JAVA language and open it in linux pc where android studio 4.0 with gradle version 6.1 are available. We connect physical device (MOTO G5 with Android 8, Redmi Note 9 pro with Android 10) on PC USB and run app from android studio both both device individually. But both time we got same error as mentioned below.
To resolve this issue we tried some google search where most common solution we found is as below link. [https://github.com/androidthings/new-project-template/issues/1]
After adding
android:required="false"
this line in AndroidManifest.xml file we are able to run app on device. But whenever we open app on device app got forced stop and showing below error logcat. consollog.txtWe would link to overcome with this problem ASAP.
Waiting for your quick reply.
Thanks and Best Regards, Jehan Patel