Android应用程序开发和Web服务器交互 [英] Android App Development and Web Server Interactions

查看:241
本文介绍了Android应用程序开发和Web服务器交互的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚学关于Android开发这样原谅我,如果这是一个有点过性的。 我想使一个应用程序,从我的网站数据库进行交互,在一定意义上的两件事情将其中喂对方。所以这一点。我试图找出最新最好的方式与我的服务器进行交互。我不想要一个应用程序多数民众赞成在浏览器般的环境我想dev下一个完整的应用程序,独立只能共享数据库和类似功能的网站的应用程序。因此,这将是我最好的方法呢?

I am just learning about Android Development so excuse me if this is a bit off in nature. I am wanting to make an app that interacts with a Database from my website, in a sense the two things will be one feeding the other. So with that. I am trying to figure out whats the best way to interact with my server. I don't want an app thats an app in a browser like environment I want to dev a full app that works independently of the site only sharing the DB and like features. So what would be my best approach?

正在建设的应用程序,因此它可以发布/获取到PHP文件的服务器通过JSON / XML我最好还是最安全的赌注交互基本上或有更好的方法,将应用程序连接到服务器的数据库,不需要我打开数据库的任何IP发出的请求。

Is building the app so it can post/get to php files on the server interacting basically through JSON/XML my best and or safest bet or is there a better approach that connects the App to the servers Database that doesn't require me to open the database to any ip that makes a request.

只是看看这里的意见和建议。我想每个人都谁去看到这个熟悉Android开发和最佳实践的地方,我可以和有冲浪博客和一切,但舆论似乎是50/50哪个是最好的。

Just looking for opinions and suggestions here. I figure everyone who's going to see this is familiar with Android development and best practices where as I could and have surfed blogs and all else but the opinion seems to be 50/50 as to which is best.

推荐答案

我们已经发现,提供一个适当的REST风格的Web API,它击中的任何一种语言,你选择后端数据库(无论是PHP,回报率,等等)提供任何使用次数的一个有用的接口(自己的网站,移动应用程序等)。

We've found that providing a proper RESTful web API that hits the database on the backend in whatever language you choose (be it PHP, RoR, whatever) provides a useful interface for any number of uses (your own website, mobile apps, etc).

然后,它是你的Andr​​oid应用程序的问题与REST的API,这仅仅是HTTP请求进行交互。这些可以被封装在辅助类,使他们简单的为好。

Then it's a matter of your Android app interacting with the RESTful API, which is simply HTTP requests. Those can be encapsulated in helper classes to make them straightforward as well.

这篇关于Android应用程序开发和Web服务器交互的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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