I was playing around with the new Google+ application on the Android and I had a technical question that I couldn’t seem to find online. How does the instant upload hook into the native camera application?
I can turn on a feature in the Google+ application and any pictures that I take with the native camera app are automatically uploaded to a private album on Google+. And this seems to be true whether the Google+ application is currently running or not. Is there any type of hook that I can register a callback event for in my application to access “just-taken” pictures for some post-processing goodness? I’d really like to tap into this functionality for an application that I am currently writing.
Any insight or hints in the right direction are greatly appreciated! Thanks!
Not entirely sure exactly how Google+ does it, but one way that would work is to use the ContentObserver interface: grab the MediaStore.Images.Media
ContentProviderand attach aContentObserverto it. Anytime a camera image is added, you’ll get a notification and you can process it accordingly (including uploading).Same technique would work for just about any
ContentProviderthat properly handlesContentObservers (which I’m assuming is allContentProviders, but you never can tell).