title: How to send data to ESP8266?
body: <p>I want to send data to ESP8266 to work with my motors. I just need send string 00 or 10 or 01 it depends what button I will press. So it have to look like this: <a href="http://ipaddress:port/00" rel="nofollow noreferrer">http://ipaddress:port/00</a>
  So I found this code. I changed it so it can work with my program.
  So I install app to my phone and I connect to ESP8266´s hotspot. Then I send(click on button) the value(00 or 10 or 01). The Esp receive this string. BUT when I want click second button(to change string) it WILL NOT send it. The code is stuck and I thing it is waiting for response or something like that. But I don´t want resposne from my Arduino(ESP8266) I just want send datas imadiately...</p>
  
  <pre><code>View.OnClickListener btnSetClickListener = new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              String value;
              if (view== btnSet) {
                 value = "/10";
              } else if(view == btnMinus) {
                  value = "/01";
              } else {
                  value = "/00";
              }
              Toast.makeText(SettingsActivity.this, "OnClick", Toast.LENGTH_LONG).show();
              String PORT = editPort.getText().toString();
              String serverIP = editIp.getText().toString() + ":" + PORT + value;
              textInfo1.setText(serverIP);
  
              TaskEsp taskEsp = new TaskEsp(serverIP);
              taskEsp.execute();
  
  private class TaskEsp extends AsyncTask&lt;Void, Void, String&gt; {
  
      String server;
  
      TaskEsp(String server){
          this.server = server;
      }
  
      @Override
      protected String doInBackground(Void... params) {
  
          final String p = "http://"+server;
  
          runOnUiThread(new Runnable(){
              @Override
              public void run() {
                  textInfo1.setText(p);
              }
          });
  
          String serverResponse = "";
          String port = null;
          //HttpURLConnection httpURLConnection = p;
  
          try {
  
  
              HttpURLConnection httpURLConnection = (HttpURLConnection) (new URL(p).openConnection());
              if(httpURLConnection.getResponseCode() == HttpURLConnection.HTTP_OK) {
              runOnUiThread(new Runnable(){
                  @Override
                  public void run() {
                      textView.setText("Try");
                  }
              });
                  InputStream inputStream = null;
                  inputStream = httpURLConnection.getInputStream();
                  BufferedReader bufferedReader =
                          new BufferedReader(new InputStreamReader(inputStream));
                  serverResponse = bufferedReader.readLine();
                  httpURLConnection.disconnect();
                  inputStream.close();
          }
          catch (MalformedURLException e) {
              e.printStackTrace();
              serverResponse = e.getMessage();
          } catch (IOException e) {
              e.printStackTrace();
              serverResponse = e.getMessage();
          }
          runOnUiThread(new Runnable(){
              @Override
              public void run() {
                  textView.setText("return");
              }
          });
          return serverResponse;
      }
  
      @Override
      protected void onPostExecute(String s) {
          textInfo2.setText(s);
          textView.setText("PostExc");
      }
  }
  </code></pre>