title: Connect to php .htaccess with my application
body: <p>I've a locked php page (username and password) by .htaccess file.
  I try to connect to this php with my android application.</p>
  
  <p>I try this page here : <a href="https://stackoverflow.com/questions/22462890/connect-to-php-page-using-htaccess-with-android-application">Connect to php page using .htaccess with android application</a></p>
  
  <p>But it doesn't work..</p>
  
  <p>My code : </p>
  
  <pre><code>HttpClient cnxHttp = new DefaultHttpClient();
  HttpPost paramCnx = new HttpPost(strings[0]);
  paramCnx.setHeader("Authorization", "Basic " +  new Base64().encodeToString("user:mdp".getBytes("UTF-8"), Base64.DEFAULT));
  </code></pre>
  
  <p>I get an error en getBytes : UnsupportedEncodingException.
  I don't understand why, can somoene explain to me and give me the right code ?</p>