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

Java Development

Reply
Regular Contributor
Posts: 74
Registered: ‎12-30-2010
My Device: Blackberry Bold 9700
My Carrier: Vodafone.

Execute native function from BrowserField

hello friends., in my application i used browserfield2 for display web Pages ., in web pages contain javascript code ., So is it possible to call native function from JavaScript which is in my webpages......?
Thanks .,
Nilesh .
BlackBerry Development Advisor
Posts: 15,727
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Execute native function from BrowserField

You can create JavaScript extensions that call Java APIs, and use those JavaScript APIs in your BrowserField2 application.  Read this for more information.

 

Using JavaScript extensions

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Regular Contributor
Posts: 74
Registered: ‎12-30-2010
My Device: Blackberry Bold 9700
My Carrier: Vodafone.

Re: Execute native function from BrowserField

Thanks for reply.,

 

i'm not using webworks ... i'm using native java ...

please give me any sample code ...

Thanks .,
Nilesh .
BlackBerry Development Advisor
Posts: 15,727
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Execute native function from BrowserField

WebWorks is Java under the covers.  The SDK packages web assets and uses them from a BrowserField2.  

 

FYI there is a WebWorks build option that will provide you with the .java source files it generates for your application.

 

JavaScript extensions can be used in a full Java application as well.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Regular Contributor
Posts: 74
Registered: ‎12-30-2010
My Device: Blackberry Bold 9700
My Carrier: Vodafone.

Re: Execute native function from BrowserField

thanks for correct me...

i need to read regarding web works ...

Thanks .,
Nilesh .
Developer
Posts: 103
Registered: ‎12-12-2011
My Device: Developer
My Carrier: Robosoft

Re: Execute native function from BrowserField

Hello @nyerunkar, did u find solution to the question asked about executing native from BrowserField? If found any solution kindly guide me with the same, as I too have same requirement. Thanks in advance.