Android -- How does Google+ instant upload work?(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).
同样的技术适用于几乎所有能够正确处理 ContentObserver
的 ContentProvider
(我假设都是 ContentProvider
,但是你永远无法分辨).
Same technique would work for just about any ContentProvider
that properly handles ContentObserver
s (which I'm assuming is all ContentProvider
s, but you never can tell).
这篇关于Android -- Google+ 即时上传如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Android -- Google+ 即时上传如何工作?
基础教程推荐
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- 降序排序:Java Map 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01