BlackBerry Java程序开发如何设置User Agent
BlackBerry Java程序开发,User Agent是需要手工设置,这样更灵活。首先使用System.getProperty("browser.useragent")获得User Agent数据如下:例如:"Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en) AppleWebKit/534.1+ (KHTML, like Gecko) Vers
·
BlackBerry Java程序开发,User Agent是需要手工设置,这样更灵活。
首先使用System.getProperty("browser.useragent")获得User Agent数据如下:
例如:"Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en) AppleWebKit/534.1+ (KHTML, like Gecko) Version/6.0.0.246 Mobile Safari/534.1+"
然后用HttpConnection. setRequestProperty()设置User Agent属性。
例如:HttpConnection.setRequestProperty("User-Agent", "Profile/MIDP-2.0 Configuration/CLDC-1.0");
参考:How To - Retrieve information about the BlackBerry Browser
How to detect the BlackBerry Browser
更多推荐
所有评论(0)