view plaincopy to clipboardprint? <!-- Do not tranlsate. Development option --> <string-array name="pref_development_ua_choices" translatable="false"> <item>Android</item> <item>Desktop</item> <item>iPhone</item> </string-array> <!-- Do not tranlsate. Development option --> <string-array name="pref_development_ua_values" translatable="false"> <item>0</item> <item>1</item> <item>2</item> </string-array>
view plaincopy to clipboardprint? private static final String DESKTOP_USERAGENT = "Mozilla/5.0 (Macintosh; " + "U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/530.17 (KHTML, " + "like Gecko) Version/4.0 Safari/530.17"; private static final String IPHONE_USERAGENT = "Mozilla/5.0 (iPhone; U; " + "CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 " + "(KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16";
view plaincopy to clipboardprint? public void update(Observable o, Object arg) { BrowserSettings b = (BrowserSettings)o; WebSettings s = mSettings; s.setLayoutAlgorithm(b.layoutAlgorithm); if (b.userAgent == 0) { // use the default ua string s.setUserAgentString(null); } else if (b.userAgent == 1) { s.setUserAgentString(DESKTOP_USERAGENT); } else if (b.userAgent == 2) { s.setUserAgentString(IPHONE_USERAGENT); }