Get Image from File Storage [Backendless] -
my users upload images filestorage @ backendless. upload sequence:
backendless.files.android.upload(image1_scaled, bitmap.compressformat.png, 100, "profileimage", "images", new asynccallback<backendlessfile>() { @override public void handleresponse(backendlessfile response) { filemapping.profile_url = response.getfileurl(); backendless.data.of(filemapping.class).save(filemapping, new asynccallback<filemapping>() { @override public void handleresponse(filemapping response) { toast_error("image stored"); } @override public void handlefault(backendlessfault fault) { system.out.println("error" + fault.getcode()); } }); } @override public void handlefault(backendlessfault fault) { } });
and works flawlessly. need fetch image api display it.
so need make backendlesscollection<filemapping> userfiles = backendless.data.of(filemapping.class)
call receive url table. , supposedly httprequest url byte data. can't work out sort of .find method use? .findbyid() ? , if so, id use? "path", "name" ,"table" etc?
could show example fitting case here, table storing url's , such? thanks.
you'd (showing sync call simplicity, make sure change async on android):
backendlesscollection<filemapping> filemappings; filemappings = backendless.data.of( filemapping.class ).find(); iterator<filemapping> iterator = filemappings.getcurrentpage().iterator(); while( iterator.hasnext() ) { filemapping filemapping = iterator.next(); log.i( "myapp", "file url " + filemapping.profile_url ); }
Comments
Post a Comment