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

Web and WebWorks Development

Reply
Contributor
Posts: 14
Registered: ‎09-14-2012
My Device: Bold 9700

Newbie trying to develop using Phonegap

Hello,

I'm trying to develop my first client/server app on Blackberry.

I decided to use phonegap as apparently it would allow me to deploy that same app on different platforms.

I'm starting with BB as this is the device primarely used in our company.

 

The phonegap manual states that I have to launch a command: ant blackberry load-simulator

 

The simulator is loaded but the application is not there.

 

I suspect the cod file is not being generated, could you help me understand what did I do wrong?

 

Thanks,

Roberto.

Developer
Posts: 322
Registered: ‎08-06-2012
My Device: Dev Alpha / Playbook / Curve 9300

Re: Newbie trying to develop using Phonegap

What program are you using to develop in? (editor)

Are you using an emulator to test your apps?

Did you run any kind of compile?  I'm not familiar with phonegap and how it builds apps... is that command the one that builds the app, or deploys the app to the simulator?

If it helped you, click like. :smileyhappy:
Developer
Posts: 119
Registered: ‎05-27-2010
My Device: 9900

Re: Newbie trying to develop using Phonegap

[ Edited ]

Hello Roberto,

 

Indeed, if you could let us know a bit more which tools en development enviroments you might be using to create your PhoneGap app, we might be able to help out a little more.

 

It's worth a try to reenter the command after the simulator has started. In many cases the simulator takes so long to start that the program trying to uplaod the app has already stopped trying.

Reentering it would probably see the simulator already running and start deploying straight away.

 

If no .cod or .jad files can be foudn on your system, most likely not created. In that case you need to inspect more on the side of PhoneGap itself and less BlackBerry.

 

For a simulator no signing is required so you should be able to compelte it without getting your signing keys from RIM.

But to succesfully compile on a stand alone computer (e.g. Not using PhoneGap Build) you will need to install some binaries of BlackBerry, before you can succesfully compile an application to a cod/jad executable.

 

Hope this helps a bit.

 

p.p.s We're you succesful to create your hello world, using the getting started guide from PhoneGap: http://docs.phonegap.com/en/2.0.0/guide_getting-started_blackberry_index.md.html#Getting%20Started%2...

 

If that works you should be golden.

 

@reumerd-- @BBDevGroupNL -- about me
If you like it, LIKE it ;-) ----- If it's solved, press solved ! --- If you solved it yourself, please let us know! We might have the same problem!
Contributor
Posts: 14
Registered: ‎09-14-2012
My Device: Bold 9700

Re: Newbie trying to develop using Phonegap

Hello,

thanks for answering...

For the moment I haven't developed anything yet. I'm just trying to load the "hello world" program.

I do use the BB simulators (I tried the Bold 9900 and 9700).

ANT blackberry load-simulator is the command I'm told to execute in order to build and load the app in the simulator.

unfortunately whilst the simulator loads fine, the app is not there.

 

P.S.: PhoneGap is a framework that supposedly allows to develop multi-platform html5-based apps.

 

Here is the document I followed: http://docs.phonegap.com/en/2.0.0/guide_getting-started_blackberry_index.md.html#Getting%20Started%2... 

 

Thanks again for your interest.

Developer
Posts: 119
Registered: ‎05-27-2010
My Device: 9900

Re: Newbie trying to develop using Phonegap

Is there any else mentionned by the command line about waht it has been doing ?

 

I've used PhoneGap extensively (iOS, Android), but to be honost not for BlackBerry a lot. as I just port my HTML5 code into WebWorks from my PhoneGap project. I'm quite familiar with WebWorks and it has been easier and allowed me to have sometimes a bit more integration into the BlackBerry Platform.

 

Both FrameWorks are very much alike. If you're just Building a WebApp without any of the 'native' calls of PhoneGap, you can also just use WebWorks to compile your application. It would just be pointing to the right frameworks in Ripple.

 

But to gather a little more experience I'll try to take the time to also do the PhoneGap deployment for BlackBerry and let you know my results.

 

 

@reumerd-- @BBDevGroupNL -- about me
If you like it, LIKE it ;-) ----- If it's solved, press solved ! --- If you solved it yourself, please let us know! We might have the same problem!
Contributor
Posts: 14
Registered: ‎09-14-2012
My Device: Bold 9700

Re: Newbie trying to develop using Phonegap

Hello,

