AsyncTask HttpPost execute fails on 3G, but works on Wifi

前端 未结 8 646
深忆病人
深忆病人 2021-01-04 06:39

I need to do a Http post of some strings to a web service. I am using KSoap.

@Override
protected JSONObject doInBackground(JSONObject... params) {
    String         


        
8条回答
  •  伪装坚强ぢ
    2021-01-04 07:23

    • Basically in some remote area 3G connectivity is not as much speed like wifi. Try to check your 3G is providing you sequence of data connection. If not, then it fails to "post"

    • Next, you have to check the posting time limit. If you take too much time to post,its common to get error while posting. Try to give some maximum time limit in-order to post huge data

    • Instead of using asyn, try to use Handlers or service class to upload something in background.

    Since i'm beginner to android,this are all the options in my mind. It will be more helpful for us if something beyond to this.

提交回复
热议问题