BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 06-03-2010, 10:15 AM   #1
Ashis
Knows Where the Search Button Is
 
Join Date: Jun 2010
Model: NA
PIN: N/A
Carrier: NA
Posts: 15
Red face Stucked with HTML display...

Please Login to Remove!

Hello all... i am new to Blackberry development...
My requirement is to display html content in a screen. my target os is 4.5
i found 3 ways
1:- BrowserSession - its working fine but that blackberry logo is a probelm . is there any effective way to remove or hide that?
2:- BrowserContent - got this from BrowserFieldDemo sample. its workign ok for simple pages but not properly for complex pages with style sheets, post requests etc.
3:- BrowserField - it has been interduced in 5.0. is there anyway to port it in 4.5 like any patch etc.

Please guide me

Regards
Ashis
Offline  
Old 06-04-2010, 02:08 AM   #2
baskar
Knows Where the Search Button Is
 
Join Date: May 2009
Model: 8800
PIN: N/A
Carrier: NOT SURE
Posts: 33
Default

Hi,

I have same problem.
you display images from any url?
suppose i am back from browsersession means display blank screen also.
please help anybody.

Thanks,
Baskar.
Offline  
Old 06-04-2010, 04:08 AM   #3
Ashis
Knows Where the Search Button Is
 
Join Date: Jun 2010
Model: NA
PIN: N/A
Carrier: NA
Posts: 15
Default

Quote:
Originally Posted by baskar View Post
Hi,

I have same problem.
you display images from any url?
suppose i am back from browsersession means display blank screen also.
please help anybody.

Thanks,
Baskar.
yes images are working fine in browsersession. and u r talking about which blankscreen...? if u will press back button on browsersession screen then u will land on its previous screen...

Regards
Ashis
Offline  
Old 06-06-2010, 11:59 PM   #4
baskar
Knows Where the Search Button Is
 
Join Date: May 2009
Model: 8800
PIN: N/A
Carrier: NOT SURE
Posts: 33
Default

Hi Ashis,

- yes, if i will press back button on browsersession screen means receive blank screen.

Thanks,
Baskar.
Offline  
Old 06-07-2010, 12:18 AM   #5
Ashis
Knows Where the Search Button Is
 
Join Date: Jun 2010
Model: NA
PIN: N/A
Carrier: NA
Posts: 15
Default

Hi Baskar,

it should not. can u show me the code where and how r u calling the BrowserSession ?

Regards
Ashis
Offline  
Old 06-07-2010, 02:05 AM   #6
baskar
Knows Where the Search Button Is
 
Join Date: May 2009
Model: 8800
PIN: N/A
Carrier: NOT SURE
Posts: 33
Default

Hi,

i am using below code. please checkit out.
BrowserSession bSession = Browser.getDefaultSession(); bSession.displayPage( "web page url");
bSession.showBrowser();
IndexScreen indexScreen= new IndexScreen();
UiApplication.getUiApplication().pushScreen(indexS creen);
Also images not display from given url.
i am using 4.5.0.

Thanks,
Baskar
Offline  
Old 06-07-2010, 03:58 AM   #7
Ashis
Knows Where the Search Button Is
 
Join Date: Jun 2010
Model: NA
PIN: N/A
Carrier: NA
Posts: 15
Default

hi Baskar,

may i know why r u pushing 'indexScreen' after showBrowser();
and i think bSession.showBrowser(); is also not required...

try the following sample code

Code:
public class BrowserDemo extends UiApplication
{
    public static void main(String[] args)
    {
        BrowserDemo d = new BrowserDemo();
        d.enterEventDispatcher();
    }

    public BrowserDemo()
    {
        pushScreen(new BrowserScreen());
    }

}

