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

前端 未结 8 708
深忆病人
深忆病人 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:06

    You need to do the following troubleshooting:

    1. Confirm that your 3G actually works. Open some standard websites like yahoo.
    2. Try to confirm if your 3G network can actually resolve the address that you have mentioned. If not you can try the IP address directly. If this step solves than your DNS is not able to resolve the address correctly.
    3. If the above two steps fail, restart the device, toggle airplane mode and retry again. Sometimes the 3G network works with reset.

提交回复
热议问题