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

Web and WebWorks Development

Reply
New Developer
New Developer
Posts: 6
Registered: ‎12-15-2008
My Device: Not Specified
Accepted Solution

Setting User Agent in BrowserField

I tried to set USER_AGENT in Browser Field like this

 

 

String UserAgent = "BlackBerry9530/4.7.0.75 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/-1";
        

_renderingSession.getRenderingOptions().setProperty(RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.USER_AGENT, UserAgent);

 

      

is it wrong? is there any way.

 

Cause, on server side, on website, User Agent is showen blank.

BlackBerry Development Advisor
Posts: 15,752
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Setting User Agent in BrowserField

You can set the User-Agent on the underlying HTTP connection made for the browser field.  This can be done in the makeConnection method of the Utilities class in the CommonLib library project used by the BrowserFieldDemo.
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
Highlighted
New Developer
New Developer
Posts: 6
Registered: ‎12-15-2008
My Device: Not Specified

Re: Setting User Agent in BrowserField

Okay. Thanks for the reply. I got the solution.

But I have one more query, what is exact difference between the two demos BrowserFieldDemo and BrowserContentManagerDemo. Which one is better. I think, both the demos have the similar functionalities except ContentManager has the header and footer printed while browsing.

 

Is there any specific difference, some feature available through one or something?

BlackBerry Development Advisor
Posts: 15,752
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Setting User Agent in BrowserField

The actual functionality of the two samples is pretty much identical.  The main difference is that one displays the browser content within a field type object and the other users a manager style object.
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
New Member
Posts: 2
Registered: ‎08-03-2011
My Device: Blackberry 9330
My Carrier: Verizon Wireless

Re: Setting User Agent in BrowserField

How do I set the user agent? I have a blackberry 9330. I'm trying to open a site that starts with http://blackberry.    and i get a message that says unknown user agent.   Please help