0

I want to access my Mysql-Database in the App I want to share in the PlayStore later. But what is the best way to connect to this DB? I use JDBC because it is very easy and I do not need any other things like PHP-scripts.

But if I use JDBC in my App I have to give this API the Credentials like DB-URL, username and password. If anyone would decompile the App he could see this credentials. So i wonder how you would connect safe to a DB via Android Apps. Do i need to do it via PHP-Scripts which are on the server?

Thank you

Benjamin Wolf
  • 93
  • 1
  • 9

1 Answers1

3

For security reasons i would not access a database without a server, because i dont like the idea of having the database directly connected to the internet. Especially if you release your app in the stores.

Like you already said, create a application server and let that server query data and send it to your phones. You can use JDBC too.

That way other people are not able to break into your database.

It's technically possible thought. android jdbc

Wagner Michael
  • 2,172
  • 1
  • 15
  • 29
  • Is it recommended to use PHP or is PHP not a really good alternative to an own server which communicates with the DB via JDBC? – Benjamin Wolf Jan 19 '15 at 14:57
  • PHP does also require a own server -> webserver. But of course its also a nice alternative. This depends on you i guess. If you are familliar enough with PHP -> go with it. – Wagner Michael Jan 19 '15 at 17:43