title: Android: client-server, user authentication
body: <p>I have never built any such Android Application which will communicate with the sever. What I want to do is I want to send username and password to the server, match them on server and when the username and password matches next screen should be shown. Next screen should have only one text view saying "Welcome username".</p>
  
  <p>I want you guys to tell me <strong>step by step guide</strong> for - </p>
  
  <ol>
  <li>What should I write in the Android App?</li>
  <li>What should I write on server side?</li>
  <li>How and where to write server code?</li>
  <li>Which language should I use for server side?</li>
  <li>How to save several usernames-passwords on the server?</li>
  </ol>
  
  <p>I don't have real server. I will run the entire code on localhost.</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>This is what I wrote in my Android app. I don't know how much is correct.</p>
  
  <pre><code>public void clicked(View v) {
      System.out.println("button clicked");
      EditText username = (EditText) findViewById(R.id.edituser);
      EditText password = (EditText) findViewById(R.id.editpass);
  
      Editable user = username.getText();
      Editable pass = password.getText();
  
      HttpClient httpclient = new DefaultHttpClient();
      HttpPost httppost = new HttpPost("http://192.168.1.101:8080//WebApplication1/sendresponse.java");
  
      try {
          // Add your data
          List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2);
          nameValuePairs.add(new BasicNameValuePair("username", user.toString()));
          nameValuePairs.add(new BasicNameValuePair("password", pass.toString()));
          httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
  
          // Execute HTTP Post Request
          HttpResponse response = httpclient.execute(httppost);
  
          Header[] headers = response.getAllHeaders();
          int len = headers.length;
          for(int i=0; i&lt;len; i++) {
              System.out.println("header : " + headers[i]);
          }
  
          InputStream inputStream = response.getEntity().getContent();
  
          InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
  
          BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
  
          StringBuilder stringBuilder = new StringBuilder();
  
          String bufferedStrChunk = null;
  
          while((bufferedStrChunk = bufferedReader.readLine()) != null){
              stringBuilder.append(bufferedStrChunk);
          }
          System.out.println("response : " + stringBuilder.toString());
  
      } catch (ClientProtocolException e) {
          // TODO Auto-generated catch block
      } catch (IOException e) {
          // TODO Auto-generated catch block
      }
  
  
  
  }
  </code></pre>
  
  <p>I don't know which language will be best for server side. Should I use REST on server side?</p>