How to create an auto-upload Android picture app?

独自空忆成欢 提交于 2019-12-01 10:47:39

Right now i don't believe there is a Broadcast that is fired for a camera capture event that other activities can listen to.

But here's what you can do. Declare an intent filter for "android.intent.action.CAMERA_BUTTON" and provide it the highest priority - 999

This will give you a handle on the broadcast fired by the native camera. However this would steal the broadcast from the native app. So you might have to handle saving the file yourself, or formulate a hack to give back control to the native app.

Don't know if there is a better way. Also can't say much about the use-case of third-party cameras.

EDIT:

On further inspection, there is a better way. Listening to android.media.action.IMAGE_CAPTURE would yield better results and should fit right into your requirements.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!