Android:从服务器提取数据?
我是客户端/服务器应用程序的新手,但我对应用程序有一个想法,但需要一些关于如何实现它的想法。我希望用户能够提交帖子,服务器将存储它。其他用户也可以提交帖子...然后可以将帖子视为从服务器更新的列表。使用 android 实现此目的的最佳方法是什么? JSON? SQL?你发现什么是容易的?谢谢任何建议!
I'm a newbie when it comes to client/server apps but I have an idea for an app but need a few ideas on how to implement it. I want users to be able to submit say a post and the server would store it. Other users will be able to also submit posts...the posts will then be able to be viewed as a list updated from the server. What is the best way to ndo this with android? JSON? SQL? What have you found easy? Thanks any suggestions are much appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用特定于应用程序的服务编写服务器组件,例如创建帖子、检索所有帖子等。JSON 是一个简单且不错的选择。
使用
DefaultHttpClient
或AndroidHttpClient
通过 HTTP 与服务器通信:使用
org.json
包创建请求并解析响应:这些包和类基本上在所有 Android 设备上都可用,并且它们相当容易使用。
Write a server component with your app-specific services, such as creating a post, retrieving all posts, etc. JSON is a simple and good choice.
Use
DefaultHttpClient
orAndroidHttpClient
for communicating with your server via HTTP:Use the
org.json
package to create requests and parse responses:These packages and classes are basically available on all Android devices, and they are fairly easy to use.
除了 Jackson 和 执事
Everything is built into Android SDK except Jackson and Deacon