How can I develop applications that call my self c/c++ library API in KaiOS

165 views Asked by At

I know KaiOS application usually developed by html/js/css, but I develop some special functions that is not exist in the current Web API, so I develop the API of the special functions using C/C++, and now, I want to define JS API to call the C/C++ API, how should I do it? is there some document about it?

2

There are 2 answers

0
pelya On

You need to compile your C/C++ files to JS using Emscripten, then call your functions using this Emscripten API:

https://emscripten.org/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.html

0
Arkaneel On

Now KaiOS 3.0 supports webassembly as the b2g is updated to Firefox 54 You can convert the file to webassembly using emscripten with highest optimisation to run C/Cpp/Java/python/Go/Rust in KaiOS.