Where is android.camera.NEW_PICTURE defined?

I used com.android.camera.NEW_PICTURE to check if the image is captured or not.

 (receiver android:name="NewPhotoReceiver") (intent-filter) (action android:name="com.android.camera.NEW_PICTURE"/) (data android:mimeType="image/*"/) (/intent-filter) (/receiver) 

But com.android.camera.NEW_PICTURE not discussed on any Android developer site.

+4
source share
5 answers

In API 14 (ICS) and above, you can use the action " android.hardware.action.NEW_PICTURE ", which is indicated here:

http://developer.android.com/reference/android/hardware/Camera.html#ACTION_NEW_PICTURE

Therefore, I suggest that both of them together should cover both the past and the future:

 <intent-filter> <action android:name="com.android.camera.NEW_PICTURE" /> <action android:name="android.hardware.action.NEW_PICTURE" /> <data android:mimeType="image/*" /> </intent-filter> 

And the only question remains is whether any OEM really translates "com.android.camera.NEW_PICTURE" on Android to ICS ...

+10
source

From the source application for the camera :

 sendBroadcast(new Intent("com.android.camera.NEW_PICTURE", mLastContentUri)); 

Thus, the intent data property contains the image URI. You can get the physical path using the methods discussed in this question .

If you want to take a picture from your application, refer to this question .

+1
source

This is not official - there may be many different implementations of the camera application (by phone manufacturers and even applications on the market), so you should only use documented intent actions.

'com.android.camera.NEW_PICTURE' is NOT registered and is not official. I do not know what is.

0
source

one problem that also occurs when using both actions with receivers

Android: name = "com.android.camera.NEW_PICTURE" Android: name = "android.hardware.action.NEW_PICTURE"

is a duplicate call of the onReceived () method on some devices (in particular, on the Samsung Galaxy S4 Mini), so you should only use Android documented: name = "android.hardware.action.NEW_PICTURE"

0
source

Since the action of the translation action itself implies that " com.android.camera.NEW_PICTURE " is not generated within the framework of the Android API, therefore it should not be specified in the Android API documentation and, of course, does not exist in any source of the API Android .java file.

But it is created by the application ( com.android.camera ), and only the application developer and designers can list (in their application documentation or in the source code, if they are open) that translate the intent sent by their application.

0
source

Source: https://habr.com/ru/post/1312455/


All Articles