Using the Camera on Android

Shows how to use the Camera on Android.

Add these two to the

  <uses-permission android:name="android.permission.CAMERA" />
  <uses-feature android:name="" />

In your Activity, add:

public const int RequestCode = 100;
  // Code to trigger the camera capturing:
  var intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
  startActivityForResult(intent, RequestCode);

// This gets called when the capturing is done.
protected override void onActivityResult(int requestCode, int resultCode, Intent data)
	if (requestCode == RequestCode)
		var bitmap = ("data");
		// bitmap contains the image captured.

More info can be found here

1 Like