ANDROID StringEntity fail inside eclipse
<p>Sorry about this simple(?) question but I'm a newbie on java and android.</p>

<p>First I have this import section.</p>

<pre><code>import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.view.View.OnClickListener;

import java.util.List;
import java.util.ArrayList; 

import java.io.InputStream;
import java.io.InputStreamReader;

import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.ResponseHandler;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.HttpResponse;
import org.apache.http.HttpEntity;
import org.apache.http.message.BasicNameValuePair;  
import org.apache.http.protocol.HTTP;
import org.apache.http.NameValuePair;
import org.apache.http.entity.*;
import org.apache.http.impl.client.BasicResponseHandler;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.entity.StringEntity;

import org.apache.http.client.entity.UrlEncodedFormEntity;  
</code></pre>

<p>Then I have this code.</p>

<pre><code>            String s = new String();
            // Handle successful scan

            HttpClient httpclient = new DefaultHttpClient();
            HttpPost httppost = new HttpPost(URL);

            s += "enter=&lt;eanrequest&gt;&lt;ean&gt;";
            s += contents;
            s += "&lt;/ean&gt;&lt;/eanrequest&gt;";             

        List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(1);   
            nameValuePairs.add(new BasicNameValuePair("enter", s));

            ean.setText(s);

            HttpEntity se = new StringEntity(s);  //When I hold the mouse over this I get "Unhandled exception type UnsupportedEncodingException".
</code></pre>

<p>What am I doing wrong?</p>

<p>/Erik</p>
