title: How to post data to a Webservice using JSON?
body: <p>I have to send the following data to webservice at URl</p>
  
  <p>The format of data to be send is:</p>
  
  <pre><code>new_member=[{"email":"himanshu@avigma.com","username":"himanshu01","pwd":"himanshu01"}]
  </code></pre>
  
  <p>where <code>email</code>,<code>username</code> and <code>pwd</code> is the key and has corresponding value string fetched through edittext string. I am posting this data on click of button.</p>
  
  <p>I am not getting any response bcoz i have tried to counter check this with my co developer in his iphone same app iphone version as the username and password is not valid is said by server.</p>
  
  <p>My <code>Signup.java</code> class is:</p>
  
  <pre><code>    Button b1=(Button)findViewById(R.id.button1);
      b1.setOnClickListener(new OnClickListener()
      {
          EditText e=(EditText)findViewById(R.id.editText1);
          String a=e.getText().toString();
          EditText e1=(EditText)findViewById(R.id.editText1);
          String b=e1.getText().toString();
          EditText e2=(EditText)findViewById(R.id.editText1);
          String c=e2.getText().toString();
          public void onClick(View v) {
              // TODO Auto-generated method stub
               HttpClient client = new DefaultHttpClient(); 
                  HttpConnectionParams.setConnectionTimeout(client.getParams(), 10000); //Timeout Limit 
                  HttpResponse response; 
                  JSONObject json = new JSONObject(); 
                  try{ 
                      HttpPost post = new HttpPost("URL"); 
                      //System.out.println(post);
                      json.put("email", a);
                      json.put("username", b);
                      json.put("pwd",c); 
                      StringEntity se = new StringEntity( "JSON: " + json.toString());   
                      se.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE, "application/json")); 
                      post.setEntity(se); 
                      response = client.execute(post); 
                      /*Checking response */ 
                      if(response!=null){ 
                          InputStream in = response.getEntity().getContent(); //Get the data in the entity 
   //System.out.println(response);
                  }
                  }
                  catch(Exception e){ 
                      e.printStackTrace(); 
                      System.out.println(e.toString());
                      //createDialog("Error", "Cannot Estabilish Connection"); 
                  } 
          }
  
      }
              );
  </code></pre>
  
  <p>Please assist me i am a newbie in JSON and parsing in Android.Thanx.</p>