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
Posts: 144
Registered: ‎12-20-2008
My Device: Not Specified
Accepted Solution

Adding WebBrowser to an aplication

I am trying to develop a ,aim aplication that serves diferent web pages and on exit return to main aplication New to Java

When i compile the module i have this errors help needed with class variables declaration

Building Web
C:\Archivos de programa\Research In Motion\BlackBerry JDE 4.7.0\bin\rapc.exe  -quiet  import=..\lib\net_rim_api.jar codename=com\rim\samples\device\Soler\HTTPDemo com\rim\samples\device\Soler\HTTPDemo.rapc "C:\Archivos de programa\Research In Motion\BlackBerry JDE 4.7.0\samples\com\rim\samples\device\Soler\ConexionHTTP.java" "C:\Archivos de programa\Research In Motion\BlackBerry JDE 4.7.0\samples\com\rim\samples\device\Soler\ElRecreo.java" "C:\Archivos de programa\Research In Motion\BlackBerry JDE 4.7.0\samples\com\rim\samples\device\Soler\img\httpdemo_jde.png" "C:\Archivos de programa\Research In Motion\BlackBerry JDE 4.7.0\samples\com\rim\samples\device\Soler\PasswordPopupScreen.java" "C:\Archivos de programa\Research In Motion\BlackBerry JDE 4.7.0\samples\com\rim\samples\device\Soler\WapOptionsScreen.java"
C:\Archivos de programa\Research In Motion\BlackBerry JDE 4.7.0\samples\com\rim\samples\device\Soler\ConexionHTTP.java:93: cannot find symbol
symbol  : variable SecondaryResourceFetchThread
location: class com.rim.samples.device.ElRecreo.ConexionHTTP in next post due to file length
           

Developer
Posts: 144
Registered: ‎12-20-2008
My Device: Not Specified

Re: Adding WebBrowser to an aplication

Solved partially i use the

BrowserSession bss = Browser.getDefaultSession(); 
         bss.displayPage(_url);
         bss.showBrowser();

is there a better way i would like that the page was loaded inside my aplication i think it can be done

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

Re: Adding WebBrowser to an application

You can use a browser field within your application to display web content on a screen within your application.  Have a look at the browserfielddemo included with the BlackBerry JDE for an example.
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
Developer
Posts: 144
Registered: ‎12-20-2008
My Device: Not Specified

Re: Adding WebBrowser to an application

Thanks for your suggestion i am new to java yhe sample application does not work on my 9000 emulator it does not show google it hang on _url =url how can be done

 

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

Re: Adding WebBrowser to an application

Please ensure that you also have the MDS Simulator running because it is required by this sample.
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
Developer
Posts: 144
Registered: ‎12-20-2008
My Device: Not Specified

Re: Adding WebBrowser to an application

I get it to work mds problem

how i have to do to change parameters to use it on my program

as

private BrowserField _browserField;

 

_browserField = new BrowserField ( _URL);

push screeen(_browserFiel);

 

how i have to change the class to extend main screen or no to be a extend UIApplication I am not very keen on java

 

final class BrowserFieldR extends UiApplication implements RenderingApplication
{
   
    private static final String REFERER = "referer";  
   
    private RenderingSession _renderingSession;  
    private HttpConnection  _currentConnection;
    private MainScreen _mainScreen;
   
   
    /***************************************************************************
     * Main.
     **************************************************************************/
    public static void main(String[] args)
    {
        BrowserFieldR app = new BrowserFieldR();
        app.enterEventDispatcher();
    }
   
    private BrowserFieldR()
    {       
       
        _mainScreen = new MainScreen();       
        pushScreen(_mainScreen);
        _renderingSession = RenderingSession.getNewInstance();
       
        // Enable javascript.
        //_renderingSession.getRenderingOptions().setProperty(RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.JAVASCRIPT_ENABLED, true);                       
       
        PrimaryResourceFetchThread thread = new PrimaryResourceFetchThread("http://www.google.com", null, null, null, this);
        thread.start();                      
            
    }

 

thanks in advance

r.soler

 

 

 

Highlighted
New Developer
New Developer
Posts: 6
Registered: ‎12-15-2008
My Device: Not Specified

Re: Adding WebBrowser to an application

Hi,

 

I did the say way, to enable javascript support. But still when i load a page containing javascript, it does not execute. Is there anything else required to do?? What might be wrong then...