语言

Menu
Sites
Language
Call C++ from Java script

Hi Everyone,

I want to call some library fuctions written in C++ from web application i. e. java script,

Which one is best way in Tizen?

and How this c++ to java script mapping is done in Tizen Architecture?

In android they used JNI, with Tizen also any such kind of layer is available?

Any body is having information of idea please share.

Thanks in advance.

 

Thanks

Dinesh

编辑者为: Brock Boland 17 3月, 2014 原因: Paragraph tags added automatically from tizen_format_fix module.

响应

6 回复
john Smith
Hi, In Tizen SDK you can find a class "Tizen::Web::Controls::IJavascriptBridge" where you can call javascript.For more you can refer to the link https://developer.tizen.org/help/topic/org.tizen.native.apireference/classTizen_1_1Web_1_1Controls_1_1IJavaScriptBridge.html
Dinesh Rout
Hi John, Thanks for your response, This seems it will call JavaScript code from Native App, correct me if I am getting it incorrect, But I want to call C++ code from Java Script (Web app to My own library written in C++). java Script -- > C++ any idea is welcome. Please suggest me. Thanks in advance.
Paul Plaquette
You should have a look at NPPlugin Sample application. it is about using NPRuntime (NPAPI) https://developer.tizen.org/help/index.jsp?topic=%2Forg.tizen.web.appprogramming%2Fhtml%2Fsample_descriptions%2Fnpplugin.htm (note : I never succeeded to find the source code for the embedded native plugin, from javascript side, the object is loaded from the HTML code using the tag object with id="NPPluginMatrix" ) Cordially.
Lakshmi Grandhi
More information about how to create NPP Plugin is available in https://developer.mozilla.org/en-US/docs/Gecko_Plugin_API_Reference Thanks Lakshmi
newbee
Hello Dinesh, are you able to succeed in making calls from c++ <-- > javascript both ways. If yes, please let me know how to do that. i was following the same link mentioned by john, but not able to get any notifications in either way. Here is the error log when I try to follow the help in the link.(Tesing in sdk2.1 emulator) 07-04 19:29:57.899 : ERROR / Tizen::Web::Controls ( 12258 : 12258 ) : Tizen::Web::Controls::IJavaScriptBridge* Tizen::Web::Controls::_WebImpl::FindJsInterface(const Tizen::Web::Json::IJsonValue*) const(3519) > [E_OBJ_NOT_FOUND] Propagating. 07-04 19:29:57.899 : ERROR / Tizen::Web::Controls ( 12258 : 12258 ) : virtual result Tizen::Web::Controls::_WebImpl::OnHandleJavaScriptRequestByEventArg(const Tizen::Base::Runtime::IEventArg&)(4215) > [E_OBJ_NOT_FOUND] JsInterface instance is not available.
Nikolay Syedin
Faced the same problem. May be someone solved?