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
Developer
huddarveena
Posts: 103
Registered: ‎12-12-2011
My Device: Developer
My Carrier: Robosoft
Accepted Solution

Integration of BlackBerry java code with Phonegap.

Hi all,

          I am not sure whether I am asking a right question, as I am new to Phonegap development, knowing nothing about it.

          I want to know how do we integrate BlackBerry java code with Phonegap code, in specific, how a screen be pushed using the Phonegap code? Do provide me a solution, thanq.

Please use plain text.
BlackBerry Development Advisor
bryanhiggins
Posts: 190
Registered: ‎12-18-2012
My Device: Z10, Q10, Q5, Z30, Z3
My Carrier: Bell

Re: Integration of BlackBerry java code with Phonegap.

Hi,

 

Getting started guides for cordova (the project on which PhoneGap is based) are located here:

 

http://docs.phonegap.com/en/2.4.0/guide_getting-started_blackberry_index.md.html#Getting%20Started%2...

 

Here are the docs for creating Java based plugins for BBOS (versions 5 - 7).

 

http://docs.phonegap.com/en/2.4.0/guide_plugin-development_blackberry_index.md.html#Developing%20a%2...

 

For most apps, there is no need to develop plugins with Java. Your screens should be based on HTML and JavaScript.

 

Keep in mind the advantage of using cordova is to target multiple platforms (BBOS, BlackBerry 10, iOS, android and others). You will still need to install the BlackBerry WebWorks SDK. 

 

Hope this helps.

Bryan Higgins
BlackBerry WebWorks
@bryanhiggins
Please use plain text.
Developer
huddarveena
Posts: 103
Registered: ‎12-12-2011
My Device: Developer
My Carrier: Robosoft

Re: Integration of BlackBerry java code with Phonegap.

Thank you so much, I had found the docs but was not sure whether i was in a right path. Thanks for the answer.

Please use plain text.
Developer
huddarveena
Posts: 103
Registered: ‎12-12-2011
My Device: Developer
My Carrier: Robosoft

Re: Integration of BlackBerry java code with Phonegap.

Hello, I tried following the guide for Plugin development using the "Echo" sample code available. I did everything according to the steps given in guide. I don't have any knowledge about the java script, so I am not able to understand what exactly is being done in the following code and how the result returned by exec() method in Echo.java be processed, to confirm on whether the control is passing to exec() in Echo.java.

 window.echo = function(str, callback){
        cordova
.exec(callback,function(err){
            callback
('Nothing to echo.');
       
},"Echo","echo",[str]);
 
};

Do please tell me how to proceed with this. Thanks in advance.

Please use plain text.
Developer
huddarveena
Posts: 103
Registered: ‎12-12-2011
My Device: Developer
My Carrier: Robosoft

Re: Integration of BlackBerry java code with Phonegap.

I could successfully create BlackBerry plugin to communicate between javascript and native BlackBerry code. But now I wanna access a variable declared in native code in the javascript. Can anyone tell me the way of aceesing java variable in javascript? Thanks in advance.

Please use plain text.