Thanks again for your interest, please see below the outcome of the ant command.

The solution you proposed for WebWorks sounds interesting: do you have any "getting started" document if possible with some references on how to consume webservices?

 

C:\Program Files (x86)\Cordova\lib\blackberry\sample>ant blackberry load-simulator
Buildfile: C:\Program Files (x86)\Cordova\lib\blackberry\sample\build.xml

blackberry:

load-simulator:

generate-cod-name:
     [echo] Generated name: cordovaExample.cod

clean:
   [delete] Deleting directory C:\Program Files (x86)\Cordova\lib\blackberry\sample\build

package-app:
    [mkdir] Created dir: C:\Program Files (x86)\Cordova\lib\blackberry\sample\build\widget
     [copy] Copying 8 files to C:\Program Files (x86)\Cordova\lib\blackberry\sample\build\widget
    [mkdir] Created dir: C:\Program Files (x86)\Cordova\lib\blackberry\sample\build\StandardInstall
      [zip] Building zip: C:\Program Files (x86)\Cordova\lib\blackberry\sample\build\cordovaExample.zip

build:
     [exec]
     [exec] C:\Program Files (x86)\Cordova\lib\blackberry\sample>"C:\Program Files (x86)\Research In Motion\BlackBerry 10 WebWorks SDK 1.0.1.17\dependencies\node\node.exe" "C:\Program Files (x86)\Research In Motion\BlackBerry 10 WebWorks SDK 1.0.1.17\lib\bbwp.js" "C:\Program Files (x86)\Cordova\lib\blackberry\sample\build\cordovaExample.zip" /o "C:\Program Files (x86)\Cordova\lib\blackberry\sample\build"
     [exec] [INFO]    Populating application source
     [exec] [INFO]    Parsing config.xml
     [exec] [ERROR]   Error: Please enter an author for the application

load-simulator:
     [echo] Simulator directory=C:\Program Files (x86)\Research In Motion\BlackBerry Smartphone Simulators 7.1.0\7.1.0.98 (9900)
     [echo] Simulator directory=C:\Program Files (x86)\Research In Motion\BlackBerry Smartphone Simulators 7.1.0\7.1.0.98 (9900)
     [echo] Simulator executable=C:\Program Files (x86)\Research In Motion\BlackBerry Smartphone Simulators 7.1.0\7.1.0.98 (9900)/9900.bat
     [echo] Closing all running simulators...
     [exec] No sessions currently running.
     [exec] Result: 1
     [echo] MDS directory=C:\Program Files (x86)\Research In Motion\BlackBerry Email and MDS Services Simulators 4.1.2\MDS

BUILD SUCCESSFUL
Total time: 19 seconds

Developer
Posts: 119
Registered: ‎05-27-2010
My Device: 9900

Re: Newbie trying to develop using Phonegap

I dont' see any particular erros in the ant command.

But there is the author element missing in the generated config.xml for the webworks packager.

 

As I don't have to much experience with the BlackBerry Packager for PhoneGap, I don't kmow what might go wrong.

 

If you want to consume webservcies in your PhoneGap app. Its just the same as normal WebServices. just use Ajax/XHR reuqests to pul them in and an XML or JSON parser to generate your HTML.

 

If you're also new to web development try w3cschools.com and try the examples there to learn more about them.

@reumerd-- @BBDevGroupNL -- about me
If you like it, LIKE it ;-) ----- If it's solved, press solved ! --- If you solved it yourself, please let us know! We might have the same problem!
BlackBerry Development Advisor
Posts: 624
Registered: ‎10-01-2009
My Device: Z10

Re: Newbie trying to develop using Phonegap

Hello,

 

Just curious if after building, you go to the directory "C:\Program Files (x86)\Cordova\lib\blackberry\sample\build\StandardInstall" are there any files in there?

Chad Tetreault | App Development Consultant | BlackBerry Developer Relations | developer.blackberry.com | @chadtatro
Contributor
Posts: 14
Registered: ‎09-14-2012
My Device: Bold 9700

Re: Newbie trying to develop using Phonegap

Nope, that folder is empty.

Do you know if I have to purchase something before being able to compile projects?

 

Thanks,

Roberto.

Trusted Contributor
Posts: 222
Registered: ‎03-03-2012
My Device: Ripple, LE Z10, Dev Alpha _C, Playbook, Bold 9900

Re: Newbie trying to develop using Phonegap

have you set up signing keys?