简体   繁体   English

带有webkit的iPhone本机应用程序和PhoneGap之间的区别?

[英]Difference between iPhone native app with webkit and PhoneGap?

When utilizing PhoneGap vs. an Objective-C based iPhone app (ie native app) making webview calls that load html/js/css content, what are the key differences? 当使用PhoneGap与基于Objective-C的iPhone应用程序(即本机应用程序)进行webview调用以加载html / js / css内容时,主要区别是什么?

Does PhoneGap make uiwebview ? PhoneGap可以制作uiwebview吗? From my understanding of PhoneGap, it does but I am looking for clarification. 从我对PhoneGap的理解来看,确实可以,但是我正在寻求澄清。

Ultimately, I would like to build a hybrid iPhone application, utilizing both Objective-C and html/js/css? 最后,我想建立一个混合的iPhone应用程序, 同时利用Objective-C和HTML / JS / CSS? An appealing approach is to utilize Objective-C to communicate with a server in the background and utilize html/js/css to build the view. 一种吸引人的方法是利用Objective-C在后台与服务器通信,并利用html / js / css构建视图。

The key difference between a PhoneGap app vs an Objective-C based application making webview calls is the library of javscript functions PhoneGap offers to utilize native functionality without needing to write native Objective-C code. PhoneGap应用程序与进行webview调用的基于Objective-C的应用程序之间的主要区别在于,PhoneGap提供的Java脚本功能库可利用本机功能, 无需编写本机Objective-C代码。

You are absolutely correct that PhoneGap utilizes the UIWebView class within the iOS library but keep in mind the appeal of PhoneGap is the ability to utilize a single code base on multiple platforms . 您绝对正确,PhoneGap利用iOS库中的UIWebView类,但请记住,PhoneGap的吸引力在于能够在多个平台上使用单个代码

Hybrid Objective-C and html/js/css applications are indeed possible with PhoneGap. 确实可以使用PhoneGap混合使用Objective-C和html / js / css应用程序。 If you check out what PhoneGap generates for the iOS platform, it is simply a template application with plenty of Objective-C and you simply need to make a flow that achieves the desired structure of your application. 如果您查看PhoneGap为iOS平台生成的内容,那么它只是具有很多Objective-C的模板应用程序,您只需要进行一个流程即可实现所需的应用程序结构。

Keep in mind though, the biggest appeal to PhoneGap is the ability to build cross platform apps with a single code base. 但是请记住,PhoneGap的最大吸引力在于能够使用单个代码库构建跨平台应用程序。 Everything you write in Objective-C will need to be written again if you wish to launch on Android or WindowsPhone. 如果要在Android或WindowsPhone上启动,则需要再次编写在Objective-C中编写的所有内容。

Other Notes 其他注意事项

You may also want to check out jQueryMobile , it a really great mobile web framework that works well with PhoneGap. 您可能还想看看jQueryMobile ,它是一个非常出色的移动Web框架,可以与PhoneGap很好地配合使用。 There is a chapter in Master Mobile Web Apps with jQuery Mobile that outlines this fairly well. Master Mobile Web Apps和jQuery Mobile中有一章对此进行了很好的概述。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM