How to create application login screen

I have my own server for authenticate users. (users are previously created into that server). Now need to create an application login screen for my ODK application like magpi .It will appear Just after the splash screen.

In where, user will put his/her username and password into the application login screen and the username and password will post to a particular link of my server like : http://test.com/authenticate.php. My server will reply JSON like ( User ID & message ) :
{"success":"101","message":"Hello testuser. Your Login is successful!"}.
or for fail case
{"success":"0","message":"Login Failed! your login credentials is not ok !"}.

If login ok then it will goes to the main_menu .if login failed then it will stay in login screen.
How can i do it? Thanks in advance.

Android version: 3.6.2
Gradle version: 6.2.2
Application to server communication: JSON.