Getting a String return value from Server using HttpClient
<p>I have this method below which sends data to the web server. It works properly. 
After I do the Http Post, the server will give me a String return value.</p>

<p>My questions are:</p>

<ul>
<li>How am I able to retrieve the String using the method I have below? </li>
<li>The return String value will look like this "http://xxxxxx 12345". So it contains a URL and an ID, separated by one single space " ". How am I able to seperate them both into 2 String values? one should be the URL and the other one should be the ID.</li>
</ul>

<p>Can anybody help me improving my code with the requirements I've mentioned above?</p>

<p>Thank you very much</p>

<pre><code>public void postData() {
            // Create a new HttpClient and Post Header
            HttpClient httpclient = new DefaultHttpClient();
            HttpPost httppost = new HttpPost("http://xxxx.net/admanager/mobileApps/initDonation");

            try {
                // Add your data
                List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(1);
                String amount = paymentAmount.getText().toString();
                String email = inputEmail.getText().toString();
                int i = Integer.parseInt(amount);
                int cent = i * 100;

                Bundle extras = getIntent().getExtras();  
                String campaign_id = extras.getString("campaign_id");
                String currency = extras.getString("currency");

                nameValuePairs.add(new BasicNameValuePair("donationAmount", Integer.toString(cent)));
                nameValuePairs.add(new BasicNameValuePair("email", email));
                nameValuePairs.add(new BasicNameValuePair("campaignId", campaign_id));
                nameValuePairs.add(new BasicNameValuePair("currency", currency));
                nameValuePairs.add(new BasicNameValuePair("paymentMethod", Integer.toString(5)));
                httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));

                // Execute HTTP Post Request
                HttpResponse response = httpclient.execute(httppost);


            } catch (ClientProtocolException e) {
                // TODO Auto-generated catch block
            } catch (IOException e) {
                // TODO Auto-generated catch block
            }
        } 
</code></pre>
