I have a web platform in which the user enters the data, which are stored in SQL database. Using restful services and json I send the data in my mobile application via http calls, and I save them in sqlite database. The above works perfect. Now I want to upload images in web platform (which will saved in a separate table in SQL server) and in continue I want to get the images in mobile app, in the way which I have done for other data. After a lot research in google I found the blob data type. So , if I save the images as blob in sql then how can I convert them as json objects? Moreover, I want to know if it is efficient.
Asked
Active
Viewed 65 times
1 Answers
1
two ways to do that ( Base64
and byteArray
) by using Gson or Jackson, your byteArray shall automatically be converted to string if the variable is declared as string.

Kosh
- 6,140
- 3
- 36
- 67
-
byteArray is blob type? – user4292106 May 28 '15 at 09:10
-
you really don't need the blob tho, you could convert the image to bytearray and bytearray to image. anyway have a look here (http://stackoverflow.com/questions/24276268/how-to-convert-byte-array-to-blob-data-type-in-android) – Kosh May 28 '15 at 09:12
-
and in which data type I 'll save the images in sql server? – user4292106 May 28 '15 at 09:15