Yes, You can.
Anda harus menambahkan pustaka jar untuk mysql. Kemudian kode java yang akan terhubung ke server mysql.
import java.sql.DriverManager;
import android.database.SQLException;
import com.mysql.jdbc.Connection;
import com.mysql.jdbc.ResultSet;
import com.mysql.jdbc.Statement;
public class SQLConnection {
public static Connection conn = null;
static void setConnection(String user,String pass,String urlServer,String dBase){
try
{
String userName = user;
String password = pass;
String url = "jdbc:mysql://"+urlServer+"/"+dBase;
Class.forName ("com.mysql.jdbc.Driver").newInstance ();
conn = DriverManager.getConnection (url, userName, password);
System.out.println ("Database connection established");
}
catch (Exception e)
{
System.err.println (e.getMessage());
}
finally
{
}
}
public static Connection getConnection(){
return conn;
}
}