- 要将PHP页面转换为HTML页面,请删除对PHP和服务器的所有引用。
- 将 *占位符* 插入到您想要的网页上的那些位置
- 将支持的PHP系统转换或复制到系统。
- 使用JQuery或等同于(XmlHTTPRequest,Web Sockets等)与后端服务进行通信。
- 将服务器响应(通过JQuery)插入 *占位符* 。
:最佳做法是在手机上存储所有assest(javascript,css,字体,图片等)。您还可以使用storageLocal,SQLite或IndexedDB本地存储一些数据。服务器服务属于服务器 - 最佳做法是不直接与SQL服务器通信。 (但是很多人通过在互联网上通过SQL语言来做这个危险的方式 - 而不是最佳实践。)
有问题吗?请在一个approriate论坛。这里是。我推荐
Is it possible to convert a PHP web application to a phonegap android application. If yes, what will be the easiest method for doing it..?
From the Phonegap FAQ
- To convert PHP pages to HTML pages, remove all references to PHP and the server. All services (including MYSQL) will be on the backend (via jquery or equivalent).
- Insert *placeholders* into those places on the webpage that you want to insert data.
- Convert, or replicate, your supporting PHP system into a REST API system.
- Use JQuery or equivalent to (XmlHTTPRequest, Web Sockets, etc) to communicate with backend services.
- Insert Server responses (via JQuery) into the *placeholders*.
NOTE: Best practice is to store all assest (javascript, css, fonts, images, etc.) on the mobile. You can also use storageLocal, SQLite, or IndexedDB to store some data locally. Server services belong on the server - it is best practice not to talk to the SQL server directly. (But many people do it the dangerous way by talking SQL over the Internet - not best practice.)
Any question? please ask at an approriate forum. Here is a list. I recommend Google Group of Cordova/Phonegap
这篇关于将PHP网站转换为Phonegap应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!