Android Question USBSerial 2.4

DT1111

Member
Licensed User
Longtime User
The USBSerialDemo is running properly from my tablet and I was able to communicate with the external device.

upload_2016-3-16_18-18-25.png


But when I run the same USBSerialDemo on my Android box and plugged in the same device, I had the screen frozen and the camera snapshot as follows

upload_2016-3-16_18-21-16.png


The outputs are different and I could not decipher what might have caused the Android box to fail.

Both run on 4.4.2.

Any pointer is appreciated.

Thanks.
 

DT1111

Member
Licensed User
Longtime User
Thanks Erel.

Perhaps I should have also mentioned that when I plugged in the external device into the second device (Android box), it detected it and calls the USBSerialDemo app.

But maybe that is not an indication that the USB host feature is actually OK in the Android box? Or is it?
 
Upvote 0

DT1111

Member
Licensed User
Longtime User
Hi Erel

Tested felUSBSerial on the Android box and it crashed ie just disappeared off the screen when the connect button was pressed. The following is the output

B4X:
** Activity (main) Pause, UserClosed = false **
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
Error occurred on line: 50 (Main)
java.lang.RuntimeException: UsbDevice is not supported.
    at anywheresoftware.b4a.objects.usb.felUsbSerial.Initialize2(felUsbSerial.java:71)
    at anywheresoftware.b4a.objects.usb.felUsbSerial.Initialize(felUsbSerial.java:54)
    at b4a.example.main._btnconnect_click(main.java:415)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:697)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:336)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:246)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:157)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
    at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:78)
    at android.view.View.performClick(View.java:4438)
    at android.view.View$PerformClick.run(View.java:18422)
    at android.os.Handler.handleCallback(Handler.java:733)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:136)
    at android.app.ActivityThread.main(ActivityThread.java:5017)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:788)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:604)
    at dalvik.system.NativeStart.main(Native Method)
** Activity (main) Pause, UserClosed = true **
** Activity (main) Resume **
GC_CONCURRENT freed 398K, 23% free 2008K/2588K, paused 10ms+8ms, total 91ms

Line 50 is
B4X:
usbserial.Initialize("serial", device, -1)

I have used the USB to USB OTG adapter to connect to Android box and without and in both cases it didn't work. Any suggestion what could be done to the Android box?

felUSBSerial worked well with the tablet though.

Thanks.
 
Upvote 0

DT1111

Member
Licensed User
Longtime User
Sorry Erel but I have more questions.

I assume ROM means new firmware? If it is then the manufacturer may be able to assist.
Or it is something that is freely available from Githubs etc?

What is the ROM for? Is it to enable rooting or USB hosting capability?

Any guidance would be most helpful.

Thanks.
 
Upvote 0
Top