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
Contributor
bb_mamz
Posts: 14
Registered: ‎12-08-2011
My Device: developer
My Carrier: developer

Unable to read web page stream on menu item click on browser

I have a requirement to add menu item for the browser menu. On menu item click,I have to get the stream and upload to server. I am using ApplicationMenuItemRepository and its methods to add menu item to browser.On the menu item click Blackberry Api returns the web page url. I am creating a http connection with the returned URL and getting the webpage stream.

 

 I have two concerns/issues in this requirement:

 

1.How to get the image data?

2.How to get stream for the web pages which are session based. Example: Open website which asks for user credentials in browser on device.Enter credentials and login to website.Now when menu item is clicked, API returns a URL. When we try to create a http connection with the URL the session gets expired and unable to fetch the web page stream.

 

Please let me know if this is the right approach to read the web page stream on menu item click. Also solutions for the above issues

 

Thanks, Mamatha

Please use plain text.
Developer
maadani
Posts: 729
Registered: ‎05-04-2011
My Device: 9700

Re: Unable to read web page stream on menu item click on browser

Hi Mamatha,

 

If I recall correctly, the device browser has its own connection factory so I don't how you can fulfill these requirements (the second one is more problematic).

 

However, if you would use a browserField, you can control the rendering and the resource fetching.

 

Hope that helps,

 

E.

Please use plain text.
Contributor
bb_mamz
Posts: 14
Registered: ‎12-08-2011
My Device: developer
My Carrier: developer

Re: Unable to read web page stream on menu item click on browser

Hi I did not get you on how to to use browser field in this scenario. Do I need to open the url in the browser field and fetch the stream data?
Please use plain text.
Developer
maadani
Posts: 729
Registered: ‎05-04-2011
My Device: 9700

Re: Unable to read web page stream on menu item click on browser

If you are using browserField in your application, you can use the various Manager (Connection Manager, Navigation Manager, etc') to catch the events you need and to apply your own Connection.

 

E.

Please use plain text.