View
 

Known issues (BlackBerry)

Page history last edited by Timo 2 wks ago

IMPORTANT:

  • The BlackBerry browser implementation that PhoneGap uses for BlackBerry OS 4.6 and 4.7 supports only DOM level 2 and CSS level 2. Due to this constraint, most popular JavaScript frameworks (jQuery, etc.) do not work on PhoneGap BlackBerry (update: XUI works! see the BlackBerry build on the github page - uses Sizzle as the selector engine). RIM has announced a WebKit-based browser to replace their current implementation, which should fix many of these issues, but this is slated for release sometime in 2010, so we've still got a bit of time to wait...
  • Native XHRs do not work on PhoneGap BlackBerry. You can have a look at the Java-based, native implementation of XHR that we've implemented here:  http://github.com/phonegap/phonegap-blackberry/blob/master/framework/src/com/nitobi/phonegap/api/impl/NetworkCommand.java

    The JavaScript interface looks like this:

    navigator.network.XHR(url, postData, callback);

    url - string parameter of the URL to send the request to.

    postData - string parameter of POST data to send (can be null if you don't want to send POST - just add GET parameters as querystring to the URL parameter if that's the case).

    callback - a function handle to execute when the XHR returns.

  • Phonegap only supports Columns View. For Blackberry OS lower tha 5.0 pages can only be rendered in columns view. It is only available to set programatically Page View on Blackberry 5.0 or higher. It is very important to take care because css float selector is not supported in columns view. see it in Blackberry support forum thread.

  • Geolocation API works on EDGE (0.82) but not on stable 0.80.

 

BlackBerry JDE 4.6.1

  • The 'onkeyup' event does not work properly. Only tested with <input> elements.
  • NOTE: This is *not* an issue on the simulator, but is on a BlackBerry (Bold) device. Adding an event handler to a node, and then using this.<attribute> to grab the node's state from within the event handler returns the attribute of the node *prior* to the event being dispatched. Hard to explain, here's an example:  

     

var check = document.createElement("input");
check.setAttribute("type", "checkbox");
check.addEventListener("click",function() {
if (this.checked) { alert('checked!'); else { alert('unchecked!'); }
, false);

 

With the above example, we create a checkbox element and assign a click handler to it that alerts the state of the checkbox. Expected behaviour is that after you check the box, an alert saying 'checked!' is displayed. Instead, when you UNCHECK the box, the 'checked!' alert is displayed and when you check the box, the 'unchecked!' alert is displayed. 

 

BlackBerry JDE 5.0 (Current in beta)

Not there yet ;) 

Comments (8)

profile picture

Brian said

at 11:00 am on Nov 9, 2009

Any updates on the XMLHttpReuest() issues?

profile picture

Fil Maj said

at 2:44 pm on Nov 9, 2009

Hey Brian,

I've added a bit more information on how to use our own Java-based implementation of the XHR, and how to call it from JavaScript. Hope that helps you out,

Fil Maj
Web Software Engineer
Nitobi

profile picture

Santiago Anglés said

at 8:28 am on May 26, 2010

Fil Maj,
Where could we find that info?
I'm not able to use it.

Thanks,
Sangles

profile picture

Alyssa said

at 2:26 pm on Jul 20, 2010

could you give us an example of how to use the XHR?How do you get the response text?

profile picture

Andoni Cortazar said

at 7:11 am on Jul 21, 2010

Hello,

I am learning how to develop using phonegap for Blackberry and I am trying to make an application that stores/loads data (p.e. a person's name,phone,address...) in a persistent way. I have the eclipse/blackberry/phonegap environment correctly installed following the indications given in this site. Is there any free object persistence framework (I have been trying Floggy but i have some access violation errors) compatible with my environment? Do I have to wait for the Blackberry JDE 5.0 phonegap release instead? (if I'm not wrong, the Blackberry JDE 5.0 shouldl implement native sqlite)

Thanks,
Andoni

profile picture

Michael Brooks said

at 12:15 pm on Jul 21, 2010

Alyssa:

Here is a rough example of BlackBerry XHR: http://gist.github.com/473585

There are two issues with this gist:

1) POST requests do not pass the parameters correctly. I'm unsure why.

2) The master branch of PhoneGap-BlackBerry only uses the carrier network to make XHR requests. It should use the WiFi if it is present, otherwise fallback on the carrier data network. The fix has been implemented, but it has not yet been merged into the master branch. As a work around, you can add ";interface=wifi" to the end of the request URL. Example: ";http://www.example.com/get_location;interface=wifi"

profile picture

Michael Brooks said

at 12:27 pm on Jul 21, 2010

Andoni Cortazar:

Very recently native persistent storage was added to PhoneGap-BlackBerry. It's a Key/Value store that uses RIMs Persistent Store class. There are a few issues with it and the fixes have not been merged into the official PhoneGap-BlackBerry repository. As a result, the most stable version of BlackBerry storage is on Fil Maj's fork (he is one of the core maintainers of PhoneGap-BlackBerry).

The most stable version of PhoneGap-BlackBerry storage is on Fil Maj's branch (soon it will go into the official repository):
http://github.com/filmaj/phonegap-blackberry

A summary of the issue that has not been merged into the official PhoneGap-BlackBerry repository:
http://github.com/filmaj/phonegap-blackberry/commit/0524134776f4067694e63cd27e432ab04fffaec1

Here is the JavaScript interface for Persistent Storage (soon this interface will be changed to be compliant with the PhoneGap API):
http://github.com/phonegap/phonegap-blackberry/blob/master/js/store.js

There is also a Lawnchair adapter, but it is not yet merged into the official Lawnchair repository. It is also currently in Fil Maj's fork: http://github.com/filmaj/lawnchair/blob/master/src/adaptors/BlackBerryPersistentStorageAdaptor.js

profile picture

Andoni Cortazar said

at 4:52 am on Jul 22, 2010

Thanks a lot Michael.

I don't know if the info in those links will solve my problems, I’m trying to figure it out the code, but I really appreciate your post.

At the moment, I have developed the mechanism to send-receive data between the HTML/javascript part and the java part integrating a json external library (“json2.js” link: http://www.JSON.org/js.html) for data transmission purposes, and another external library for taking/updating the data on the different html fields/objets (“xui-bb-1.0.0.js” link: http://xuijs.com)

Now, I need to add database support to my app and I am looking for some kind of sqlite addon for phonegap-Blackberry or a kind of J2ME framework/class to provide easy access to the RMS-Database system of the Blackberry phone that is also compatible with phonegap-Blacberry. Does something like this exist or should I have to wait until the new Phonegap-Blackberry release that may be compatible with the JDE 5.0? Probably that is he same question I tried to ask in my previous post but written in another way.

My intention after I implement the “still missing database library/addon part” is to be able to send the different query results to the html part using my transmission mechanism mentioned above.

I'll keep reading the articles in those links.

You don't have permission to comment on this page.