1

I just started to learn android application.

I have an image sitting on my external SD card I am trying to send the image via HttpPost to my servlet running on Apache Tomcat 7.0 Then Apache Server will do some kind of image processing and then return the Image to android application.

This is the scenario for my android application

  1. Run app
  2. Holding multiple images
  3. Sending multiple images by httppost to Apache server
  4. Receiving multiple images from android app then do some process
  5. Sending multiple images to android app.

I was looking for Send image file using java HTTP POST connections and Sending images using Http Post

However, I can't seem to find the perfect way. ( Especially, not sure how to send images to android..)

Is there any example or solution which I can use ?

Community
  • 1
  • 1
Dc Redwing
  • 1,681
  • 11
  • 32
  • 42
  • Can you show what you tried so far and what doesn't work? – xxbbcc Jan 03 '14 at 07:05
  • Hi Thanks for helping me. I am trying to implement android side. Holding data by BITMAP type variable then sending to server. However, I am not really sure if this is working. This is because I do not know how to handle data(BITMAP) type in the server side.. – Dc Redwing Jan 03 '14 at 08:19

1 Answers1

1

However, I can't seem to find the perfect way. ( Especially, not sure how to send images to android..)

=> I assume your question is to send and receive image to/from server.

Based on the assumption, I would suggest you a best solution to upload/receive images from/to your server.

Suggestion:

  1. To send image/s from Android: Convert the selected image into Base64 String and send it to the server. Server has to convert received Base64 string into Image and store at any location.
  2. To Receive image/s from Server: As server converts Base64 string into the actual Images, it just has to return URL of images. Android has to load images by using URLs.

I would say this is the optimized solution, by using you can transfer any size of images. Other approach of sending images to server is by using Multi-party entity logic.

Paresh Mayani
  • 127,700
  • 71
  • 241
  • 295
  • thanks for helping me. I think, I understand how to send Bitmap data to Server. However, I am not really sure HOW TO handle (receiving from android and sending to android). – Dc Redwing Jan 03 '14 at 07:19