Properly encoding percent sign (%) in Apachi Http Client form post using UrlEncode
<p>This seems like an extremely easy problem but alas I cannot figure it out nor find a solution anywhere else. I'm concatenating a string that has a % within and for some reason it adds the number 25 after the %. Anyone know of a solution to this easy problem?</p>

<pre><code>String buttonCheck = "%26" + DATABASE.getValue("buttonCheck") + "%26";
</code></pre>

<p>Comes out to</p>

<pre><code>"%2526value%2526"
</code></pre>

<p>EDIT: It has become apparent that the issue is actually within URL encoding and I will add more relevant data to the issue.</p>

<p>I am developing an Android App that parses HTML from a site and allows the user to interact with it through the Android UI. I am having an issue with encoding % into a parameter for a form.</p>

<pre><code>public class CLASS extends Activity
{
     DefaultHttpClient client = new DefaultHttpClient;
     String url = "http://www.url.com"
     HttpRequestBase method = new HttpPost(url);
     List&lt;NameValuePair&gt; nvps = new ArrayList&lt;NameValuePair&gt;();
     nvps.add("buttoncheck", "%26" + DATABASE.getValue("buttonCheck") + "%26");
     //DATABASE is simply a class that handles a HashMap

     HttpPost methodPost = (HttpPost) method;
     methodPost.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));
     execute(method);
}
</code></pre>

<p>Rather than sending the form value of</p>

<pre><code>buttoncheck=%26value%26
</code></pre>

<p>I get</p>

<pre><code>buttoncheck=%2526value%2526
</code></pre>
