0
嗨,我想發佈的數據PHP的服務器我有一個parmeters像如何在android中將數據發佈到服務器?
parameters:upid,product_id,pname,pquantity,price,pickup_date,pickup_time,name,email,mobile,address,location,pincode,total_amount
我打電話的AsyncTask在我的活動類
PlaceOrderTask placeOrderTask = new PlaceOrderTask(YourBasket.this,upid,"2", iconName,"200", "250.00", dateFormat,timeFormat, name,email,mobileNo,"Hyderbad",location, "500032", totalAmount);
placeOrderTask.execute();
在我的AsyncTask
我會這樣調用
public class PlaceOrderTask extends AsyncTask
{
String upid, product_id, productName, productQuantity, pprice, date, time,
name, email, mobileNo, location, address, pincode, totalAmount;
private ProgressDialog pd = null;
Context context;
public PlaceOrderTask(Context context,String upid, String product_id, String productName,
String productQuantity, String pprice, String date, String time,
String name, String email, String mobileNo, String location,
String address, String pincode, String totalAmount)
{
this.context = context;
this.upid = upid;
this.product_id = product_id;
this.productName = productName;
this.productQuantity = productQuantity;
this.pprice = pprice;
this.date = date;
this.time = time;
this.name = name;
this.email = email;
this.mobileNo = mobileNo;
this.location = location;
this.address =address;
this.pincode =pincode;
this.totalAmount = totalAmount;
}
@Override
protected Object doInBackground(Object... params)
{
return null;
}
@Override
protected void onPreExecute()
{
pd = new ProgressDialog(context);
pd.setMessage("Please Wait.....");
super.onPreExecute();
}
@Override
protected void onPostExecute(Object result) {
pd.dismiss();
super.onPostExecute(result);
}
}
我們在doInBackground和onPostExcute中調用
and Here My url is like this
http://safewash.docni.in/iosapp/order.php
這是MyProblem球員可以在任何一個建議我如何才能爲後期類型的請求這樣做
請閱讀使用前的AsyncTask,在應用程序,難道谷歌,你會得到更多的教程 – Madhu
你不應該被髮送數據的JSON對象? –
我只使用json數據 –