title: How to connect Android to a database server
body: <p>Is there any sample? I have my android application and I need to connect to mysql server on my machine, what is the best way?</p>
  
  <p>I should not use jdbc, explanation here</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/2256082/best-way-to-implement-client-server-database-architecture-in-an-android-a">Best way to implement Client &lt;-&gt; Server &lt;-&gt; Database architecture in an Android application?</a></li>
  </ul>
  
  <blockquote>
    <p>Never never use a database driver across an Internet connection, for any database, for any platform, for any client, anywhere. That goes double for mobile. Database drivers are designed for LAN operations and are not designed for flaky/intermittent connections or high latency.</p>
  </blockquote>
  
  <p>And should go for:</p>
  
  <pre><code>DefaultHttpClient httpclient = new DefaultHttpClient(); 
  </code></pre>
  
  <p>But there is no example in how to open a connection or execute a simple sql statement.
  anyone could help me? </p>