我正在为我的Android应用程序创建注册/登录页面,但我尝试使用的代码已被弃用。有谁知道更换?我的代码如下,倒数第二行是不推荐使用的代码。 BasicHttpParams();
public class ServerRequests {
ProgressDialog progressDialog;
public static final int CONNECTION_TIMEOUT = 15000;
public static final String SERVER_ADDRESS = "http://telarad.com/";
public ServerRequests(Context context)
{
progressDialog = new ProgressDialog(context);
progressDialog.setCancelable(false);
progressDialog.setTitle("Working on it...");
progressDialog.setMessage("Connection InterFace is getting your account ready.");
}
public void storeDataInBackground(Contact contact, GetUserCallback callback)
{
progressDialog.show();
}
public void fetchDataInBackground(Contact contact, GetUserCallback callback)
{
progressDialog.show();
}
public class StoreDataAsyncTask extends AsyncTask<Void, Void, Void>
{
Contact contact;
GetUserCallback callback;
public StoreDataAsyncTask(Contact contact, GetUserCallback callback)
{
this.contact = contact;
this.callback = callback;
}
@Override
protected Void doInBackground(Void... voids) {
ContentValues values = new ContentValues();
values.put("Email", contact.email);
values.put("Username", contact.username);
values.put("Password", contact.password);
HttpParams httpRequestParams = new BasicHttpParams();
return null;
}
}