HttpParams is deprecated. What should I do? : <p>I'm trying to make a Login and register on my android app. I'm having trouble with HttpParams. I am following a tutorial on Youtube by Tonikami. I'm just new with Android Studio. This is just the process I know. Your help with be very appreciated. :(</p>

<pre><code>public class ServerRequests {
ProgressDialog progressDialog;
public static final int CONNECTION_TIMEOUT = 1000 * 15;
public static final String SERVER_ADDRESS = "http://mywebsite.com/";

public ServerRequests(Context context) {
    progressDialog = new ProgressDialog(context);
    progressDialog.setCancelable(false);
    progressDialog.setTitle("Processing...");
    progressDialog.setMessage("Please wait...");
}

public void storeUserDataInBackground(User user, GetUserCallback userCallBack) {
    progressDialog.show();
    new StoreUserDataAsyncTask(user, userCallBack).execute();
}

public void fetchUserDataAsyncTask(User user, GetUserCallback userCallBack) {
    progressDialog.show();
    new fetchUserDataAsyncTask(user, userCallBack).execute();
}

/**
 * parameter sent to task upon execution progress published during
 * background computation result of the background computation
 */

public class StoreUserDataAsyncTask extends AsyncTask&lt;Void, Void, Void&gt; {
    User user;
    GetUserCallback userCallBack;

    public StoreUserDataAsyncTask(User user, GetUserCallback userCallBack) {
        this.user = user;
        this.userCallBack = userCallBack;
    }

    @Override
    protected Void doInBackground(Void... params) {
        ArrayList&lt;NameValuePair&gt; dataToSend = new ArrayList&lt;&gt;();
        dataToSend.add(new BasicNameValuePair("name", user.name));
        dataToSend.add(new BasicNameValuePair("username", user.username));
        dataToSend.add(new BasicNameValuePair("password", user.password));
        dataToSend.add(new BasicNameValuePair("age", user.age + ""));

        HttpParams httpRequestParams = getHttpRequestParams();

        HttpClient client = new DefaultHttpClient(httpRequestParams);
        HttpPost post = new HttpPost(SERVER_ADDRESS + "Register.php");

        try {
            post.setEntity(new UrlEncodedFormEntity(dataToSend));
            client.execute(post);
        } catch (Exception e) {
            e.printStackTrace();
        }

        return null;
    }

    private HttpParams getHttpRequestParams() {
        HttpParams httpRequestParams = new BasicHttpParams();
        HttpConnectionParams.setConnectionTimeout(httpRequestParams,
                CONNECTION_TIMEOUT);
        HttpConnectionParams.setSoTimeout(httpRequestParams,
                CONNECTION_TIMEOUT);
        return httpRequestParams;
    }

    @Override
    protected void onPostExecute(Void result) {
        super.onPostExecute(result);
        progressDialog.dismiss();
        userCallBack.done(null);
    }

}

public class fetchUserDataAsyncTask extends AsyncTask&lt;Void, Void, User&gt; {
    User user;
    GetUserCallback userCallBack;

    public fetchUserDataAsyncTask(User user, GetUserCallback userCallBack) {
        this.user = user;
        this.userCallBack = userCallBack;
    }

    @Override
    protected User doInBackground(Void... params) {
        ArrayList&lt;NameValuePair&gt; dataToSend = new ArrayList&lt;&gt;();
        dataToSend.add(new BasicNameValuePair("username", user.username));
        dataToSend.add(new BasicNameValuePair("password", user.password));

        HttpParams httpRequestParams = new BasicHttpParams();
        HttpConnectionParams.setConnectionTimeout(httpRequestParams,
                CONNECTION_TIMEOUT);
        HttpConnectionParams.setSoTimeout(httpRequestParams,
                CONNECTION_TIMEOUT);

        HttpClient client = new DefaultHttpClient(httpRequestParams);
        HttpPost post = new HttpPost(SERVER_ADDRESS
                + "FetchUserData.php");

        User returnedUser = null;

        try {
            post.setEntity(new UrlEncodedFormEntity(dataToSend));
            HttpResponse httpResponse = client.execute(post);

            HttpEntity entity = httpResponse.getEntity();
            String result = EntityUtils.toString(entity);
            JSONObject jObject = new JSONObject(result);

            if (jObject.length() != 0){
                Log.v("happened", "2");
                String name = jObject.getString("name");
                int age = jObject.getInt("age");

                returnedUser = new User(name, age, user.username,
                        user.password);
            }

        } catch (Exception e) {
            e.printStackTrace();
        }

        return returnedUser;
    }

    @Override
    protected void onPostExecute(User returnedUser) {
        super.onPostExecute(returnedUser);
        progressDialog.dismiss();
        userCallBack.done(returnedUser);
    }
}
</code></pre>

<p>}'</p>
