I am working on the USB serial. I want to make a Nexus to read data from USB.
I found the example project to do it. here
So, I cloned the project and complied with eclipse. Everything works well. I can install and run my app. The app can find my USB when it is plugged to Nexus by using intent.
However, I cannot read and write data. The code is following :
protected void onResume() {
super.onResume();
mSerialDevice = UsbSerialProber.acquire(mUsbManager);
Log.d(TAG, "Resumed, mSerialDevice=" + mSerialDevice);
if (mSerialDevice == null) {
mTitleTextView.setText(String.valueOf(mSerialDevice));
}
else{
...
...
}
....
}
I read all the code. I found that the "mSerialDevice" is always null. Actually, the else loop is put an instruction to read data. I tried to debug but I cannot find any reasons why it is null. I need you help.. :(
Thank in advance !