I am writing an application for Android, messenger. I do this exclusively for the thesis, I will not release in production. Therefore, I do not implement encryption and generally do not think over security.

At the moment I have implemented all the functions I need, registration, login, add a friend, correspondence. But implemented it all with a local database. That is, when a person clicks the registration, he creates a new login-password entry in the SQLite database on the device. Also with login and correspondence, stored on the device.

I need to implement the registration and login on the server. That is, when the user clicks "register", a line with login and password is requested on the server with MySQL. If there is already one, then transfer the failure to the device, if not, then add these login and password.

Login implementation, similar scheme. If the login and password is in MySQL then we transfer that logged in. If not, we pass the failure.

Actually the question is how to make such registration and authorization on the server? There is an idea to make a php api. And through JSON send a request to the server. But how to get feedback? That is, how to get a response from the server on the device?

Maybe you have more simple and easy implementations of this functionality. Thank you in advance.

Closed due to the fact that it is necessary to reformulate the question so that it was possible to give an objectively correct answer by the participants of Suvitruf , torokhkun , BogolyubskiyAlexey , aleksandr barakin , Vladimir Glinskikh 2 Nov '15 at 12:42 .

The question gives rise to endless debates and discussions based not on knowledge, but on opinions. To get an answer, rephrase your question so that it can be given an unambiguously correct answer, or delete the question altogether. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • Google android http request. An example is more than full - Android Android
  • You do not know how to make a request to the Internet? - Vladyslav Matviienko

1 answer 1

If your server is implemented in PHP, use, for example, the OkHttp library, with which, by specifying the URL of your request, you will receive an answer, for example, in the form of the same JSON, and understand the application already. (There are good examples in this library)