How can i send an image from php to android, using volley and Json -
im trying load image need load server, have 3 questions:
- i don't know how can convert images in bitmaps (this in server side)
- how convert bitmap in image (this in android side).
- how can send bitmap volley request.
i using volley make request. server method have this:
function getimage($image_path){ $base ='images/practices/'.$image_path; $binary=base64_encode($base); $resp['image_binary']= $binary; print_r(json_encode($resp)); }
the method using other requests is:
string url = "---------"; jsonobjectrequest request = new jsonobjectrequest(request.method.post, url, null, new response.listener<jsonobject>() { @override public void onresponse(jsonobject response) { try { //here processing of response... } catch (jsonexception e) { e.printstacktrace(); } } }, new response.errorlistener() { @override public void onerrorresponse(volleyerror error) { log.e("error",""+error.tostring()); } } ); volleys.getinstance(this).addtorequestqueue(request);
Comments
Post a Comment