如何连接到使用PhoneGap的在Android开发服务器? [英] How to connect to the server in android development using Phonegap?

查看:148
本文介绍了如何连接到使用PhoneGap的在Android开发服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新的移动开发。我与Android项目与PhoneGap的发展给出。我刚才在成功安装Eclipse的PhoneGap。现在我想知道用PhoneGap的发展是否允许使用PHP服务器的通信。

I am new to mobile development. I am given with an Android project to develop with PhoneGap. I have just successfully installed PhoneGap on eclipse. Now I am wondering whether development with Phonegap allows server communication with php.

我基本上是一个Web开发PHP与MySQL的中级知识。我知道,移动设备比台式机/笔记本电脑速度较慢,最有可能较慢的带宽连接。在这种情况下,将在使用PHP作为一个服务器端语言和MySQL作为我的首选数据库是有效的?

I am basically a web developer with intermediate knowledge of PHP and MySQL. I am aware that mobile devices are slower than desktops/laptops and most likely to have a slower bandwidth connection. In this case, will this be effective to use PHP as a server side language and MySQL as my choice of database ?

在Web应用程序,我用来创建一个包含文件,页眉和页脚的页面。包括与服务器连接code,与页眉和页脚与页脚内容的js和css文件JS和CSS链接头文件的文件。我最希望的网络开发者在这里做同样的。可这种方法与PhoneGap的移动应用程序中使用呢?

In web applications, I used to create an include file, header and footer pages. Include file with server connection code, header file with js and css links for the header and footer with js and css files for the footer content. I hope most of the web devs here do the same. Can this method be used with phonegap mobile applications as well ?

我也搜索在互联网上找到我的问题的解决方案,但我无法找到具体的或特定的解决方案这样的东西。

I did searched over the internet to find a solution for my questions, but I couldn't find anything specific or particular solution for this.

请注意 - 我正在上的移动应用项目需要到服务器的联系非常频繁,因为它是一个购物网站,我将使用jQuery Mobile的应用程序界面

Note - The mobile application project I am working on requires to contact the server very frequently as it is for a shopping portal and I am going to use Jquery Mobile for the application UI.

推荐答案

您将无法让PHP在你的PhoneGap的应用程序。不过,您可以调用的.php是你的服务器上找回数据的页面。你让一个Ajax请求,并通过JavaScript手的结果。使用jQuery在我看来是最容易的。看看文档和例子这里。例如在底部的所有道路。

You will not be able to have PHP in your phonegap application. You can however, call .php pages that are on your server to get data back. You make an ajax request and hand the results via javascript. Using jQuery is the easiest in my opinion. Take a look at the docs and examples here. Examples are all the way at the bottom.

这篇关于如何连接到使用PhoneGap的在Android开发服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