0
我將爲web服務保存圖像,以便對圖像進行編碼並作爲字符串傳遞(對於單個圖像)。對於多個圖像,我需要用於保存編碼圖像字符串的數組和圖像類型。我已經有了一些參數的數組。現在我想要多維數組來保存圖像細節。在android中爲json發送值的多維數組創建
格式
diary image=>[0]=>imagedata,imagetype
=>[1]=>imagedata,imagetype
我將爲web服務保存圖像,以便對圖像進行編碼並作爲字符串傳遞(對於單個圖像)。對於多個圖像,我需要用於保存編碼圖像字符串的數組和圖像類型。我已經有了一些參數的數組。現在我想要多維數組來保存圖像細節。在android中爲json發送值的多維數組創建
格式
diary image=>[0]=>imagedata,imagetype
=>[1]=>imagedata,imagetype
不要在Android上使用多維數組,因爲它消耗更多的meory總是儘量避免已經看here..
您可以使用
ArrayList<HashMap<String,String>> imagesList=new ArrayList<HashMap<String,String>>();
HashMap<String,String> image1Map=new HashMap<String,String>();
image1Map.put("imageData","image data goes here");
image1Map.put("imageType","image typegoes here");
image1Map.put("image","image goes here");
imagesList.add(image1Map);