如何使用Android在MySQL服务器中存储图像 [英] How to store images in MySQL server using android
问题描述
我正在使用相机选项创建一个应用程序,其中一个捕获的图像是使用肥皂网络服务存储在MySQL服务器中的。
I'm creating a application using camera options in that one the captured images are stored in the MySQL server using soap web service.
我使用Asp创建了一个URL .net,图像的数据类型为byte [],在我的android编码中,我也将图像转换为byte []。如果我使用
I created a URL using Asp.net,the data type of the images are byte[],In my android coding I'm too convert image into byte[].The problem if i use
request.add Property( Photo,image);
// image是byte []变量
//上面的代码是在Android中使用肥皂网络服务
request.add Property("Photo",image);
//image is the byte[] variable
//the above code using soap web service in android
它不存储在我的sql server表中。
我该怎么办?
预先感谢
it doesn't store in my sql server table. How can i do that one? Thanks in advance
推荐答案
您要做的就是将字节数组转换为字符串,然后存储数据库中的字符串。然后,当您检索它时,将其转换回字节数组,然后转换为位图。
What you have to do is convert that byte array into a string, and then you store the string in your database. Then, when you retrieve it, you will convert it back into a byte array, and then into a bitmap.
这篇关于如何使用Android在MySQL服务器中存储图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!