I know how to make http request on android. But how can i make an http request to a website and gurarantee the response is from the full site not the mobile version ?
Thanks
I know how to make http request on android. But how can i make an http request to a website and gurarantee the response is from the full site not the mobile version ?
Thanks
You should modify the user agent String ( to make it appear coming from a desktop browser ) Refer to link below :
Try to remove the request headers or change all by which one can determine that it is a mobile device hope it help
You need to set Your user agent like that.
String ua = "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.4) Gecko/20100101
Firefox/4.0";
mWebview.getSettings().setUserAgentString(ua);
This will help:
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(url);
String userAgent = "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.4) Gecko/20100101 Firefox/4.0";
try {
httppost.setHeader("User-Agent", userAgent);
// Add your data
// Execute HTTP Post Request
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();