【发布时间】:2011-06-30 18:42:11
【问题描述】:
在我的 android 应用程序中,我在 ListView 中显示了一些用户。我想显示(用户的图片、名字、姓氏)。现在,它仅适用于 first_name 和 last_name。我想添加图片。我从服务器(python)收到的数据 JSON 是这样的:
[{"profil":"first_name": "Jim", "last_name": "Carrey"}}, "_id": {"$oid": "4d595cda1d41c81536000000"}}, {"profil":{"first_name": "Mathieu", "last_name": "Polnari"}}, "_id": {"$oid": "4d5916581d41c80e88000000"}}, {"profil": {"first_name": "Vincent", "last_name": "Fatou"}}, "_id": {"$oid": "4d58fc7e1d41c8090e000000"}}...]
如果我在那个JSON中为图片添加一个参数应该会更好。
您认为将图片作为 JSON 中的字符串返回并使用 Base64 对其进行解码是一个好主意吗?
【问题讨论】:
-
您能解释一下如何使用 Base64 将图像转换为 JSON 吗?这会帮助我。好像你知道怎么做,只是问是否有任何费用。
标签: python android image listview base64