Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Fields](https://developer.android.com/reference/android/hardware/Camera.Area#lfields) \| [Ctors](https://developer.android.com/reference/android/hardware/Camera.Area#pubctors) \| [Methods](https://developer.android.com/reference/android/hardware/Camera.Area#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/hardware/Camera.Area#inhmethods)

# Camera.Area

*** ** * ** ***


`
public
static


class
Camera.Area
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.hardware.Camera.Area |

<br />

*** ** * ** ***


**This class was deprecated
in API level 21.**   

We recommend using the new `https://developer.android.com/reference/android/hardware/camera2/package-summary` API for new
applications.

<br />

The Area class is used for choosing specific metering and focus areas for
the camera to use when calculating auto-exposure, auto-white balance, and
auto-focus.

To find out how many simultaneous areas a given camera supports, use
`https://developer.android.com/reference/android/hardware/Camera.Parameters#getMaxNumMeteringAreas()` and
`https://developer.android.com/reference/android/hardware/Camera.Parameters#getMaxNumFocusAreas()`. If metering or focusing area
selection is unsupported, these methods will return 0.

Each Area consists of a rectangle specifying its bounds, and a weight
that determines its importance. The bounds are relative to the camera's
current field of view. The coordinates are mapped so that (-1000, -1000)
is always the top-left corner of the current field of view, and (1000,
1000) is always the bottom-right corner of the current field of
view. Setting Areas with bounds outside that range is not allowed. Areas
with zero or negative width or height are not allowed.

The weight must range from 1 to 1000, and represents a weight for
every pixel in the area. This means that a large metering area with
the same weight as a smaller area will have more effect in the
metering result. Metering areas can overlap and the driver
will add the weights in the overlap region.

<br />

**See also:**

- `https://developer.android.com/reference/android/hardware/Camera.Parameters#setFocusAreas(java.util.List<android.hardware.Camera.Area>)`
- `https://developer.android.com/reference/android/hardware/Camera.Parameters#getFocusAreas()`
- `https://developer.android.com/reference/android/hardware/Camera.Parameters#getMaxNumFocusAreas()`
- `https://developer.android.com/reference/android/hardware/Camera.Parameters#setMeteringAreas(java.util.List<android.hardware.Camera.Area>)`
- `https://developer.android.com/reference/android/hardware/Camera.Parameters#getMeteringAreas()`
- `https://developer.android.com/reference/android/hardware/Camera.Parameters#getMaxNumMeteringAreas()`

## Summary

| ### Fields ||
|---|---|
| ` public https://developer.android.com/reference/android/graphics/Rect` | `https://developer.android.com/reference/android/hardware/Camera.Area#rect` Bounds of the area. |
| ` public int` | `https://developer.android.com/reference/android/hardware/Camera.Area#weight` Weight of the area. |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/hardware/Camera.Area#Area(android.graphics.Rect,%20int)(https://developer.android.com/reference/android/graphics/Rect rect, int weight) ` Create an area with specified rectangle and weight. |

| ### Public methods ||
|---|---|
| ` boolean` | ` https://developer.android.com/reference/android/hardware/Camera.Area#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Compares `obj` to this area. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Fields

### rect

Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Rect rect
```

Bounds of the area. (-1000, -1000) represents the top-left of the
camera field of view, and (1000, 1000) represents the bottom-right of
the field of view. Setting bounds outside that range is not
allowed. Bounds with zero or negative width or height are not
allowed.

<br />

**See also:**

- `https://developer.android.com/reference/android/hardware/Camera.Parameters#getFocusAreas()`
- `https://developer.android.com/reference/android/hardware/Camera.Parameters#getMeteringAreas()`

### weight

Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int weight
```

Weight of the area. The weight must range from 1 to 1000, and
represents a weight for every pixel in the area. This means that a
large metering area with the same weight as a smaller area will have
more effect in the metering result. Metering areas can overlap and
the driver will add the weights in the overlap region.

<br />

**See also:**

- `https://developer.android.com/reference/android/hardware/Camera.Parameters#getFocusAreas()`
- `https://developer.android.com/reference/android/hardware/Camera.Parameters#getMeteringAreas()`

## Public constructors

### Area

Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Area (Rect rect, 
                int weight)
```

Create an area with specified rectangle and weight.

<br />

| Parameters ||
|---|---|
| `rect` | `Rect`: the bounds of the area. <br /> |
| `weight` | `int`: the weight of the area. <br /> |

## Public methods

### equals

Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean equals (Object obj)
```

Compares `obj` to this area.

<br />

| Parameters ||
|---|---|
| `obj` | `Object`: the object to compare this area with. This value may be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the rectangle and weight of `obj` is the same as those of this area. `false` otherwise. <br /> |