Check out example codes for "select photo from camera android". It will help you in understanding the concepts better.

Code Example 1

private void pickFromGallery(){
       //Create an Intent with action as ACTION_PICK
       Intent intent=new Intent(Intent.ACTION_PICK);
       // Sets the type as image/*. This ensures only components of type image are selected
       //We pass an extra array with the accepted mime types. This will ensure only components with these MIME types as targeted.
       String[] mimeTypes = {"image/jpeg", "image/png"};
       // Launching the Intent 

    public void onActivityResult(int requestCode,int resultCode,Intent data){
          // Result code is RESULT_OK only if the user selects an Image
          if (resultCode == Activity.RESULT_OK)
          switch (requestCode){
              case GALLERY_REQUEST_CODE:
                  //data.getData returns the content URI for the selected Image
                  Uri selectedImage = data.getData();

Learn ReactJs, React Native from