web services - How to send large custom object to .net webservice in android -
i able send custom object .net webservice , webmethod working absolutely fine. tested code on multiple phone , result success when trying on samsung mobile started give me exception.
i found problem memoryoutofexception occuring because have recorded big size of video , trying convert byte[] expected record less quality video working in micromax , motorola not in samsung (rest brands don't know yet).
takevideointent.putextra(mediastore.extra_video_quality, myvideoquality);
so here of solution think should have: 1. either record less size video camera intent
in mobile(not working in samsung). 2. or code video upload method in such way upload video in chunks. have send more info video have created custom object handle , have implemented kvmserializable
, used marshal
also. don't know how send big custom object in chunks.
i have seen this don't find can send add-on info along it. send video file alone.
if not clear plenty please allow me know more info should provide.
here code using upload video :
private string savemedia(string email, byte[] media, string mediatype, string mediaext) { soapserializationenvelope envelope; soapobject request = new soapobject( helpmeconstant.wsdl_target_namespace, "savemedia"); // log.i(tag, "email : " + email + ", media : " + media + "mediatype : " + mediatype + ",mediaext : " + mediaext); mediaavidance mediainfo = new mediaavidance(); mediainfo.emailid = email; mediainfo.media = media; mediainfo.mediaext = mediaext; mediainfo.mediatype = mediatype; propertyinfo pi = new propertyinfo(); pi.setname("avidanceinfo"); pi.setvalue(mediainfo); pi.settype(mediainfo.getclass()); request.addproperty(pi); envelope = new soapserializationenvelope(soapenvelope.ver11); // log.i("savemedia", "serialising.."); new marshalbase64().register(envelope); envelope.dotnet = true; envelope.headerout = helpermethod.addauthentication(); envelope.implicittypes = true; envelope.setoutputsoapobject(request); httptransportse httptransport = new httptransportse( helpmeconstant.soap_address); object response = null; seek { // log.i("savemedia", "calling service.."); httptransport.call(helpmeconstant.soap_action + "savemedia", envelope); // log.i("savemedia", "getting response.."); response = envelope.getresponse(); } grab (exception exception) { // log.e("savemedia", "i got error :", exception); response = exception.tostring(); } homecoming response.tostring(); }
thanks in advance response.
android web-services video out-of-memory httptransportse
No comments:
Post a Comment