Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Android connect directly to MySQL without PHP?

Tags:

android

php

mysql

  1. I want to connect to MySQL remote database from android but I don't want to send request to php, I want a straight connection to MySQL without making request to php, so in my opinion it will be more fast and I will get everything i need from mysql remote db table, but as far as I google only tutorials on how to connect through request to php. Is it even possible to do what I want?
  2. If the first one isn't possible, could Android have local database SQLite in which straight away in android code I can wire queries to that db, but is it possible to write queries inside android code to remote mysql database?
like image 698
Vladimir Arevshatyan Avatar asked Mar 14 '15 06:03

Vladimir Arevshatyan


2 Answers

It is strongly recommended that you don't do this.

See this post: Direct insert data in mysql data in android

... and this post: Why should a developer use web services instead of direct connections to a db?

Edit: The comment from @halfer is very informative, so quoting it here:

In practice, you will always need more security controls than MySQL will give you - hence the need for a server-side layer. If it gets slow then you can optimise your queries or upgrade your hardware (but don't optimise unless you need to).

like image 89
Daniel Nugent Avatar answered Oct 19 '22 17:10

Daniel Nugent


1. Yes, it is possible. I use Delphi XE5 FMX and MyDAC from DEVART.

like image 42
Dan Avatar answered Oct 19 '22 17:10

Dan