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.
精彩评论