Files 檔案處理
The ParseFile
ParseFile可以讓你存各種資料格式
如果存的是png檔,記得要followPNG結尾,Parse比較好優化。
一樣用saveInBackground()等..
一樣用saveInBackground()等..
一樣可以將Parsefile 塞入 ParseObject。
取回檔案。
Progress
可以做到設定 percent,但目前依舊bug中....
每個人都很單純,大家都是夥伴。
ParseFile可以讓你存各種資料格式
byte [] data = "Working at Parse is great!" .getBytes(); ParseFile file = new ParseFile( "resume.txt" , data); |
file.saveInBackground(); |
ParseObject jobApplication = new ParseObject( "JobApplication" ); jobApplication.put( "applicantName" , "Joe Smith" ); jobApplication.put( "applicantResumeFile" , file); jobApplication.saveInBackground(); |
ParseFile applicantResume = (ParseFile)anotherApplication.get( "applicantResumeFile" ); applicantResume.getDataInBackground( new GetDataCallback() { public void done( byte [] data, ParseException e) { if (e == null ) { // data has the bytes for the resume } else { // something went wrong } } }); |
byte [] data = "Working at Parse is great!" .getBytes(); ParseFile file = new ParseFile( "resume.txt" , data); file.saveInBackground( new SaveCallback() { public void done(ParseException e) { // Handle success or failure here ... } }, new ProgressCallback() { public void done(Integer percentDone) { // Update your progress spinner here. percentDone will be between 0 and 100. } }); |
Blog: |
Wolke Codes |
Topics: |
沒有留言:
張貼留言