0

I am new to Android development. I am just trying to store an image in MySQL database and want to display that image in an ImageView.

What should I do?

I think I have to store the URL of image in MySQL database but I don't know how to do it either.

I am using PHP too.

2
  • 1
    Hmm, so how much have you tried so far? Commented Apr 24, 2015 at 12:07
  • You are new to development it seems Commented Apr 24, 2015 at 12:15

2 Answers 2

1

One method is to store the base64 version of image using a php script with base64_encode() wich returns the base64 encryption of the image but i don't recommend it because this is increasing the size of the image. You should upload the image to a server and only store in the database the path to the image and then load it inside the Android application. Here is a nice Java tutorial that explains how to upload an image through HTTP http://www.jguru.com/faq/view.jsp?EID=62798 it should work for your application.

Sign up to request clarification or add additional context in comments.

Comments

0

Try to avoid if you can, storing images in database (as it would increase the size)..
If you cannot avoid, try using BLOB in database.. as mentioned here.

NOTE: Also do some research before asking questions.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.