Android :: Multipart Upload - Transmit The Image Directly From Memory
Oct 12, 2010
As part of my Android app, I'd like to upload bitmaps to be remotely stored. I have simple HTTP GET and POST communication working perfectly, but documentation on how to do a multipart POST seems to be as rare as unicorns.
Furthermore, I'd like to transmit the image directly from memory, instead of working with a file. In the example code below, I'm getting a byte array from a file to be used later on with HttpClient and MultipartEntity.
CODE:..............
This all seems fairly clear to me, except that I can't for the life of me find out where to get this ByteArrayPartSource. I have linked to the httpclient and httpmime JAR files, but no dice. I hear that the package structure changed drastically between HttpClient 3.x and 4.x.
Is anyone using this ByteArrayPartSource in Android, and how did they import it?
After digging around in the documentation and scouring the Internet, I came up with something that fit my needs. To make a multipart request such as a form POST, the following code did the trick for me:
CODE:.....
The HTTPMultipartMode.BROWSER_COMPATIBLE bit is very important.
View 1 Replies
Jul 29, 2010
This is my code.
I got Http 400 error.
CODE:...................
View 2 Replies
View Related
Sep 13, 2010
I apologize if this was already addressed. I received the 2.2 update last week and liked everything so far. This morning i snapped an image of 42nd St-Time Square and I tried to upload to facebook. To my surprise, the option to unload directly to fb is NOT there...WTH? I did notice that the fb app for android has a little camera icon to take a picture.
View 2 Replies
View Related
Jun 2, 2009
I'm trying to do multipart form upload using the 4.x httpclient on android. all the 4.x code samples I'm seeing use org.apache.http.entity.mime.MultipartEntity, but I'm running into a roadblock trying to find it. It's supposed to be in the httpmime project, but the download link for that project leads me back to httpcore, and the httpcore download doesn't contain that class. anyone else get multi part form upload to work?
View 2 Replies
View Related
Jul 14, 2010
As described in this answer you cannot grab a progress of a multipart/form POST upload in Android using only the Android SDK, because there is an issue with the stream buffering when using HttpURLConnection which will be fixed post Froyo (see http://code.google.com/p/android/issues/detail?id=3164#c6).
Since the Apache HttpClient 3.1 was removed from the SDK quite early and the new HttpClient, which is now part of the SDK, wasn't adopted completely (it misses multipart capabilities) you can add the missing parts (specifically apache-mime4j-0.6.jar and httpmime-4.0.1.jar) to perform a multipart/form-data upload AND grab the progress of the upload (also described in the answer mentioned above).
Now, the reason why I open a new question is, that doing as described leads to an enormous growth of the installed app size (in my case from 170kb to 732kb).
So, the question is: Is there any other way to perform a multipart/form-data upload and grab the upload progress without increasing the app size that much? Are there any other libraries one can use or is there any other alternative way, not mentioned here?
View 1 Replies
View Related
May 10, 2009
In response to a request over here: http://bit.ly/E1Qqm
This is some sample code for uploading an image to the web, as part of a multipart message. It assumes that the photo is stored on the SD card as "photo.jpg". You'll need to download and add a couple of jar files to the project's built path - commons-httpclient.jar and httpcomponents-client-4.0-alpha4.
It is working on my device. However (big caveats here) - it's much slower than I would like, and much slower than other applications I've installed that upload photos. It also feels hacky - e.g. the way the background thread communicates problems with the upload to the main thread using variables. I'm sure there must be a neater way to do it.
If you figure out a way to improve the code,
code:............
View 5 Replies
View Related
Apr 3, 2010
My problem is that I try to upload an image and some text values to an rails server, and the text values end up as files, insted of just param values.
How the post looks on the server
CODE:..........
Part of the android code
CODE:..................
View 1 Replies
View Related
Sep 8, 2010
I'm doing some research to build an iOS and Android app using titanium appcelerator. The only requirement I have not being able to confirm is the possibility to upload a photo directly to Amazon S3 in a way that is compatible with iOS and Android devices.
View 2 Replies
View Related
Jun 6, 2010
There is no way to do this? Do I have to put them on my PC, convert them, and then upload? That's just silly. There has to be a way...
View 2 Replies
View Related
Nov 9, 2009
How do I upload photos directly into my Facebook account? I hope there is an easy way of doing it as everything so far on the hero has been a struggle!
View 9 Replies
View Related
Aug 24, 2010
Apologies if there is a thread about this already (couldn't find it)... I used to be able to upload a mobile pic directly to Facebook and it would show on my wall/in my friends' feeds. Lately, my pics go directly to my "Mobile Pics" album, and do not show on my wall unless I publish the entire album again. I've checked my Facebook settings, and everything is set to 'Publish Content to my Wall", but my mobile pics continue to get uploaded directly to the album and do not publish. Anyone else having trouble with this? I'm not sure if it's a problem with the phone, the FB app, or my Facebook settings.
View 2 Replies
View Related
Oct 11, 2010
Want to use the image directly from website .i did not place that image in drawable folder. for this purpose what can i do.
View 1 Replies
View Related
Oct 12, 2010
I want to scale and display images which are dynamically loaded to a certain maximum size. The way I'm doing this is to set the layout_width and layout_height of my ImageView to the maximum dimensions and setting the scaleType to "fitCenter".
But here's the problem. This is inside a RelativeLayout and I want to show text directly under the image. In portrait mode, the text is way at the bottom (because of the height I have set). So I want the ImageView to scale down to the actual visible image size which is what it would seem like adjustViewBounds="true" should do.
Am I wrong in this assumption? Or is there a better way to do what I'm trying to do? Because I've been unsuccessful to this point!
View 2 Replies
View Related
Oct 16, 2010
If I go to AndroidForums on my phone, and I long-press on the logo, I have the option to save it.However, if I go to a direct link like http://imgur.com/OLnXZ.jpg and it just loads the image, how do I save it now? I long-press on the image and it doesn't do anything. I am rooted and running a custom ROM, but I don't remember being able to do this on stock.
View 2 Replies
View Related
Apr 9, 2010
i am implementing photoimage upload in sdcard in sdcard jpg image getting and in image uri retrieve data in bitmap in bitmap converting byte code this byte code sending to the database how can implemented this problem please some suggestion of implementation some example of source i am new in android t's very urgent , if anybody knows the solution.
View 2 Replies
View Related
Nov 6, 2009
I am trying upload a video from the application.i am able to upload videos of size lesser than 2 MB but when i am trying to upload videos more 2MB i am getting out of memory error.
plz suggest how do i upload videos?
View 1 Replies
View Related
Oct 2, 2009
In my app i want to Upload my photos to my phone database.when i click upload option it wil show browse options and then i wil find the location of an image i.e., any folder if i select any image it wil store it into my databse..whenever i want to view my photo means i will click Viewphoto option if i click tat option it should display my photos from my phone Database.
View 3 Replies
View Related
Jul 19, 2010
I want to select an image from an android image gallery and upload it to a web server
Can any one guide me how to achieve this?
View 2 Replies
View Related
May 19, 2010
In would like to write a simple Android application that takes a picture from the camera and uploads it to a webserver. Additionaly, I would like it to print in the screen the response from the server which is a simple text string.Do you know if there is any sample code that does something like that?
View 1 Replies
View Related
Jul 1, 2010
I have an image which is taken from andorid by calling image _capture how do i upload it to a windows server?
View 1 Replies
View Related
Sep 13, 2010
I apologize if this was already addressed. I received the 2.2 update last week and liked everything so far. This morning i snapped an image of 42nd St-Time Square and I tried to upload to facebook. To my surprise, the option to unload directly to fb is NOT there...WTH? I did notice that the fb app for android has a little camera icon to take a picture.
View 2 Replies
View Related
Aug 1, 2010
is it possible to upload one of my dvd rips to the cappy's internal memory? My sd card is full. Also,which folder would i need to place the file in? Thanks so much guys and gals!
View 2 Replies
View Related
May 6, 2013
Below is my codes for my camera application. how to insert the multimedia files into the blob storage of azure mobile services.
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;[code].....
View 1 Replies
View Related
Jul 22, 2010
Any reason why I can't upload pics from phone to PC, even if I insert memory card? It wanted me to install 'media Go' which I did and still no joy. Any sugestions/advice? many thanks in advance, It's probably something simple (like me) lol
View 2 Replies
View Related
Sep 25, 2010
I've looked up and down the SDK for this, but I can't find anything. I'm wondering if there's a way to transmit a sound, such as a WAV or OGG, during a call such that the person on the other end can hear it. (This sound should be heard in addition to, not in place of, the normal voice transmission.) Is there a possibility I may have overlooked?
View 1 Replies
View Related
Apr 15, 2010
I have some headache with an error about the system going out of memory. When I run the game fo first time there's no problem, but when i quit - with finish();- and then start the app again, it gives me an error.
The LogCat error says:
VM won't let us allocate 5529600 bytes ....
Caused by: android.view.InflateException: Binary XML file line #14:
Error inflating class java.lang.reflect.Constructor ....
Caused by: java.lang.reflect.InvocationTargetException ....
Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget.
it's strange because if I finish the activity and start it again without exiting the app then it's everything OK....but when i finish the app and push the button to load that activity... it crashes with this error and come back to the main menu...
View 5 Replies
View Related
Jun 2, 2010
I have implemented a routing protocol on an Android 1.6 mobile that uses wireless (ad-hoc) network in order to exchange messages. Now I would like to evaluate it under an energy consumption point of view, the base would be to try to calculate the energy wasted to transmit a single packet, do anybody has any idea how to do that? Software/hardware solutions are welcome! Thanx :)
View 3 Replies
View Related
Feb 23, 2010
I am trying to store an image in phone memory /data/data/com.myapp/ files/here.jpeg but I keep getting an exception. If I try to store the image using the normal 'FileOutputStream' it works fine. Can anyone point out what am I doing wrong? I want to store an image in my phone memory app folder so that when user is setting wallpaper the image can be listed in 'gallery.I do not want to store the image on sd card.
View 3 Replies
View Related
Jul 10, 2010
I am trying to reduce the size of images retrieved form the camera (so ~5-8 mega pixels) down to one a a few smaller sizes (the largest being 1024x768).It looks like the OOM happens during the createBitmap. Is there a more memory efficient way to do this? Perhaps something that doesn't require me to load the entire original into memory?
View 2 Replies
View Related
Feb 2, 2009
Is it possible to boot the phone (ADP1) from a compiled android image stored on the memory card without affecting the contents of the image flashed on the phone?
I would like to do this so I can work with development images, but I didn't want to mess with the factory image.
View 2 Replies
View Related