Android HTTP Connection with Remote Database
<p>`  public void tryLogin() {
            Log.v(TAG, "Trying to Login");
            EditText etxt_user = (EditText) findViewById(R.id.txt_username);
            EditText etxt_pass = (EditText) findViewById(R.id.txt_password);
            String username = etxt_user.getText().toString();
            String password = etxt_pass.getText().toString(); 
            HttpClient client = new DefaultHttpClient();
            HttpPost httppost = new HttpPost("http://localhost:8084/authen/register.jsp");
            List&lt; BasicNameValuePair > nvps = new ArrayList&lt; BasicNameValuePair >();
            nvps.add(new BasicNameValuePair("username", username));
            nvps.add(new BasicNameValuePair("pass", password));
            try {
                  UrlEncodedFormEntity p_entity = new UrlEncodedFormEntity(nvps,"utf-8");</p>

<pre><code>              httppost.setEntity(p_entity);

              HttpResponse response = client.execute(httppost);
              Log.v(TAG, "Sahil Sahil Sahil");

              Log.v(TAG, response.getStatusLine().toString());
              HttpEntity responseEntity = response.getEntity();
              Log.v(TAG, "Set response to responseEntity");

              SAXParserFactory spf = SAXParserFactory.newInstance();
              SAXParser sp = spf.newSAXParser();
              XMLReader xr = sp.getXMLReader();
              LoginHandler myLoginHandler = new LoginHandler();

              xr.setContentHandler(myLoginHandler);
              xr.parse(retrieveInputStream(responseEntity));
              ParsedLoginDataSet parsedLoginDataSet = myLoginHandler.getParsedLoginData(); 
              if (parsedLoginDataSet.getExtractedString().equals("SUCCESS")) {
                    // Store the username and password in SharedPreferences after the successful login
                    SharedPreferences.Editor editor=mPreferences.edit();
                    editor.putString("UserName", username);
                    editor.putString("PassWord", password);
                    editor.commit();
                    Message myMessage=new Message();
                    myMessage.obj="SUCCESS";
                    handler.sendMessage(myMessage); 
              } else if(parsedLoginDataSet.getExtractedString().equals("ERROR")) { 
                    Intent intent = new Intent(getApplicationContext(), LoginError.class);
                    intent.putExtra("LoginMessage", parsedLoginDataSet.getMessage());
                    startActivity(intent); 
                    removeDialog(0);
              } 
        } catch (Exception e) 
        { 
              Intent intent = new Intent(getApplicationContext(), LoginError.class);
              intent.putExtra("LoginMessage", "Unable to login");
              startActivity(intent);
              removeDialog(0);
        } `
</code></pre>

<p>I am having an Android Activity which I want to connect with MYSql database with JSP page as middle layer to accept values from android and do query on databse. 
Problem is I'm not able to send parameter values from Android Activity to JSP page. Application crashes as Emulator starts. I have given permission for internet in manifest file,This catches exception plz help...</p>
