I recently started making a android app with c#(xamarin) and my goal was to send data to a database, I always got an error when connecting to the mysql server (server does not exist or connection refused).
Then I searched for a fix and realised that it was a bad idea to connect directly to the sql server.
My question is how do such simple "requests and responses" work?
And what is the best way to get data from a client to a database or server?
Sry if the question is makes no sense, until now I just worked with simple sql connections.
The proper way to do it, would be to create an API layer that will talk to the database and your app would talk to the API I recently did an app on Xamarin and used the following to build the API:
to secure the API's I'm using basic http authentication over SSL (although it's not preferebly but secures it in a simple way)
for the xmarain app, you can potentially use something like restsharp portable to talk the REST based API