text: This is your resource to discuss support topics with your peers, and learn from each other.
  05-22-2012 07:12 PM
  Hello!
  I was developing Blackberry java application based on BrowserField but now I found that Phonegap will be better solution. However my app requared custom login screen and some other functionality. As I understand login screen implemented in WebWork, so my question is what I need to customize Phonegap/WebWork application? Can I use port Phonegap code to work with BrowserField or can I customize WebWork and rebuild it?
  Any help would be very appreciated!
  Solved! Go to Solution.
  05-23-2012 05:41 PM
  If you're going the Phonegap route, head over to
  05-24-2012 07:36 AM
  Hi. Thanks for reply, but I'm afraid it definitely isn't what I'm looking for. As I understand childbrowser allows to create a separate window with browserfield to load external web page and I can't use Phonegap functionality inside this window. But what I'm looking is way to customize login screen in Phonegap+WebWork. My web app requests several url and I want is that user doesn't need to put credentials for every resource. I want separate logging screen for all app and than credentials from this login screen will be used for any resource.
  I found that Phonagap can work without WebWork. I got sources from Cordova git and than created custom BrowserFieldListener similar to how it is implemented in WebWork:
  public class ContainerBrowserFieldListener extends BrowserFieldListener {
  private ScriptEngine _scriptEngine = null;
  public ContainerBrowserFieldListener() {
  }
  /**
  * @see net.rim.device.api.browser.field2.BrowserFieldList
  */
  public void documentCreated( BrowserField browserField, ScriptEngine scriptEngine, Document document ) throws Exception {
  _scriptEngine = scriptEngine;
  try {
  CordovaExtension cordovaExtension = new CordovaExtension();
  cordovaExtension.loadFeature(cordovaExtension.getF
  } catch( Exception x ) {
  Logger.err("Can't load Cordove", x);
  }
  }
  /**
  * @see net.rim.device.api.browser.field2.BrowserFieldList
  */
  public void documentLoaded( BrowserField browserField, Document document ) throws Exception {
  if( _scriptEngine != null ) {
  // Inform the js framework that we are ready to process requests
  try {
  _scriptEngine.executeScript( "try { var event = document.createEvent(\"Event\"); "
  + " event.initEvent(\"frameworkready\", true, true); "
  + " window.dispatchEvent(event); } catch (e) { } ", null );
  } catch( Exception e ) {
  }
  }
  }
  }
  But I'm not sure about how stable is that solution. Maybe it would be better to try to customize WebWork code.
  05-25-2012 03:32 PM
  I'm not really following what you need to do. Why do you feel you need to customize the Browserfield implementation in PhoneGap?
  If you need to capture login information for multiple sources, why not create your screen in HTML? The ChildBrowser extension would allow you to use OAuth to access 3rd party sites like Twitter, FourSquare, etc, without storing the user's credentials for that site. Highly recommended.
  If you are going to do an app that is essentially a Browserfield, there's almost no reason why you would do it in Java and many reasons to use PhoneGap/WebWorks. PhoneGap is a cross platform way of packaging applications that use a native Browser view as the UI. For BlackBerry, PhoneGap just calls the WebWorks compiler, so regardless it's the same approach.
  05-28-2012 09:51 AM
  Thanks, but I'll try to explain again what is the problem. We have online JQueryMobile (JQM) application that is hosted on IIS server with NTLM authentification. Our JQM performs a set of AJAX requests to several REST services that also use NTLM auth. So when I use standard WebWork+Phonegap I get a set of auth requests to input credentials. But we want have a same credentials for all requests. We want have one login screen for all and this must be separate screen that user see at startup. I found that all this functionality is embeded (hardcoded) in WebWork. So I decide rewrite some code in WebWork and use it to build custom Phonegap application. I found that code what I need is placed into foder device-template in WebWork SDK folder while building WebWork app. All that I need is to replace it and build Phonegap app.
  05-28-2012 02:22 PM
  Okay, everything's open source so you should be able to do what you need, but I don't know how much we will be able to help you with it.
  05-30-2012 06:30 AM
  Thanks, Tim. I have already implemented features that I need.