SnowboardBruin
SnowboardBruin

Reputation: 3685

Display a webpage in blackberry using BrowserField

I found this code, which I guess is for the java file, but does that actually display it, or how do I do the XML? And does Blackberry have a nice GUI for the BB UI yet?

import net.rim.device.api.browser.field2.*;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.container.*;

public class BrowserFieldDemo extends UiApplication
{
    public static void main(String[] args)
    {
        BrowserFieldDemo app = new BrowserFieldDemo();
        app.enterEventDispatcher();
    }

    public BrowserFieldDemo()
    {
        pushScreen(new BrowserFieldDemoScreen());
    }
}

class BrowserFieldDemoScreen extends MainScreen
{
    public BrowserFieldDemoScreen()
    {
        BrowserFieldConfig myBrowserFieldConfig = new BrowserFieldConfig();
        myBrowserFieldConfig.setProperty(BrowserFieldConfig.NAVIGATION_MODE,BrowserFieldConfig.NAVIGATION_MODE_POINTER);
        BrowserField browserField = new BrowserField(myBrowserFieldConfig);

        add(browserField);
        browserField.requestContent("http://www.blackberry.com");
    }
}

I got the code from this page

My end-game is to have a web-based app using HTML5 since BB is a b*tch to program. I figure the HTML is super easy, and this way I just have to figure out how to show a webpage. Is there any reason I should not attempt this method?

Upvotes: 0

Views: 1402

Answers (2)

SnowboardBruin
SnowboardBruin

Reputation: 3685

HTML5 webapp is the best solution since not all BBs use the same code

Upvotes: 0

Juanma Baiutti
Juanma Baiutti

Reputation: 637

I found this code, which I guess is for the java file...

Yes

but does that actually display it?

Yes. Why not?

...or how do I do the xml?

Don't get it

And does blackberry have a nice GUI for the BB UI yet?

No. I use BB plugin for Eclipse and it is not hard

My end-game is to have a web-based app using HTML5

Good solution but depends on the app you are trying to develop

...since BB is a b*tch to program

Don't think so

I figure the HTML is super easy, and this way I just have to figure out how to show a webpage. Is there any reason I should not attempt this method?

It's good if you want to develop for multiple platforms but you are not going to be able to create an app that is as powerfull as a native one

Upvotes: 1

Related Questions