I want to use the camera in my Android app to take a photo and then upload it to my GAE server.
This is the code I'm using to send the image:
var saveImageView = Titanium.UI.createImageView({
top : 0,
left : 0,
width : 'auto',
height : 'auto',
image : event.media,
});
win1.add(saveImageView);
imageToUpload = saveImageView.toBlob();
// toBlob, not toImage!! important...
var xhr = Titanium.Network.createHTTPClient();
xhr.onload = function() {
win1.remove(saveImageView);
// remove the temp view...
};
xhr.open('POST', 'not sure what goes here');
xhr.send({
image : imageToUpload
});
I'm not sure what I'm supposed to use as the server's web address.
Also, any help in what this should look like on the GAE side will be greatly helpful.
I have found this source: http://www.mstrinity.com/blog/2010/12/29/posting-an-image-from-titanium-to-the-app-engine-data-storage-serving-that-image-out/
But it's 4 years old, and I can't get it to work at all.