I have application that communicates with web server through REST. It works fine on a phone when connected via WiFi but does not work correctly when on 3G.
Not everything stops working. I'm still able to use some functionality but for some reason some calls to rest return "" (empty response) very quickly. Once again when I'm on WiFi everything works fine.
Just to clarify: 1. I have data plan :) 2. Server I'm connecting to is accessible from Internet
Any thoughts?
Thanks Ralph
It need not be a phone specific issue. This could happen if your APN setting is missing the internet APN. You might be having the APN for gprs and mms, but there are chances that your provider missed to send you your APN for internet. Do a quick google for the internet APN settings of your provider and enter it in there.
A sample internet APN setting for !dea would look like the following.
name : idea_internet apn : internet apn type : internet
Please do try it out. This would solve the issue with all your communication apps. I had the same on my galaxy S3 and this fixed my issue.
Cheers! bonbets
If the problem only occurs when the connection type is changed, it is most likely due to a poor connection to the server.
HTTP is designed so that in the event of a connection error, you can simply just retry the exact same request until you receive a result.
But in order for this to work, you have to make sure of a few things. Firstly. All responses must have a Content-Length. Secondly, all methods should be "safe" (or idempotent).
This means that if you send a request multiple times, you will receive back the same result. GET, PUT, and DELETE are fine. (PUT may say created or updated, and DELETE may say OK or already done but the end result is the same).
POST is a problem. The solution is to have a unique ID sent with every POST, and stored along with its data. So you can tell if there is a duplicate request.
Another issue may be caching by the 3G ISP. Make sure server and client are setting up caching correctly for your needs.
Mike Brown
Just Change the access point names from "GPRS/WAP" to "Internet"....It will work fine. Now I am able to access all the Apps with 3G.