class BrowserScreen extends MainScreen
{
    public BrowserScreen()
    {
        LabelField title = new LabelField("demonstrating browser");
        setTitle(title);

        BrowserSession visit = Browser.getDefaultSession();
        visit.displayPage("http www google com");
        visit.showBrowser();
    }
}
Offline  
Old 06-07-2010, 04:27 AM   #8
baskar
Knows Where the Search Button Is
 
Join Date: May 2009
Model: 8800
PIN: N/A
Carrier: NOT SURE
Posts: 33
Default

Hi,

ok, this is working fine.
but you directly push to browserscreen. i am using one edit box and ok button in index screen, when ever user enter any url and then click ok button means display browser screen using pushscreen. now i am come back index screen using back button display blank screen.

Thanks,
Baskar.
Offline  
Old 06-07-2010, 05:08 AM   #9
baskar
Knows Where the Search Button Is
 
Join Date: May 2009
Model: 8800
PIN: N/A
Carrier: NOT SURE
Posts: 33
Default

hi,

You know what my problem?
Thanks for your quick responses.

Thanks,
Baskar
Offline  
Old 06-07-2010, 06:07 AM   #10
Ashis
Knows Where the Search Button Is
 
Join Date: Jun 2010
Model: NA
PIN: N/A
Carrier: NA
Posts: 15
Default

sorry i am not properly getting your problem.

anyway what i hv understood from ur above posts, if ur 'indexScreen' contains an edit box and a button and u want to show the page entered in the editbox then you should push the 'indexScreen' first then call the BrowserScreen's displayPage() in the eventlistener of the button...

Regards
Ashis
Offline  
Old 06-07-2010, 06:40 AM   #11
baskar
Knows Where the Search Button Is
 
Join Date: May 2009
Model: 8800
PIN: N/A
Carrier: NOT SURE
Posts: 33
Default

hi,

Correct, Once i am receving web page, how to come back to index screen(using back button or any).
Please give me suggestion.

Thanks,
Baskar
Offline  
Old 06-07-2010, 08:48 AM   #12
Ashis
Knows Where the Search Button Is
 
Join Date: Jun 2010
Model: NA
PIN: N/A
Carrier: NA
Posts: 15
Default

Ok.if that is the requirement then push indexScreen first. then in the button click event call the browser session.
so when u will clik the button the browser will be shown. and if u will click the back button it will go back to the previous screen i.e. ur indexScreen.
Offline  
Old 06-08-2010, 02:28 AM   #13
baskar
Knows Where the Search Button Is
 
Join Date: May 2009
Model: 8800
PIN: N/A
Carrier: NOT SURE
Posts: 33
Default

hi Ashis,

- yes.
- i am calling previous screen every time, display blank screen.
- Please help.

Thanks,
Baskar
Offline  
Old 06-08-2010, 04:15 AM   #14
Ashis
Knows Where the Search Button Is
 
Join Date: Jun 2010
Model: NA
PIN: N/A
Carrier: NA
Posts: 15
Default

i think there is no need to call the previous screen explicitely... and may be that is the reason for ur blank screen!
if u can post the full code of the class that u r using to display the browsersession, then it may help to identify the actual reason of ur problem.
Offline  
Old 06-10-2010, 06:30 AM   #15
baskar
Knows Where the Search Button Is
 
Join Date: May 2009
Model: 8800
PIN: N/A
Carrier: NOT SURE
Posts: 33
Default

hi,

sorry for late reply,
i attached my code please check it out.

