BlackBerry Java program Development How to set the user Agent

Source: Internet
Author: User

BlackBerry Java program Development, User Agent is required to manually set, so more flexible.

First Use System.getproperty ("Browser.useragent") to obtain the user agent data as follows:

For example: "mozilla/5.0" (BlackBerry; U BlackBerry 9800; EN) applewebkit/534.1+ (khtml, like Gecko) version/6.0.0.246 Mobile safari/534.1+ "

Then use Httpconnection. Setrequestproperty () Sets the user Agent property.

For example: Httpconnection.setrequestproperty ("User-agent", "profile/midp-2.0 configuration/cldc-1.0");

Reference: How To-retrieve information about the BlackBerry Browser

Http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800878/800733/How_To_-_Retrieve _information_about_the_blackberry_browser.html?nodeid=1033750&vernum=0

How to detect the BlackBerry Browser

Http://supportforums.blackberry.com/t5/Web-Development/How-to-detect-the-BlackBerry-Browser/ta-p/559862?IID=DEVSF30

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.