Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
kchantp
Posts: 77
Registered: ‎11-20-2008
My Device: Not Specified

Retrieve the user agent from java application

Is there any way to retrieve the user agent a java app?  I found that in 4.7, I can retrieve it from the java system with:

 

System.getProperty("browser.useragent")

 

However, this doesn't seem to work with 4.6.  Any way to get it with OS 4.6 and below?

BlackBerry Development Advisor
MSohm
Posts: 14,753
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: Retrieve the user agent from java application

The DeviceInfo class can provide the BlackBerry model and handheld software version, which are sent in the user agent header.  The following links show the format of the user agent header.

 

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/How_To_...

 

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800878/800733/How_To_...

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker