2014-01-07 62 views
0

我对混合移动应用程序有一些疑问;混合移动应用程序的API调用

1. Is the final output of a hybrid app same as native app (.app for IOS, .apk for Android) ? 
2. For a hybrid app, do we need 2-way communication between web portion and native portion of the app? I understand it would depend on the app, but am just asking a general question. 
3. What kind of calls are needed between native/web portion of the app? e.g. I think one would be that web portion can tell the native portion that it has loaded. Can you list down some other examples ? 
4. What is the role of a library like PhoneGap in a hybrid app ? 

回答

0

1-。混合应用程序的最终输出是否与原生应用程序(用于iOS的.app,.apk for Android)相同?

是,相同天然

2-。对于混合应用程序,我们是否需要在应用程序的Web部分和本机部分之间进行双向通信?我知道这将取决于该应用程序的 ,但我只是问一个普遍的问题。

的PhoneGap的/科尔多瓦API具有双向通信,网络部执行调用本机方法和本机方法的JS方法具有执行时,它完成一个JS方法回调(或在启动时和继续执行回调,直到完成)

3-在 应用程序的native/web部分之间需要什么样的调用?例如我想一个网络部分可以告诉已加载的本地部分 。你能列举一些其他的例子吗?使用了PhoneGap的/科尔多瓦API

4-是什么样的PhoneGap库的混合应用程序中的角色

什么?

它提供的API来执行本地方法

您可以检查的PhoneGap /科尔多瓦API here

+0

THX为...你说我们有专用的网络部分和本地部分之间的双向通信的应用程序....而且你还说PhoneGap API提供API来执行本地方法...因此对于混合应用程序,是否总是会让Web部分(JS调用本机方法)进行本地调用,并且我们有一个回调在网络端的帖子回应....但我们没有其他的方式(本地调用Web部分)? – testndtv

+0

是的,本机代码可以随时在cordova webview上执行JS代码,在iOS上你可以使用[cordovaWebView stringByEvaluatingJavaScriptFromString:“javascript here”];并在java中与cordovaWebView.loadUrl(“javascript here”); – jcesarmobile

相关问题