Answer the question
In order to leave comments, you need to log in
Serial port how to work?
Hello. Tell me please. There is an Android 4.4 device with a hardware Serial (Com) port. How can I work with this port, worked via UART
PeripheralManager manager = PeripheralManager.getInstance();
List<String> deviceList = manager.getUartDeviceList();
if (deviceList.isEmpty()) {
Log.i(TAG, "No UART port available on this device.");
} else {
Log.i(TAG, "List of available devices: " + deviceList);
}
7736-7736/com.example.user.test_com_app E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.user.test_com_app, PID: 7736
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/things/pio/PeripheralManager;
at com.example.user.test_com_app.TestComFragment$1.onClick(TestComFragment.java:45)
at android.view.View.performClick(View.java:6597)
at android.view.View.performClickInternal(View.java:6574)
at android.view.View.access$3100(View.java:778)
at android.view.View$PerformClick.run(View.java:25885)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question