Reputation: 470
Im making an Http request where it needs authentication. After succesffully authenticated im getting a response code as 200. Then, how should i display the webpages from the server on to my customized browser field.
Upvotes: 0
Views: 185
Reputation: 939
Here a simple fragment of code that uses BrowserField to display an html page:
BrowserField browser = new BrowserField();
String browserContent = "<html><style>" + theStyle + "</style>" + theBody + "</html>";
byte[] contentBytes;
try {
contentBytes = browserContent.getBytes("UTF-8");
browser.displayContent(contentBytes, "text/html; charset=UTF-8", "http://mysite.org");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
browser.displayContent(browserContent, "http://mysite.org");
}
Upvotes: 0
Reputation: 3728
To display a web page on BlackBerry Screen you can check How to - Invoke the browser,If you are working on BlackBerry OS 5.0 you can use Browser field article. Use BrowserField class to display a webpage on your BlackBerry Screen.
Upvotes: 1