开发者

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

开发者 https://www.devze.com 2023-04-12 19:28 出处:网络
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#?

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");


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


Start here: Android USB Api

0

精彩评论

暂无评论...
验证码 换一张
取 消