Android的 - 如何Google+的即时上传的工作?上传、工作、Android、Google

2023-09-12 09:10:36 作者:各自生欢

我对Android的新的Google+应用程序玩弄,我有一个技术问题,我似乎无法在网上找到。如何即时上传勾入内置相机应用程序?

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?

我可以打开在Google+的应用程序中的功能并且我采取与原生相机应用被自动上传到Google+上的私人相册中的所有照片。这似乎在Google+的应用程序是否正在运行或者是不正确的。是否有任何类型的钩子,我可以在我的申请注册一个回调事件进入刚刚拍摄的照片对于一些后期处理的善良?我真的很想进入这个功能对于我目前正在写一个应用程序。

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.

在朝着正确的方向任何有识之士或者暗示有很大AP preciated!谢谢!

Any insight or hints in the right direction are greatly appreciated! Thanks!

推荐答案

不能完全确定确切的Google+怎么做的,而是将工作的一种方法是使用ContentObserver接口:抢MediaStore.Images.Media 的ContentProvider 并附加 ContentObserver 给它。任何时候,摄像机图像添加,你会得到一个通知,并可以进行相应的处理(包括上传)。

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 ContentProvider and attach a ContentObserver to it. Anytime a camera image is added, you'll get a notification and you can process it accordingly (including uploading).

同样的方法将工作几乎任何的ContentProvider 是正确处理 ContentObserver S(这我假设是所有的的ContentProvider S,但你永远无法知道)。

Same technique would work for just about any ContentProvider that properly handles ContentObservers (which I'm assuming is all ContentProviders, but you never can tell).