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: 63
Registered: ‎10-07-2009
My Device: Not Specified
Accepted Solution

BrowserFieldSampleApplication problems to compile SecondaryResourceFetchThread & Utilities

 I'm testing a Browser Field Embed for the 4.6.1 version. And I'm trying this example code BrowserFieldSampleApplication:

 http://docs.blackberry.com/eng/deliverables//5648/integrating.pdf <--- Page 60

 

And I have problems to compile, Eclipse don't resolved 

 Utilities.makeConnection 

and

SecondaryResourceFetchThread.enqueue(resource, referrer);  --> _SecondaryResourceFetchThread_

 

for Utilities to example in last class:

 

<code>

[...]

class PrimaryResourceFetchThread extends Thread {
  
    private BrowserFieldSampleApplication _application;
  
    private Event _event;

    private byte[] _postData;

    private HttpHeaders _requestHeaders;

    private String _url;
  
    PrimaryResourceFetchThread(String url, HttpHeaders requestHeaders, byte[] postData,
                                  Event event, BrowserFieldSampleApplication application) {
      
        _url = url;
        _requestHeaders = requestHeaders;
        _postData = postData;
        _application = application;
        _event = event;
    }

    public void run() {
        HttpConnection connection = Utilities.makeConnection(_url, _requestHeaders, _postData);
        _application.processConnection(connection, _event);      
    }
}

</code>

 

I import:


import java.io.IOException;

import javax.microedition.io.*;

import net.rim.device.api.browser.field.*;
import net.rim.device.api.io.http.*;
import net.rim.device.api.system.*;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;

 

 

The example is the same.

 

Thanks

Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: BrowserFieldSampleApplication problems to compile SecondaryResourceFetchThread & Utilities

Check the browserdemo shipped with JDE 4.6, It has the complete working code which you looking for.

Use Search. "Accept Solution" If the problem is resolved.
Developer
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800
My Carrier: Globe Telecom

Re: BrowserFieldSampleApplication problems to compile SecondaryResourceFetchThread & Utilities

or just load the sample workspace.(sample.jdw) and it will load all the samples shipped with the JDE. :smileyhappy: