Shikhar Shrivastav
Shikhar Shrivastav

Reputation: 735

Unable to reach server with both Volley and HttpUrlConnection

I am facing a very weird problem with my app. I use Volley for Network operations. For some reason some devices are unable to hit the any API endpoints. Some of the devices which had this issue include Xiaomi Note, Lenovo A7000, Asus Zenphone series etc running Kitkat 4.4.2 All my urls are https based. To troubleshoot the issue, I sent a debug build across, in that tried hitting a https url with both Volley and HttpUrlConnection. Both failed. Got a sockettimeoutexception. That is how I ascertained this issue. Devices are running on 3G on different networks in different areas. Doesn't happen on all 3G though. These users don't have Wifi, so they can't run on Wifi to rule out DNS issue. I asked one of the user to open the same ping url on browser. The user successfully opened the url on Chrome Browser on device, the same one which failed with both Volley and HttpUrlConnection.

I am clueless. Can Https be a problem here? Why is not happening for other devices?

Any ideas? Thanks!

Upvotes: 1

Views: 249

Answers (1)

Leo
Leo

Reputation: 2326

You mention 3G is OK, which rings a bell at me: 3G always overwrites whatever resolvers you set (unless maybe with iptables). So for debugging I would look at that:

adb devices -l     # find your gadget
adb shell          # run shell
su                 # become root
getprop net.dns1   # or `getprop | grep dns`
nslookup troubl.es # a domain in Spain, something to do with Manual.

Upvotes: 1

Related Questions