如何对android中的摄像头事件做出反应

时间:2021-03-03 20:48:21

I want to make an app and in this app i want to save all the user taken images like this:

我想制作一个应用程序,在这个应用程序中,我想保存所有用户拍摄的图像,如下所示:

  • user takes picture with default camera app
  • 用户使用默认相机应用拍照

  • my app give a notification it has succesfully backed up the image
  • 我的应用程序通知它已成功备份图像

Is there a way i can see the event of the camera app? and use this in my service?

有没有办法可以看到相机应用程序的事件?并在我的服务中使用它?

I tryied searching for it on google and cant find anything

我试着在google上搜索它,但找不到任何东西

im trying to get to in with a service running in the background of my application

即时通讯尝试使用我的应用程序后台运行的服务

i know i need to import the camera classes

我知道我需要导入相机类

2 个解决方案

#1


Hi You are able to cature the Image From this Example Url:

您好您可以从此示例Url中捕获图像:

http://www.androidhive.info/2013/09/android-working-with-camera-api/

And also You are able to Make a Notification that The Captured Image are saved in the Location.

此外,您还可以发出捕获图像保存在位置的通知。

#2


user takes picture with default camera app

用户使用默认相机应用拍照

There are ~1.5 billion Android devices, spanning thousands of device models, with hundreds of "default camera app" implementations. There are also hundreds more camera apps that the user might install through the Play Store or other channels.

有大约15亿台Android设备,涵盖数千种设备型号,拥有数百种“默认相机应用程序”实施。用户可以通过Play商店或其他渠道安装数百个相机应用程序。

my app give a notification it has succesfully backed up the image

我的应用程序通知它已成功备份图像

There is no requirement that your app have the ability to access the image, wherever it gets stored. For example, the camera app might upload it directly to a Web service, or might store it on removable storage.

您的应用无需在任何存储位置访问该图像。例如,相机应用程序可能会将其直接上载到Web服务,或者可能将其存储在可移动存储上。

Is there a way i can see the event of the camera app?

有没有办法可以看到相机应用程序的事件?

There is no documented protocol, let alone a requirement to follow it, where camera apps let arbitrary third party apps know that a picture was taken.

没有文档化的协议,更不用说遵循它的要求,其中相机应用程序让任意第三方应用程序知道拍摄的照片。

i know i need to import the camera classes

我知道我需要导入相机类

Only if you are going to write your own camera app.

只有你要编写自己的相机应用程序。

#1


Hi You are able to cature the Image From this Example Url:

您好您可以从此示例Url中捕获图像:

http://www.androidhive.info/2013/09/android-working-with-camera-api/

And also You are able to Make a Notification that The Captured Image are saved in the Location.

此外,您还可以发出捕获图像保存在位置的通知。

#2


user takes picture with default camera app

用户使用默认相机应用拍照

There are ~1.5 billion Android devices, spanning thousands of device models, with hundreds of "default camera app" implementations. There are also hundreds more camera apps that the user might install through the Play Store or other channels.

有大约15亿台Android设备,涵盖数千种设备型号,拥有数百种“默认相机应用程序”实施。用户可以通过Play商店或其他渠道安装数百个相机应用程序。

my app give a notification it has succesfully backed up the image

我的应用程序通知它已成功备份图像

There is no requirement that your app have the ability to access the image, wherever it gets stored. For example, the camera app might upload it directly to a Web service, or might store it on removable storage.

您的应用无需在任何存储位置访问该图像。例如,相机应用程序可能会将其直接上载到Web服务,或者可能将其存储在可移动存储上。

Is there a way i can see the event of the camera app?

有没有办法可以看到相机应用程序的事件?

There is no documented protocol, let alone a requirement to follow it, where camera apps let arbitrary third party apps know that a picture was taken.

没有文档化的协议,更不用说遵循它的要求,其中相机应用程序让任意第三方应用程序知道拍摄的照片。

i know i need to import the camera classes

我知道我需要导入相机类

Only if you are going to write your own camera app.

只有你要编写自己的相机应用程序。