Question

What is the logic behind cross mobile platform frameworks. lets take phonegap here. How phonegap is converting javascript call into native call. We can do that using plugins. I have done it using plugins also. I want to know the underlying logic behind converting javascript call into native call to have access to native controls.

Was it helpful?

Solution

For ios, the UIWebView component has a method called stringByEvaluatingJavaScriptFromString which provides a bridge between the native application and the javascript inside webview. With this method you can send messages to native functions from javascript. Actually, Phonegap's native functionality is based on this function.

For Android and other platforms, i'm sure there are similar functions that allow you to do the same thing, i haven't investigated them.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top