64
BlackBerry Device Applications Integration Guide
HttpConnection connection = Utilities.makeConnection(resource.getUrl(),
resource.getRequestHeaders(), null);
return connection;
} else {
// if referrer is provided we can set up the connection on a separate thread
SecondaryResourceFetchThread.enqueue(resource, referrer);
}
return null;
}
/**
* @see
net.rim.device.api.browser.RenderingApplication#invokeRunnable(java.lang.Runnable)
*/
public void invokeRunnable(Runnable runnable) {
(new Thread(runnable)).run();
}
}
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);
}
}
Summary of Contents for JAVA DEVELOPMENT ENVIRONMENT - - DEVICE APPLICATIONS INTEGRATION - DEVELOPMENT GUIDE
Page 4: ......
Page 7: ......
Page 10: ...10 BlackBerry Device Applications Integration Guide...
Page 12: ...12 BlackBerry Device Applications Integration Guide...
Page 50: ...50 BlackBerry Device Applications Integration Guide...
Page 56: ...56 BlackBerry Device Applications Integration Guide...
Page 65: ......
Page 66: ...2008 Research In Motion Limited Published in Canada...