public class indexscreen extends MainScreen
{
private VerticalFieldManager vManager;
private BasicEditField userurl;
private ButtonField connectButton;

private WebpageView webpageView = null;

public indexscreen()
{
super(NO_VERTICAL_SCROLL |FIELD_VCENTER );
initialize();
}//End of constructor

private void initialize()
{
try
{
userurl = new BasicEditField("","",Integer.MAX_VALUE,BasicEditFi eld.USE_ALL_WIDTH);

connectButton = new ButtonField("ok", FIELD_HCENTER);
connectButton.setChangeListener(listen);

vManager = new VerticalFieldManager(VerticalFieldManager.USE_ALL_ HEIGHT|VerticalFieldManager.USE_ALL_WIDTH|Horizont alFieldManager.USE_ALL_HEIGHT|HorizontalFieldManag er.USE_ALL_WIDTH|HorizontalFieldManager.FIELD_HCEN TER|HorizontalFieldManager.FIELD_VCENTER);
vManager.add(userurl);
vManager.add(connectButton);
add(vManager);

}//try
catch(Exception qwe)
{
qwe.printStackTrace();
}
}//fn initialize

FieldChangeListener listen = new FieldChangeListener()
{
public void fieldChanged(Field field, int context)
{
if (field == connectButton)
{
webpageView = new WebpageView(userurl.getText());
UiApplication.getUiApplication().pushScreen(webpag eView);
}
}
};//btn action
}

//class webpage
public class WebpageView extends MainScreen
{
public WebpageView(String url)
{
try
{
BrowserSession bSession = Browser.getDefaultSession();
bSession.displayPage( url );
bSession.showBrowser();
}
catch (Exception e)
{
System.out.println("Exceptrion rendering Error "+e.getMessage());
}
}

}

Thanks,
Baskar
Offline  
Old 06-10-2010, 08:31 AM   #16
Ashis
Knows Where the Search Button Is
 
Join Date: Jun 2010
Model: NA
PIN: N/A
Carrier: NA
Posts: 15
Default

i think i got ur problem...
there is no need to create another screen for the browsersession...

call the browser screen from the button click event like

if (field == connectButton)
{
BrowserSession bSession = Browser.getDefaultSession();
bSession.displayPage(userurl.getText());
}

you are pushing the WebpageView screen above indexscreen and then u are calling the browsersession which is another screen which is being pushed over the WebpageView. so after u r closing the browsersession the WebpageView is shown to you which is blank coz u hv not added any field to it!
Offline  
Old 06-11-2010, 12:00 AM   #17
baskar
Knows Where the Search Button Is
 
Join Date: May 2009
Model: 8800
PIN: N/A
Carrier: NOT SURE
Posts: 33
Default

Hi,

Thanks for your suggestion.
i will try this option.
Offline  
Old 06-21-2010, 02:17 AM   #18
baskar
Knows Where the Search Button Is
 
Join Date: May 2009
Model: 8800
PIN: N/A
Carrier: NOT SURE
Posts: 33
Default

Hi,

Now working Perfectly,
Thanks for your help.

Regards,
Baskar
Offline  
Old 06-21-2010, 04:45 AM   #19
Ashis
Knows Where the Search Button Is
 
Join Date: Jun 2010
Model: NA
PIN: N/A
Carrier: NA
Posts: 15
Default

welcome bro...
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


1pcs used TSXMFPP128K Memory Card picture

1pcs used TSXMFPP128K Memory Card

$175.00



Memory Module A20B-3900-0224 1Pcs Fanuc  rc picture

Memory Module A20B-3900-0224 1Pcs Fanuc rc

$472.67



Van Dorn Siemens Simatic Memory Sub Module Cat. No. 6ES5 374-0AA11 picture

Van Dorn Siemens Simatic Memory Sub Module Cat. No. 6ES5 374-0AA11

$200.00



Coltene Hyflex CM Controlled Memory NiTi Files Rotary File System Set of 6 Files picture

Coltene Hyflex CM Controlled Memory NiTi Files Rotary File System Set of 6 Files

$47.49



AB 1747M13 SER A SLC EEPROM Memory Module 1747-M13 NEW IN BOX picture

AB 1747M13 SER A SLC EEPROM Memory Module 1747-M13 NEW IN BOX

$79.73



NEW Original Allen Bradley 2080-MEMBAK-RTC Memory Module With RTC Plug-In picture

NEW Original Allen Bradley 2080-MEMBAK-RTC Memory Module With RTC Plug-In

$289.14







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.