开发者

Receive and display JPG image through UDP

I am a beginner with Andoroid. I just create an UDP chanel and receive image package(1000bytes). But I have no idea h开发者_开发问答ow to display it. What should I do or refer to?


If you have access to the packet payload as a byte array you can create and Image instance from it. Code sample

EDIT:
If the image is sent in multiple packets you have to order them correctly. UDP headers has no info for ordering (and there is no guarantee that some won't get lost more info) so you have to provide your own ordering in the payload or switch to TCP.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