AVOS保持数据。

使用AVOS保存复杂结构数据。

 

				AVOSCloud.initialize(getApplication(), APP_ID, APP_KEY);
				File parent=new File(Environment.getExternalStorageDirectory() + "/pic/");

				String filePath[]=parent.list();
				List<AVFile> fileList = new LinkedList<AVFile>();
				for (String string : filePath) {
					Log.e("parse", string);
					File localFile=new File(Environment.getExternalStorageDirectory() + "/pic/"+string);
					AVFile file = AVFile.withFile(string, localFile);
					fileList.add(file);
					AVObject parseObject = new AVObject("ls_pic");
					 parseObject.put("pic", file);
				    parseObject.saveInBackground();
				    Thread.sleep(10000);
				}
			    //批量保存,AVOS 接口异常
//				 AVObject parseObject = new AVObject("ls_pic");
//				    parseObject.addAll("file_array", fileList);
//				    parseObject.saveInBackground();

 

你可能感兴趣的:(OS)