convert byte[] from json in android -


how byte[] json using webservice

my json format given below:

     [{"imglogo":[255,216,255,224,0,16,74,70,73,70,0,1,1,0,0,1,0,1,0,0,255,219,0,132,0,     9,6,7,20,19,18,20,20,19,20,21,22,20,22,20,21,24,22,21,21,20,20,20,20,20,     24,21,20,22,24,20,20,20,23,24,28,40,32,24,26,37,28,20,     21,33,49,33,37,41,43,46,46,46,23,31,51,56,51,44,55,40,45,46,43,1,10,10,10     ,14,13,14,27,16,16,26,44,36,28,36,44,44,44,44,44,44,44,44,44,44,44,44,     44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,     44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,255,192,0,17,8,0,194,1,3,3....]}] 

i'm using following code json value :

 jsonobject jsonchildnode = jsonmainnode.getjsonobject(i);  string imagestring = jsonchildnode.getstring("imglogo"); 

now, i'm getting above byte[] value string. how can convert string byte[]

first create string containing data ,

byte[] data = base64.decode(iconstring, base64.default); 

now have byte array containing bitmap.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -