开发者

How to send raw data from Android device to host?

I am trying to send some data (in the form of raw bytes ) from my device to host(connected through USB). What can be the different ways to do it ??

One idea is to write the raw bytes in one of the ring buffers (in /dev/log/) and let the logcat read it. But logcat expects the format开发者_StackOverflowted strings in ring buffers, Is there a way to modify the behavior of logcat ??

or is there a way to create a tcp connection between host and device to transfer the data???

Any other suggestions ??

Thanks.


adb forward is your friend. You can do port forwarding and then run TCP servers on either the host or the device.

EDIT: see http://developer.android.com/guide/developing/tools/adb.html#forwardports for more detail.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