2

I've heard a lot of times that it was not recommended to use JDBC driver in an android application but I've never really seen a real argument.

Actually, i'm developping an android application which uses a MySql database and everything is working.

Would it be better to create a webservice rest which would access to my database instead of my android application ?

Kyoros
  • 173
  • 2
  • 2
  • 8

1 Answers1

5

The problem with JDBC is that it requires a very stable connection and high bandwidth - two things which definitely are not guaranteed on mobile devices. You're absolutely correct - it would be much better to create a web service.

Updated

A web service has the added benefit of being more secure since you don't leave your database open to attackers, as well being more versatile - so if you in the future want to access it from elsewhere you won't have to write a specific implementation for iOS, WindowsPhone (or a good ol' fashioned website).

Another good reason is that doing work client side on phones can be a heavy operation which is a drain on the system resources (and battery). On modern phones, it might not be noticeable, but can be hugely beneficial to the user experience, especially on older models. There's nothing that kills the user experience more than when it feels "sluggish".

Community
  • 1
  • 1
Tobias Roland
  • 1,182
  • 1
  • 13
  • 35