javascript Phone Gap 是否能够将 php 网络应用程序转换为 iphone/android 应用程序?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6634933/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 21:20:49  来源:igfitidea点击:

is Phone Gap capable of converting a php web app into an iphone/android app?

javascriptiphoneandroidhtmlcordova

提问by WebDeveloper

Does anyone use PhoneGap?

有人用PhoneGap吗?

I have a php app which uses ajax to receive json data. This technology called PhoneGap http://www.phonegap.com/, is it able to convert my php app into an iphone/android app?

我有一个 php 应用程序,它使用 ajax 来接收 json 数据。这项名为 PhoneGap http://www.phonegap.com/ 的技术,是否能够将我的 php 应用程序转换为 iphone/android 应用程序?

I know that if it is simply a javascript / html / css app that does not require server side technologies Phone Gap is capable.

我知道如果它只是一个不需要服务器端技术的 javascript / html / css 应用程序,Phone Gap 是有能力的。

However I definitely require the internet access and ajax connection to online web services.

但是,我绝对需要 Internet 访问和 ajax 连接到在线 Web 服务。

回答by CommonsWare

Does anyone use PhoneGap?

有人用PhoneGap吗?

Yes.

是的。

is it able to convert my php app into an iphone/android app?

它能够将我的 php 应用程序转换为 iphone/android 应用程序吗?

PhoneGap does not "convert" anything. Youcan convert your "php app into an iphone/android app", and PhoneGap might be part of your solution.

PhoneGap 不会“转换”任何东西。可以将“php 应用程序转换为 iphone/android 应用程序”,PhoneGap 可能是您解决方案的一部分。

You would start by getting rid of all the "php" -- if your "app" can run purely in a browser using local storage, it will almost assuredly work with PhoneGap. PhoneGap also supplies some PhoneGap-specific JavaScript APIs, which you may or may not need.

您将从摆脱所有“php”开始——如果您的“应用程序”可以纯粹在使用本地存储的浏览器中运行,那么它几乎肯定可以与 PhoneGap 一起使用。PhoneGap 还提供了一些特定于 PhoneGap 的 JavaScript API,您可能需要也可能不需要。

However I definitely require the internet access and ajax connection to online web services.

但是,我绝对需要 Internet 访问和 ajax 连接到在线 Web 服务。

PhoneGap neither helps nor hurts here. PhoneGap wraps around the Android WebViewwidget, which is itself based on WebKit, the same rendering engine used by Chrome, Safari, etc. If, after you get rid of your "php", your "app" works in Safari and Chome, it should work as "an iphone/android app" with PhoneGap, with some adjustment to your HTML/CSS/JS to deal with smaller screen sizes, touchscreens, etc.

PhoneGap 在这里既没有帮助也没有伤害。PhoneGap 围绕着 AndroidWebView小部件,它本身基于 WebKit,与 Chrome、Safari 等使用的渲染引擎相同。使用 PhoneGap 作为“iphone/android 应用程序”工作,对您的 HTML/CSS/JS 进行一些调整以处理较小的屏幕尺寸、触摸屏等。