Re: Is Phonegap ready for prime time on Blackberry playbook yet?

371 views
Skip to first unread message

Tim

unread,
Jul 30, 2012, 2:48:06 PM7/30/12
to phon...@googlegroups.com
Hi Arnold,

Officially, the playbook is not supported as a platform. Only the BB OS5/6/7 are at the moment. Having said that, there is hope one day that playbook will become supported and is pretty close to being so. 

- During a startup, a pop-up window saying: Error initializing Cordova: Class Device cannot be found
The device error issue was introduced in 2.0 but I implemented a fix not too long ago (last week). If you pull from the apache repo, you can get the fix that way or I can just send you the new js file. Whichever works better for you. 


- Beep and Vibrate not working
I don't think beep was implemented on PhoneGap's side and I believe there's no vibrate function on the Playbook.

- Geolocation not working - Code 3, Message: Timeout expired
This is where I say, "hey this was working before!?" I'll have to look into this to get it working again.

As an aside, webworks does offer it's own api that is accesible through JavaScript. If a particular class isn't working (i.e., geolocation) in PhoneGap, it might be useful to fall back on the webworks api: https://developer.blackberry.com/html5/apis/pb_index.html

- Has anyone developing a Playbook app with Phonegap.  Is it doable?
I haven't seen any examples in the wild since we don't officially support Playbook. I don't see why it isn't possible though. 

 - Since I am using Mac and has no vmware, is there other way to test it in simulation mode using like Ripple simulator?
I don't believe simulators can run on Mac's without vmware. You're basically down to testing on a real device or Ripple. 

- Last but not least, does someone know how to solve the Class Device error and is Geolocation going to work on Playbook.
I believed I answered these above :)

I hope that helps!
 
On Wednesday, July 25, 2012 6:11:43 PM UTC-7, Arnold Chang wrote:
Phonegap certainly evolves quickly and I noticed it just hitted 2.0 a few days ago. So I decided to give it a spin on my Blackberry Playbook.

It is a fairly straight forward task to try the given sample app on a real device.   I use OS-X and has no vmware so I just had to test it directly on my playbook

Here's what I found so far (Phonegap 2.0/Blackberry WebWorks 2.2.0.5):

- During a startup, a pop-up window saying: Error initializing Cordova: Class Device cannot be found
- Beep and Vibrate not working
- Geolocation not working - Code 3, Message: Timeout expired

A quick glaze and it seems other stuffs are working such as accelerometer, camera, file system.

I have a few questions and hopefully someone can shred some lights:
- Has anyone developing a Playbook app with Phonegap.  Is it doable?
- Since I am using Mac and has no vmware, is there other way to test it in simulation mode using like Ripple simulator?
- Last but not least, does someone know how to solve the Class Device error and is Geolocation going to work on Playbook.

Thanks in advance.

Tim

unread,
Jul 30, 2012, 4:45:20 PM7/30/12
to phon...@googlegroups.com
Just to add - I just tested geolocation on the latest playbook js file and it works. I guess you just needed the new one. 

Arnold Chang

unread,
Jul 31, 2012, 2:59:59 PM7/31/12
to phon...@googlegroups.com
Thanks for the info, Tim.  

I got the latest js file (Jul 24) and it solved the device error.  However, the geolocation timeout remains there.  Is there another change you haven't committed yet?  I really hope not to resort to Webwork as it is kind of defeating the purpose of using Phonegap in the first place.

Keep up the good work with the project.

Tim

unread,
Jul 31, 2012, 5:07:29 PM7/31/12
to phon...@googlegroups.com
Hrm - I'll have to investigate more into why the geolocation might be failing. I have a feeling that the default sample app that's shipped with the BB release can be a little wonky at times. Also, a lot of the PhoneGap calls point to the webworks api FYI. The added benefit of layering PhoneGap on top of Webworks is that all calls to PhoneGap remain the same which allows easier cross platform development (one of the main goes of PhoneGap). 

Tim

unread,
Jul 31, 2012, 5:08:22 PM7/31/12
to phon...@googlegroups.com
Er, *main goals 

Tim

unread,
Jul 31, 2012, 6:14:23 PM7/31/12
to phon...@googlegroups.com
Hey again,

Just tested it on my playbook on the sample page - seems to work okay for me. Just to make sure we're covering our bases here, are you inputting a number in the Timeout input field? Also, wifi connection is also needed for geolocation to work. 

Arnold Chang

unread,
Aug 1, 2012, 2:29:05 PM8/1/12
to phon...@googlegroups.com
Okay, I entered 15 to the time-out field and now I see the time-out pop-up window kicks-in later, look like the time-out mechanism is working but still fails to obtain geolocation data.

Just to clarify if I copied your JS file correctly, I replaced the one in /www/playbook/cordova-2.0.0.js. Do I need to replace the one in /lib/cordova.2.0.0/javascript/playbook/cordova-2.0.0.js as well?

FYI, my company is building a html5 app for iOS and Android using Phonegap.  I like to recommend including Playbook 2.0 and upcoming BB10 devices on the roadmap.  The only device-specific stuff I will be using is really GPS for some proximity searches. 



Tim

unread,
Sep 5, 2012, 8:24:37 PM9/5/12
to phon...@googlegroups.com
Sorry for not responding for a while there - I got a little busy and kinda put this problem on the back burner. 

Anywho, after some digging it appears that playbook's gps sometimes returns results in the span of 2-5 minutes which would explain the timeouts. 

I'm not sure if this is something that phonegap can fix, but I've created a sanity test app to display a gps result once it gets it (shouldn't timeout). 

Give that a run and see if gps actually works. Hopefully you can start tweaking your app once you get some meaningful results.

I hope that helps!

Arnold Chang

unread,
Sep 6, 2012, 5:29:04 PM9/6/12
to phon...@googlegroups.com
Thanks Tim,

I tested in office.  With wi-fi, I conducted 20 tests and first run took 37s and subsequent tests took 5-7s with two exceptions logged with ~15s.  Without wi-fi, it fell consistently within the 1-10s range in each test.

I modified to use Cordova 2.0 API and logged similar result.

In conclusion, the Cordova's example call 5000ms timeout is way too short.  With wi-fi connection, the first geo location takes up a much longer time. So I guess a one-minute timeout may do the trick.

Tim

unread,
Sep 6, 2012, 7:57:36 PM9/6/12
to phon...@googlegroups.com
Cool - thanks for testing this for me, Arnold. I'll update our docs with the findings. 

Tim

unread,
Nov 5, 2012, 6:41:13 PM11/5/12
to phon...@googlegroups.com
Hey Giovanni,

The error I listed above was for playbooks only. It seems like you're describing a problem regarding the phones (eg, bold 9000 or something), but is similar to the device error I mentioned. I usually do all of my testing on device but deployed from using this repo: https://github.com/apache/incubator-cordova-blackberry-webworks and not through build.

Let me check some stuff out and see if I can reproduce your errors using build and/or through that repo's tools. 



On Monday, November 5, 2012 10:36:34 AM UTC-8, Giovanni Sidoel wrote:

Hey Tim,

I've been going crazy lately trying to get my phonegap build app to work on BlackBerries. I kept getting "Error initializing Cordova: Unable to parse JSON string" on BB OS6 and "Error initializing Cordova: Undefined" on BB OS7. Then I came across your phrase "The device error issue was introduced in 2.0 but I implemented a fix not too long ago (last week).". And that made me feel a bit more sane. I think it's great that you've already implemented a fix, however I'm using phonegap build. With build you're supposed to remove cordova.js from your resources. And the build process seems to add a version of cordova that still has the bug in it.

If I test it with Ripple emulator and a reference to cordova-2.2.0.js the application works as expected. So 2.20 seems to have that bug fixed. But 2.2.0 is not yet supported in build. Using 2.1.0 or2.0.0 doesn't seem to make a difference.

Can you check if the bug is still implemented in phongap build? 
Reply all
Reply to author
Forward
0 new messages