title: Send data to HTTPservlet in android
body: <p>This is the servlet code in java ME.</p>
  
  <pre><code>protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      PrintWriter out = response.getWriter();
  
      ArrayList&lt;String&gt; listName = new ArrayList&lt;String&gt;();
      ArrayList&lt;Integer&gt; listLongitude = new ArrayList&lt;Integer&gt;();
      ArrayList&lt;Integer&gt; listLatitude = new ArrayList&lt;Integer&gt;();
  
      String sLongitude = (String) request.getParameter("x");
      String sLatitude = (String) request.getParameter("y");
      String path, list, scount;
      Integer numLong = null;
      Integer numLati = null;
      Connection con = null;
      String slanje = "";
      int limitLeft, limitRight, limitUp, limitDown, icount = 0;
  
      if (sLongitude != null &amp;&amp; sLatitude != null) {
          try {
              numLong = Integer.valueOf(sLongitude);
              numLati = Integer.valueOf(sLatitude);
          } catch(Exception ex) {}
      }
  
      try{
          Class.forName("org.apache.derby.jdbc.ClientDriver");
          con = DriverManager.getConnection("jdbc:derby://localhost:1527/bazaprojekt", "projekt2009", "midlet");
          limitLeft = numLong - 8;
          limitRight = numLong + 8;
          limitUp = numLati + 8;
  
          ...
  </code></pre>
  
  <p>How do I send x and y to servlet and receive some string in Android?</p>