I want to make a register/login app. I found a few examples but the most of this doesn't work for me. So I will do everything step by step. So first for the login I want to send the Server the username and the password of the user. So here is everything working, but as you can see I didn't send anything to the Server. So, where and how to send the "username" and "password" to the Server.
private void userLogin() {
username = usernameField.getText().toString().trim();
password = passwordField.getText().toString().trim();
RequestQueue queue = Volley.newRequestQueue(this);
// Request a string response from the provided URL.
StringRequest stringRequest = new StringRequest(Request.Method.GET, LOGIN_URL,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Toast toast = Toast.makeText(getApplicationContext(), (response), Toast.LENGTH_SHORT);
toast.show();
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Toast toast = Toast.makeText(getApplicationContext(), "Anything doesn't work!", Toast.LENGTH_SHORT);
toast.show();
}
});
// Add the request to the RequestQueue.
queue.add(stringRequest);
}