How to create BlackBerry WebWork PhoneGap project in eclipse?


Hi friends,

Nice to Inform you that I’ve stated working on PhoneGap for my new BlackBerry Project.

To get first running project, it took lots of time. So I decided to post on this process.

Basically you should follow steps from this official site, But in my case, it was a different experience.

I prefer to use eclipse for each project, so here also we need eclipse.
Get the BlackBerry extension(here) and Web Work extension (here).

Now open eclipse, go to create new project, and selec BlackBerry Web Works project.

Type name, and then finish

After finishing, it prompt me this error

Press ok, To build a project you need to have project.properties file in your project directory, but it is not created, so you just copy this file from sample phoneGap project (available in phonegap zip)

Copy and paste above file into you project directory:

Just copy is not enough, you need to update the path for the BlackBerry WebWork Project EXE. Open this file in text editor, we need to update the path for bbwp.dir as we will compile this project in eclipse. New path should point to bbwp.exe file. To find this file, go to eclipse installation directory, then plugins, then look for the directory with the name “net.rim.browser.tools.wcpc”, and then wcpc.

Update the file with new path:

Now refresh you project, but hey, it still display this error 😦

Right click on you project, and open project properties, then select “Project facets”

REMOVE any selection if you find, (in my case, “Static web module” was selected).

Now this removes the error from our web work project, but our project still missing PhoneGap library.

First you need to build PhoneGap Web work project with ant build, and create a jar file. To do so please follow steps from here. Starting from the Ant installation to creation of sample project.

After building source code, you will get new files, as shown here:

Copy all these files and paste to you project directory. Over right files if exists.

Now refresh you project, and try to run it, This should work. Please see following file structure, each PhoneGap project should have these kind of structure.

After running this project, you should see PhoneGap sample application,

After closing this application in simulator, you can again find it in “Downloads”! I wasn’t knowing about this, and tried a lot to search where my app! Hope you don’t waste you time!!

Hurray!! Now just start creating HTML pages with jQuery Mobile and you can build good apps…

I’ll post more on BlackBerry Web Work + PhoneGap as I proceed. Enjoy mobilisum!

If you like my work, then please buy me a Coffee!

Advertisements

31 thoughts on “How to create BlackBerry WebWork PhoneGap project in eclipse?

  1. Hi Vikas,

    Thank you a lot for this good tutorial.
    But I’m still having issues with that one:
    I can run the application but the app seen in the simulator is not the PhoneGap Example, but the base example with “MyTitle”.

    Are you sure that copying the “www” folder content, should be enough to have this sample working? because the MyApp.java and MyScreen.java files are not changed.

    1. I am confused with your requirement, if you want to load external url into your blackberry application then you don’t need these steps, your project type will be normal blackberry application. then take webkit object, and load external url (I guess this would be the steps, as I’ve done same thing in Android). Creating a Phonegap Application will be different. in that.. let me tell you in deep.. PhoneGap has the same thing like above mentioned steps. It has only one screen with webbrowser, then it loads html pages from our assets or www folder. But here a restriction is, you don’t have java code. every thing will be done with javascript api. Understood?

  2. Hi Vikas,
    Thank you very much for your good tutorial.. Waiting for your next posts using phpnegap with Black berry..

    1. Thanks for your kind words, I had already created and published a PhoneGap application with BlackBerry OS 5.0 and 6.0 with jQuery Mobile as touch framework.
      Do let me know if you discover some good new things… I am always eager to learn new things..

  3. HI sir,
    I have one question I want to add java class in blackberry phonegap web works project that is possible or not if possible means how,
    please give me a solution

    1. You may need to update the PhoneGap source code. Take one existing method. Observe how it is accessible through js api. And then try to implement your own method / class.

  4. Hi Vikas…..
    Can u pls help or explian me in detail to create new plugins in blackberry+phonegap?
    actually I want to use java class file in my blackberry+phonegap Application..
    Awaiting for ur positive response….

  5. Thank a lot. This link is very help to new comer who don’t know any thing about BB environment setup. Keep helping 🙂

  6. Hi,
    I have a sample 4 pages app on android containing just html pages. I want to make the same android app run on blackberry device. I have installed eclipse and phonegap.My Sample BB app is running on BB device but not the html files which I want (From my sample app). I am working on MAC. Do I need to code each html file again? and Where should I keep my code files?

    Please help me

  7. Really liked your post, using it i could successfully integrate phonegap with BB, Gr8 work, Keep it up…

  8. BUILDING WebWorksHelloWorld
    cmd.exe /c bbwp D:\Nazmul\BlackBarry\project\WebWorksHelloWorld\build\WebWorksHelloWorld.zip /o D:\Nazmul\BlackBarry\project\WebWorksHelloWorld\build
    [INFO] Parsing command line options
    [INFO] Parsing bbwp.properties
    [INFO] Validating application archive
    [INFO] Parsing config.xml
    [WARNING] Failed to find a element
    [WARNING] Failed to find the element
    [INFO] Populating application source
    [INFO] Compiling BlackBerry WebWorks application
    Exported static routine: .main(String[]) is multiply defined.
    Exported static routine: .main(String[]) is multiply defined.
    Exported static routine: .main(String[]) is multiply defined.
    net.sf.antcontrib.AntContribVersion: Error!: Missing stack map in: at label: 30
    [ERROR] RAPC exception occurred
    BUILD EXITED WITH 1 ERROR
    ****************************************

    what is my problem ?
    plz help me ……..
    thnx

  9. Hi vikas, i am new in phonegap blackberry .. i had gone through this tutorial but i could not able to see images in boxes…. plz help me because because images i will not able to undersatnd it…..

    thanks is advance…

  10. hi vikas i m new with phonegap .. and this page will be very helpful for me… please provide me full tutorial with images…coz right now not able to see images….

    thanks in advance….

  11. Hi Vikas,

    I want to integrate facebook share in my blackberry app using PhoneGap and it should be like inapp..I could not get it done..Please help me..

  12. i am unable to download the blackberry webworks sdk. Please someone give me a zipped file here to download. Thanx in advance!

  13. i have a problem… it’s not work when i’m used web work for running bb… how to used running web work for bb?? i hope u can help me….:)

  14. hey vikas, i just want to ask you..
    how to configure between Blackberry WebWorks with eclipse? i have been try file –> new project, but there is no option “blackberry webworks project”. I also want to build a application using phonegap.. do you know about my problems? thanks before..

    -Bima

    1. Hi vikas,

      I am also trying to configure Blackberry WebWorks with eclipse, But not succeeding.
      I would like to build the phone gap app on black berry web works + eclipse.

      @Bima, Did you get any option to configure .

      Could you please advice options .

      -Lingaiah

    2. Hi Bima ,
      We are facing the same problem. If you have set up or work around about the configuration.
      Could you please let us know the options.

      -Regards,
      Lingaiah S

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s