Trying to add image upload capabilities #81

wants to merge 11 commits into


None yet

4 participants


Hey there,
Ive been working on a side project trying to make it so that reddit-is-fun can upload images, so that I can rapidly send an image to reddit while i'm out walking around w/my phone. I started by making it upload to Imgur, but I tried to make it OO enough that someone could change that relatively easily.

Probably the biggest issue I can think of is that I have not integrated this into the main GUI code at all. That seemed to be changing pretty quickly, and I was not too sure where it was going. I created a tester activity that shows off what my upload code can do so far, but I know even the gui in my tester could be improved, it's not really my strong suite.

hamiltont added some commits Jun 19, 2010
@hamiltont hamiltont Intent filters setup, and ImageView populated from Uri. Trying to get…
… images to work first, so this is all relative to that
@hamiltont hamiltont Upload to imgur 30bede3
@hamiltont hamiltont Imgur uploading works. Shows file preview.
Next steps is to make this a background
operation, and then to interface with the
submit activity. Then update the submit
activity to detect an image and display
a thumbnail.
@hamiltont hamiltont Added AsyncTask so heavy work is done in background.
Split preview rendering and uploading into two separate

It would be nice to eventually add in a strategy pattern
to allow other sites besides imgur to be used. Next steps
include adding progress indications to an image upload,
and merging this with the submit activity. Also, I am
a bit behind on commenting.
@hamiltont hamiltont Creating nice image preview layout. Started to publish
progress updates from the ASyncTasks. Need to implement
a progress bar for the upload progress. Added a
ProgressBar spinning image on top of the image preview
@hamiltont hamiltont Adding in progress updates and a progress bar. Needs work. Uploading to
Imgur is currently working. The API seems questionable, it seems to
occasionally fail for no reason I have been able to detect. Committing
so I have a recent version where uploading works
@hamiltont hamiltont Uploading shows a progress bar now! 93bdc7b
@hamiltont hamiltont Uploading progress bar now works using a 0...100 scale. The CountingM…

only posts an update approx once every percent. Posting an update with every write
to the OutputStream results in a huge waste of time and a lot of extranneous method
@hamiltont hamiltont Fixed a bug in the uploading and slightly modified the layout. 31fe513
@hamiltont hamiltont Minor cleaning up of the project, renaming, commenting, etc ead09d6

Awesome! I will take a look at this when I get some time, hopefully within a week or so. I think you said it also handles downloading of images bypassing browser? Cool


Hey - sorry I misread the other issue. This code only does uploading of images (although some of it could be used for downloading purposes if you modified it)


Hey talklittle,

Was there something that needed addressing in this code, or have you just been busy?



Hey Hamy, I'm sorry for being negligent about pulling the patches. You are correct, I'm busy with my last semester of school. I haven't yet tried your patch, but I plan to do that and a lot of needed legwork on the app once I have a stretch of free time.

Thanks a lot,


Not a problem, I understand being busy at school ;)

I was just touching base and making sure you hadn't found problems


Hey Andrew,

Just bumping this again! If you have a bit of time over winter break it would be awesome to get some feedback :D



Definitely. Sorry for the huge delay...


Not a problem at all! I can understand life during school is crazy busy ;)


Hey Andrew,

Do you have some time to let me know what you think about this?


Are we talking about ? If so I'll contact him about the UI.


What is wrong with using another (specialized) app (like e.g. URLy, the regular Gallery etc) and then invoking the "Send to" action from there to pass the image on to "reddit is fun"?
Without looking at the patch itself I do not think that this app should have an upload feature.

@hamiltont I'm so confused, this patch adds the ability for you to execute a 'Send to Reddit is fun' action. What are you talking about?


Oh, I'm sorry then.. - did not want to cause any confusion, just add my opinion (without knowing enough apparently)!
I suppose the currently available "Send to Reddit is fun" action only applies to text/URLs then?
Currently I would upload an image using URLy and then send the resulting URL to "Send to Reddit is fun", which would then post it.


Ah - I see what you were getting at now! Yup, it only (currently) applies to text and URLs, but this patch would make 'Reddit is fun" show up when someone chooses the "Share" option with an image as the attached data.

It's definitely debatable if this is a desirable feature - the patch itself has been sitting in a queue for a looong time now, so who knows if it will ever make it in. The negatives are that it contains a hefty library which would increase the APK size by a few hundred kilobytes, and it's (currently) tied to Both of these could change, I could remove that library and just make the patch contain a few source files and add in support for other image upload APIs, but there was so little interest generated by the initial patch I haven't put the time into doing that.

Functionally, I would use this a lot - It's actually in the compiled version I use on my phone, so that I can upload images without needing to do anything but add a caption. Granted this could be accomplished with a specialized uploader and then sharing the image URL with reddit is fun, that just seems (to me) like something that most users would not be aware of.


I think it's a cool feature...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment