title: How to send and receive image through using ServerSocket Service?
body: <p>I am trying to sending and receiving image to display in <code>ImageView</code> using Server-socket, I want to decrypt image using server-socket but its not working.</p>
  
  <p>Image url like this :</p>
  
  <pre><code>http://localhost:4545/sdcard0/emulated/test.img;
  </code></pre>
  
  <p>Service :</p>
  
  <pre><code>public class ImageDecrptService extends Service {
  
      private ServerSocket serverSocket;
      private Socket socket;
  
      void acceptRequestNDecryptFile() {
          try {
              try {
                  serverSocket = new ServerSocket(4545);
              } catch (Exception e) {
              }
  
              while (true) {
                  Log.e("", "thread called true");
                  socket = serverSocket.accept();
                  //some thing code
              }
          } catch (Exception e) {
              e.printStackTrace();
          } finally {
              try {
                  serverSocket.close();
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
      }
  
      @Override
      public IBinder onBind(Intent intent) {
          return null;
      }
  
      Thread thread = new Thread(new Runnable() {
          @Override
          public void run() {
              try {
                  acceptRequestNDecryptFile();
                  Log.e("", "thread called ");
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
      });
  
      @Override
      public void onCreate() {
          super.onCreate();
          try {
              thread.start();
          } catch (Exception e) {
              e.printStackTrace();
          }
      }
  
      @Override
      public int onStartCommand(Intent intent, int flags, int startId) {
          return START_STICKY;
      }
  
  }
  </code></pre>
  
  <p>How can pass image url to server socket?</p>
  
  <p>Note : I do not want use Bitmap to display image.</p>