title: MySQL Database not connecting to Android app
body: <p>My database is running fine because I tested it using Eclipse with simple Java code that just connects and reports back success or fail. I connect fine....I can even read and write to it there.</p>
  
  <p>Now, when I try to do the same thing in Android Studio,the connection fails. I am on the same WiFi network. </p>
  
  <p>I created a lib folder for the app and put all the extra .jar files there including the JDBC connector for MySQL that I used in Eclipse. I also went to the build.gradel file and added the line: </p>
  
  <pre><code>compile files('libs/mysql-connector-java-5.1.34-bin.jar')
  </code></pre>
  
  <p>Do I need to make a PHP API for it to connect since right now I am trying to connect to it using this line: </p>
  
  <pre><code> connection = DriverManager.getConnection("jdbc:mysql://localhost:port/testdb", "user", "password");  
  </code></pre>
  
  <p>Any suggestions? </p>