Android SQL Connection with JDBC

The problem i encountered was making a connection between an Android device and a SQL server. Theres 2 approaches i found.

  • Creating a web service for communication between the app and the server
  • Using JDBC to create a communication between the app and the server

I ended up using JDBC. So far its pretty straight forward. I created one class to help the connection and one to get the data. So far it looks solid but needs some testing.

I learned about “StrictMode.ThreadPolicy” “try-catch” a lot. I realized that i got the habit for creating as many exceptions i can to ensure easiest debugging in a bad situation, which is a good habit in my opinion.Overall im quite happy about the progress i made.

Yorum bırakın