获得从PHP服务器映像到Android [英] Get images from PHP server to Android

查看:185
本文介绍了获得从PHP服务器映像到Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是原型的Andr​​oid应用程序,需要从Web服务器到Android的ListView获得的图像。我理解的东西的Andr​​ ?? oid侧(虽然我还没有实现和测试),通过这个线程<一个href="http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview">Android - 如何做我做的ListView图像的延迟加载

I am prototyping an android application and need to get images from a web server to Android ListView. I understand the android side of things (although am yet to implement and test) via this thread Android - How do I do a lazy load of images in ListView

我需要它的PHP /服务器端帮助。需要被填充在列表视图中的特定的图像将被动态地决定(那些具有给定的标记的图像)。我是新来的Web应用程序,但已经成功地建立了一个网络服务器,可运行PHP脚本。

I need help with the PHP/server side of it. The particular images that need to be populated in a list view will be decided dynamically (those images that have a given tag). I am new to web applications but have managed to set up a web server which can run PHP scripts.

1)的Andr​​oid决定哪些标签检索。使HTTP连接,并呼吁给定的变量作为参数的PHP脚本。

1) Android decides which tags to retrieve. Makes an HTTP connection and calls a PHP script with the given tag as a parameter.

2)的PHP脚本查找该标签的MySQL数据库,决定图像的ID上传,这是存储在一个文件夹中。

2) The PHP script looks up the MySQL database for the tag, decides the ids of images to upload, which are stored in a folder.

3)[这里是我不清楚如何实现] PHP的发送这些图像,接着与每个图像相关的元数据。记录的号码发送将不会被事先固定的,由被MySQL(仅最高将被固定)。

3) [Here is where I am unclear how to implement] The PHP sends these images followed by meta-data associated with each image. The number of records to send will not be fixed beforehand and will be decided by the number of records returned by MySQL (only maximum will be fixed).

我将不胜AP preciate任何示例脚本,以及在何处我能找到更多的信息,以便更好地理解系统内部的工作。此外,如果有更好的框架,做我想做的,我很高兴地了解了(我没有结婚,PHP / MySQL的)。

I would greatly appreciate any sample scripts, and pointers to where I could find more information to better understand the inner working. Also, if there are better frameworks to do what I want to, I am happy to learn about that (I am not married to PHP/MySQL).

推荐答案

我猜你应该使用JSON数据通过HTTP连接发送到移动设备。对于低互联网连接我就不preFER SOAP。

I guess you should use JSON to send data to your mobile device via HTTP connection. For low internet connect I don't prefer SOAP.

如果您不能加载直接通过HTTP URL图像,你可以在JSON发送图像数据和MIME类型,以及通过图像数据创建图像对象。

If you can not load images directly via HTTP URL you can send image data in JSON, and mime type as well and create image object through image data.

这篇关于获得从PHP服务器映像到Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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