Search code examples
androidandroid-cameraandroid-galleryandroid-camera-intent

Is android's default gallery and camera intents available in all devices?


In android there is 2 well known methods for getting images using android's default intents.

Gallery intent

To pick image from gallery, we usually do this:

    Intent intent =new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
    startActivityForResult(intent, 1);

Camera Intent

To open camera and capture image, we usually do this:

    Intent intent=new Intent(MediaStore.ACTION_IMAGE_CAPTURE); 
    startActivityForResult(intent, 2);

And finally we get the result in onActivityResult callback.

Question

I noticed that some chat apps (well-known ones) use a custom gallery picker, and a custom camera capture method.

They don't use android's default methods, which seems to be the easier way.

So my question is, does all android devices (mainly android 4 and above) support the above 2 methods or not?

I need to make sure that the above methods are supported by all devices.

Thanks.


Solution

  • There are some problems with specific devices, especially samsung, xiaomi. But they are getting better. Generally it should be available on every device but reality kicks in.

    Example.

    Camera intent not working with Samsung Galaxy S3

    Selecting image from gallery not working on Redmi Note 4

    Camera intent for ACTION_IMAGE_CAPTURE does not appear on Samsung Galaxy Nexus(4.0.2)