I only have one video stream of 30 FPS to send over a TCP socket and it's sending a lot of data through my router. Everything just lags I can't even display the image.Is there a way to improve my code?            master.frame_drone.Bitmap.Save(ms,ImageFormat.Bmp);            byte[] barray = new byte[ms.Length];            string string_master_frame = System.Text.Encoding.Default.GetString(barray, 0, barray.Length);            data = string_master_frame + \n;            data = data.Substring(0, data.Length - 2);            tcpServer1.Send(data);Around 700,000 bytes are sent via the socket and the client just lags a lot.            while(true) {                Scanner r = new Scanner(new InputStreamReader(socket.getInputStream()));                valores[26] = r.nextLine();                publishProgress(valores[26]);            }    }@Overrideprotected void onProgressUpdate(String... values) {    super.onProgressUpdate(values);   Bitmap master_bitmap = BitmapFactory.decodeByteArray(valores[26].getBytes(),0,valores[26].length());    master_frame.setImageBitmap(master_bitmap);    }I removed some code to be easier to read. I'm sending 25 strings and 1 image.
Sending an image from a server to a client over a TCP socket
java;android;image;socket