I have an online mysql database. I understand that to connect to it from an android app, I need to use a REST web service. From what I understood until now is that I have to use a REST webservice + JSON and Jquery to handle everything. But the things that I dont understand are:
You're confusing database access, server side code and REST.
It is best practice not to go around directly connecting to databases from a client, especially a "locationally diverse" one.
Your architecture may look like
Android app ---HTTPS REST Verbs---> RESTful Webservices on server, hosed on Apache, Tomcat etc. --- Data access, be it via PDO, JDBC, JPA, whatever ---> mySQL.
The RESTful part really is optional, you can call into whatever you like if you're using an URL.