title: Android socket run in gingerbread but not in jelly bean
body: <p>From this code i can transfer files with my PC in android 2.3.3.(Dell Streak) but when I Run the same code in android 4.2 (Samsung GS 3 ) It does nothing. I think the problem is when the Socket is to initialize ? What I have to do this get working in 4.2?</p>
  
  <pre><code>package com.hrandika.synchronizer.serverClient;
  
  import java.io.BufferedInputStream;
  import java.io.BufferedReader;
  import java.io.File;
  import java.io.FileInputStream;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.io.OutputStream;
  import java.io.OutputStreamWriter;
  import java.net.Socket;
  
  import android.os.AsyncTask;
  import android.util.Log;
  
  public class Client {
  
  File sendingFile;
  
  public Client(File sendingFile) {
      Log.d("Client", "Cleint : Constructed");
      this.sendingFile = sendingFile;
  }
  
  public void send(String ip) {
      try {
          Log.d("Client", "Cleint stating ....");
          Socket socket = new Socket(ip, 5555);
          Log.d("Client", "Cleint Socket Okay");
  
          OutputStream outputStream = socket.getOutputStream();
          OutputStreamWriter outputStreamWriter = new OutputStreamWriter(
                  outputStream);
  
          Log.d("Client", "Cleint ready to sent");
          outputStreamWriter.write(sendingFile.getName() + "\n");
          outputStreamWriter.flush();
          Log.d("Client", "Cleint Sent");
  
          InputStream inputStream = socket.getInputStream();
          InputStreamReader inputStreamReader = new InputStreamReader(
                  inputStream);
  
          BufferedReader bufferedReader = new BufferedReader(
                  inputStreamReader);
  
          String serverResponse = bufferedReader.readLine();
  
          if (serverResponse.equals("READY")) {
              Log.d("Client", "Cleint : server ready");
  
              byte[] buffer = new byte[(int) sendingFile.length()];
              FileInputStream fileInputStream = new FileInputStream(
                      sendingFile);
              BufferedInputStream bufferedInputStream = new   BufferedInputStream(
                      fileInputStream);
              bufferedInputStream.read(buffer, 0, buffer.length);
              outputStream.write(buffer, 0, buffer.length);
  
              outputStream.flush();
              bufferedInputStream.close();
              fileInputStream.close();
              socket.close();
  
          }
  
      } catch (Exception e) {
      }
  }
  
  
  
  public class Sender extends AsyncTask&lt;String, String, String&gt;{
  
      @Override
      protected String doInBackground(String... params) {
          send("192.168.43.21");
          return null;
      }
  
  } 
  } // End class Client
  </code></pre>