Search code examples
androidioscross-platformphonegap

Cross-platform app accessing platform components without PhoneGap


PhoneGap provides access to native platform functionality via JavaScript. The only solution I can think of is to use a local HTTP-Server as middleware. How does PhoneGap solve this problem?

I already searched alot and did not find anything.


Solution

  • Cordova use Plugins! Plugins comprise a single JavaScript interface along with corresponding native code libraries for each supported platform. In essence this hides the various native code implementations behind a common JavaScript interface.

    With simple echo plugin that passes a string from JavaScript to the native platform and back, one that you can use as a model to build far more complex features.

    for more information about how to develop a custom plugin please check https://cordova.apache.org/docs/en/latest/guide/hybrid/plugins/index.html