# Using the Camera on Android

**URL:** https://talk.remobjects.com/t/using-the-camera-on-android/6783
**Category:** Snippets
**Tags:** elements, csharp, hydrogene, android
**Created:** [September 1, 2015, 8:20am UTC](https://talk.remobjects.com/t/using-the-camera-on-android/6783 "2015-09-01T08:20:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ck](https://talk.remobjects.com/user_avatar/talk.remobjects.com/ck/32/8740_2.png) [@ck](https://talk.remobjects.com/u/ck)
#### Post date: [September 1, 2015, 8:20am UTC](https://talk.remobjects.com/t/using-the-camera-on-android/6783/1 "2015-09-01T08:20:00Z")

</div>

Shows how to use the Camera on Android.

Add these two to the AndroidManifest.android-xml:

```auto
  <uses-permission android:name="android.permission.CAMERA" />
  <uses-feature android:name="android.hardware.camera" />

```

In your Activity, add:

```auto
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 = (android.graphics.Bitmap)data.getExtras().get("data");
		// bitmap contains the image captured.
	}
}

```

More info can be found [here](http://developer.android.com/guide/topics/media/camera.html#considerations)
