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

Android -- How does Google+ instant upload work?(Android -- Google+ 即时上传如何工作?)
本文介绍了Android -- Google+ 即时上传如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我在 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.

非常感谢任何正确方向的见解或提示!谢谢!

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).

同样的技术适用于几乎所有能够正确处理 ContentObserverContentProvider(我假设都是 ContentProvider,但是你永远无法分辨).

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).

这篇关于Android -- Google+ 即时上传如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Show progress during FTP file upload in a java applet(在 Java 小程序中显示 FTP 文件上传期间的进度)
How to copy a file on the FTP server to a directory on the same server in Java?(java - 如何将FTP服务器上的文件复制到Java中同一服务器上的目录?)
FTP zip upload is corrupted sometimes(FTP zip 上传有时会损坏)
Enable logging in Apache Commons Net for FTP protocol(在 Apache Commons Net 中为 FTP 协议启用日志记录)
Checking file existence on FTP server(检查 FTP 服务器上的文件是否存在)
FtpClient storeFile always return False(FtpClient storeFile 总是返回 False)