While working on PhoneGap Essentials, I got a chance to work with some mobile device platforms I’d not worked with before.  I did some work with webOS, but as soon as I got ready to write the chapter on webOS development for PhoneGap, HP announced it was killing the platform and the PhoneGap team added support for Windows Phone development. So, I whacked the webOS chapter and cheerfully replaced it with one on Windows Phone.

Another interesting one is Samsung bada, a ‘newer’ OS supposedly getting some traction in Europe and Asia. I covered the OS in PhoneGap Essentials, but since then Samsung’s thrown their hat in with another mobile platform called Tizen (ww.wikipedia.org/wiki/Tizen). There’s been some talk of backwards compatibility for bada applications in Tizen, so you should be OK with what you know about PhoneGap and bada.

What I learned while working on the bada chapter of the book is that there isn’t any useful information about how to build PhoneGap applications on bada. Not in the PhoneGap download, not on the PhoneGap Google Groups forums, not on the PhoneGap wiki. I’m trying to work through this for the book so the information in the bada chapter is complete, but I thought I’d fill you in on some of the problems today – knowing that they’ll be addressed by the PhoneGap development team as soon as they can. I just wanted to make sure you had this information since I just can’t find real information anywhere.

First of all, the PhoneGap download located here: http://phonegap.com/download-thankyouhttp://phonegap.com/download-thankyou doesn’t contain the code you need to build a bada application for PhoneGap. If you download the files from there and extract them on your hard drive then open the readme.md file in the bada folder, you will see something like this:{codecitation class="brush:text; gutter:false"}Steps to build a PhoneGap app
-----------------------------
1. Download Source Code (clone the repository)
2. Import in bada C++ IDE
3. Put your HTML/CSS files in the Res/ folder
4. Run phonegap.bat under Res/phonegap directory
5. Build&Run!{/codecitation}

What this is telling you is that even though there’s PhoneGap source code for creating bada applications in the download you just downloaded, you’ll have to go somewhere else to get the actual code you need. The instructions instruct you to import the sample bada project files into the bada IDE while the bada folder in the standard PhoneGap download doesn’t contain the project files. Instead of using the bada files from the PhoneGap download, you instead need to get them from the Apache Cordova (the latest name for PhoneGap) git repository here: https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-bada.git.
Once you download and extract the files, you’ll have the files you need to import the bada PhoneGap project into the bada IDE.

Before you can run the program though, there’s one more step you have to complete and this isn’t documented anywhere either. Open Windows Explorer (the bada stuff only runs on Windows) and navigate to the bada source folder you extracted. Within the Res/phonegap folder is the phonegap.bat file highlighted in the following figure. You must execute that batch file to generate the phonegap.js file used by the sample application. I don’t understand why you have to take this extra step, there’s no reason I can think of that would prohibit the PhoneGap team from generating this file in advance, but it is what it is.

 

If you later make any changes to the JavaScript source files shown in the figure, you can just rerun the batch file to generate a new phonegap.js file from your modified source.

At this point you are supposed to be able to fire up the bada IDE, import the project and get to work. At this point, I’ve not been able to make the project build and execute on the bada emulator, but I’m working on it and you’ll find the complete instructions in PhoneGap Essentials when it makes it to print.

If you did a quick Google search on PhoneGap and bada, toward the top of the search results should be the link to a PhoneGap bada tutorial here: http://groups.google.com/group/phonegap/browse_thread/thread/ee8dcd9ca0d2d792.http://groups.google.com/group/phonegap/browse_thread/thread/ee8dcd9ca0d2d792. Unfortunately those instructions didn’t work for me. I followed the instructions to the letter and I got an application, but not one that would use any of the PhoneGap API’s. The tutorial instructs you to build a bada web application to use with the PhoneGap API’s, but if you look at the source code folders in the bada PhoneGap download, you’ll see a bunch of C++ library files – which implies that it’s not a web application, but instead a C++ application that the PhoneGap application runs within. Supposedly there are complete instructions available for how to do this, but I have not been able to get my hands on them. If you know how to make the instructions in this tutorial work, please let me know because I cannot.

I’m still working through this and will update you when I have it working. Stay tuned.

Overall Rating (0)

0 out of 5 stars

Post comment as a guest

Attachments

Location

Share:
Rate this article :
0

People in this conversation

  • Guest - flowschi

    Hi. :)<br /><br />I'm a newbie, just started bada and phonegap yesterday. Using IDE 2.0.4 I am facing the same problem. Following your instructions, I was able to build and start the application in the emulator and on my device (S8500).<br /><br />Additional steps needed for me:<br /><br />- Project properties, bada Build -> setting "SDK root" to the path of SDK 2.0.4<br />- Project propteries, C/C++ Build, Configuration: It's saying Simulator-Debug is an orphaned configuration. I am not sure what to do here, I just set it to "Target-Debug".<br /><br />Running the project as bada Emulator Application or bada Target Application will at least start the application in both ways.<br /><br />The "PhoneGap Sample" shows up, but clicking any of the buttons results in an "URL not available" at device/emulator and in the follow message in the IDE's output:

    Short URL:
  • Guest - flowschi

    Saying "comment too long", even there were "8 symbols left", I had to split my message. Error message:<br /><br /><br /><br />0101.598,EXCEPTION,P32,T00,A125,Osp::Web::Controls::__WebService::AddMessageToConsole (3943) > ReferenceError: Can't find variable: PhoneGap at line 1 loaded from file gap://com.phonegap.Accelerometer.getCurrentAcceleration/com.phonegap.Accelerometer.getCurrentAcceleration0/<br /><br /><br />Any ideas? :)

    Short URL:
  • Guest - John Wargo

    I'm sorry - I can't help you on this one. You've got to run this one through the PhoneGap developer forums. I'm no bada expert, still trying to get this to work myself (which was the whole point of the blog post I made here)

    Short URL:
  • Guest - Nilesh

    Hey Guys,<br /><br />I'm new in bada, I tried phoneGap with bada i'm able to compile & run successfully but giving some error while running the app.<br /><br />Thanks,<br />Nilesh

    Short URL:
  • Guest - Nilesh

    I'm also getting same error<br /><br />Thanks.,<br />Nilesh.<br /><br />

    Saying "comment too long", even there were "8 symbols left", I had to split my message. Error message:<br /><br />0101.598,EXCEPTION,P32,T00,A125,Osp::Web::Controls::__WebService::AddMessageToConsole (3943) > ReferenceError: Can't find variable: PhoneGap at line 1 loaded from file gap://com.phonegap.Accelerometer.getCurrentAcceleration/com.phonegap.Accelerometer.getCurrentAcceleration0/<br /><br />Any ideas? :)

    Short URL:
  • Guest - Hexodus

    Seems that the bada tutorial link doesen't work any more 404 error is being displayed.

    Short URL:
  • Guest - John Wargo

    That was posted a long time ago and the web site has been updated. Apparently the bada stuff has been removed from both the Cordova and PhoneGap web sites. Here's the latest platform guides: http://cordova.apache.org/docs/en/3.0.0/guide_platforms_index.md.html#Platform%20Guides

    Short URL: