PDA

View Full Version : WebView Desktop website version



caramare
07-19-2011, 12:23 PM
Hello,

I am creating an aplication that involves an WebView. The thing is that I want to load the full page and not the mobile one, so I have changed the User Agent. Nevertheless there are pages that loads the mobile version. Does anyone knows how I can trick the server and tell him I am using a desktop and not a mobile.
Here are two versions of code that I have tried:

1.webview.getSettings().setUserAgentString("Mozila ");

2.
String DESKTOP_USERAGENT = webview.getSettings().getUserAgentString ();
DESKTOP_USERAGENT = DESKTOP_USERAGENT.replace("Mobile ","");
webview.getSettings().setUserAgentString(DESKTOP_U SERAGENT);

This are exemples of webpages that loads the mobile version in any cases:

Jurnalul National (http://www.jurnalul.ro)
Download thousands of Android apps from the Android Market - AndroidZoom.com (http://www.androidzoom.com)

Thank you very much,
Razvan