I am trying to write an Android application that will take a picture, put the data (byte[]) in an object along with some metadata, and post that to an AppEngine server where it will get persisted in a datastore as a blob. I don't really want to save the image as a file on Android (unless it's absolutely necessary). I searched around for solutions but nothing clear or specific enough came up. My questions are:
- how do I post the object to my servlet? Specifically how to properly serialize the object and get the serialized output to an HttpPost or something similar.
- once I persist the blob in the datastore, how will I be able to retrieve it as an image to display on a webpage?
Code examples would be very helpful. Also, if the approach I am taking is too complicated or problematic, please suggest other approaches (e.g. saving image as file, posting to server, then deleting).
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…