I need to send an image taken from the Camera over network. The image is too large to create a bitmap needed to use bitmap.compress(); It looks like the Gmail application can attach images from the camera while maintaining their large pixel size but with a great reduction their file size.
This won't work because I getBitmap() will return an Image to large to allocate and I don't want to sub sample it down to a smaller size.
ByteArrayOutputStream baos = new ByteArrayOutputStream();
getBitmap().compress(Bitmap.CompressFormat.JPEG, 70, baos);
Any ideas on how I can do the same without exceeding my total memory?
Update:
For anyone coming back to this thread I followed Phil's answer and used Apache MultiPartEntity to get the job done easily. (It handles streaming files from disk to network for you) http://hc.apache.org/httpcomponents-client-ga/httpmime/apidocs/org/apache/http/entity/mime/MultipartEntity.html