How can i send data by USB port in Android C#?

感情迁移 提交于 2020-01-07 02:04:32

问题


I am developed a app in Visual Studio with mono for android. C#

So. How can i send data by USB port in Android. C#?

The type serialPort1.Write("1");


回答1:


Long story short - you can not do it the way you intended. USB is not a serial port that you can just write to and data comes out on the other side.

Serial ports can be emulated over USB, but Android does not support that. Android typically can act as device that offers different profiles: disk, camera and proprietary debug (if enabled on device).

Since Android 3.1 you also have two special modes: host mode where Android device acts as a host to usb devices (much like PC does) and special proprietary accessory mode. Read more about it here: http://developer.android.com/guide/topics/usb/index.html




回答2:


Start here: Android USB Api



来源:https://stackoverflow.com/questions/7728818/how-can-i-send-data-by-usb-port-in-android-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!