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

# StructuredPostal

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.StructuredPostal "View this page in Java")

```
class StructuredPostal : ContactsContract.CommonDataKinds.CommonColumns, ContactsContract.DataColumnsWithJoins
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.provider.ContactsContract.CommonDataKinds.StructuredPostal](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#) |

A data kind representing a postal addresses.

You can use all columns defined for `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Data` as well as the following aliases.

## Column aliases

| Type | Alias | Data column ||
|---|---|---|---|
| String | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#FORMATTED_ADDRESS:kotlin.String` | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.DataColumns#DATA1:kotlin.String` |   |
| int | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.CommonColumns#TYPE:kotlin.String` | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.DataColumns#DATA2:kotlin.String` | Allowed values are: - `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.BaseTypes#TYPE_CUSTOM:kotlin.Int`. Put the actual type in `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.CommonColumns#LABEL:kotlin.String`. - `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#TYPE_HOME:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#TYPE_WORK:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#TYPE_OTHER:kotlin.Int` <br /> |
| String | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.CommonColumns#LABEL:kotlin.String` | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.DataColumns#DATA3:kotlin.String` |   |
| String | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#STREET:kotlin.String` | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.DataColumns#DATA4:kotlin.String` |   |
| String | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#POBOX:kotlin.String` | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.DataColumns#DATA5:kotlin.String` | Post Office Box number |
| String | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#NEIGHBORHOOD:kotlin.String` | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.DataColumns#DATA6:kotlin.String` |   |
| String | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#CITY:kotlin.String` | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.DataColumns#DATA7:kotlin.String` |   |
| String | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#REGION:kotlin.String` | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.DataColumns#DATA8:kotlin.String` |   |
| String | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#POSTCODE:kotlin.String` | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.DataColumns#DATA9:kotlin.String` |   |
| String | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#COUNTRY:kotlin.String` | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.DataColumns#DATA10:kotlin.String` |   |

## Summary

| Constants ||
|---|---|
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#CITY:kotlin.String` Can be city, village, town, borough, etc. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#CONTENT_ITEM_TYPE:kotlin.String` MIME type used when storing this in data table. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#CONTENT_TYPE:kotlin.String` The MIME type of `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#CONTENT_URI:android.net.Uri` providing a directory of postal addresses. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#COUNTRY:kotlin.String` The name or code of the country. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#EXTRA_ADDRESS_BOOK_INDEX:kotlin.String` Add this query parameter to a URI to get back row counts grouped by the address book index as cursor extras. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#EXTRA_ADDRESS_BOOK_INDEX_COUNTS:kotlin.String` The array of group counts for the corresponding group. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#EXTRA_ADDRESS_BOOK_INDEX_TITLES:kotlin.String` The array of address book index titles, which are returned in the same order as the data in the cursor. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#FORMATTED_ADDRESS:kotlin.String` The full, unstructured postal address. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#NEIGHBORHOOD:kotlin.String` This is used to disambiguate a street address when a city contains more than one street with the same name, or to specify a small place whose mail is routed through a larger postal town. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#POBOX:kotlin.String` Covers actual P. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#POSTCODE:kotlin.String` Postal code. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#REGION:kotlin.String` A state, province, county (in Ireland), Land (in Germany), departement (in France), etc. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#STREET:kotlin.String` Can be street, avenue, road, etc. |
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#TYPE_HOME:kotlin.Int` <br /> |
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#TYPE_OTHER:kotlin.Int` <br /> |
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#TYPE_WORK:kotlin.Int` <br /> |

| Inherited constants ||
|---|---|
| From class `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.CommonColumns` |---|---| | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.CommonColumns#DATA:kotlin.String` The data for the contact method. Type: TEXT <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.CommonColumns#LABEL:kotlin.String` The user defined label for the the contact method. Type: TEXT <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.CommonColumns#TYPE:kotlin.String` The type of data, for example Home or Work. Type: INTEGER <br /> | ||
| From class `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.BaseTypes` |---|---| | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.BaseTypes#TYPE_CUSTOM:kotlin.Int` A custom type. The custom label should be supplied by user. <br /> | ||

| Public methods ||
|---|---|
| static [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)! | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#getTypeLabel(android.content.res.Resources,%20kotlin.Int,%20kotlin.CharSequence)(res: https://developer.android.com/reference/kotlin/android/content/res/Resources.html#!, type: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html, label: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html?)` Return a `https://developer.android.com/reference/kotlin/java/lang/CharSequence.html#` that best describes the given type, possibly substituting the given `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.CommonColumns#LABEL:kotlin.String` value for `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.BaseTypes#TYPE_CUSTOM:kotlin.Int`. |
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#getTypeLabelResource(kotlin.Int)(type: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Return the string resource that best describes the given `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.CommonColumns#TYPE:kotlin.String`. |

| Properties ||
|---|---|
| static [Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)! | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#CONTENT_URI:android.net.Uri` The content:// style URI for all data records of the `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#CONTENT_ITEM_TYPE:kotlin.String` MIME type. |

## Constants

### CITY

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

```
static val CITY: String
```

Can be city, village, town, borough, etc. This is the postal town and not necessarily the place of residence or place of business.

Type: TEXT

    Value: "data7"

### CONTENT_ITEM_TYPE

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

```
static val CONTENT_ITEM_TYPE: String
```

MIME type used when storing this in data table.

    Value: "vnd.android.cursor.item/postal-address_v2"

### CONTENT_TYPE

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

```
static val CONTENT_TYPE: String
```

The MIME type of `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#CONTENT_URI:android.net.Uri` providing a directory of postal addresses.

    Value: "vnd.android.cursor.dir/postal-address_v2"

### COUNTRY

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

```
static val COUNTRY: String
```

The name or code of the country.

Type: TEXT

    Value: "data10"

### EXTRA_ADDRESS_BOOK_INDEX

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

```
static val EXTRA_ADDRESS_BOOK_INDEX: String
```

Add this query parameter to a URI to get back row counts grouped by the address book index as cursor extras. For most languages it is the first letter of the sort key. This parameter does not affect the main content of the cursor.

```kotlin
Example:
 
  import android.provider.ContactsContract.Contacts;
 
  Uri uri = Contacts.CONTENT_URI.buildUpon()
           .appendQueryParameter(Contacts.EXTRA_ADDRESS_BOOK_INDEX, "true")
           .build();
  Cursor cursor = getContentResolver().query(uri,
           new String[] {Contacts.DISPLAY_NAME},
           null, null, null);
  Bundle bundle = cursor.getExtras();
  if (bundle.containsKey(Contacts.EXTRA_ADDRESS_BOOK_INDEX_TITLES) &&
          bundle.containsKey(Contacts.EXTRA_ADDRESS_BOOK_INDEX_COUNTS)) {
      String sections[] =
              bundle.getStringArray(Contacts.EXTRA_ADDRESS_BOOK_INDEX_TITLES);
      int counts[] = bundle.getIntArray(Contacts.EXTRA_ADDRESS_BOOK_INDEX_COUNTS);
  }
  
```

<br />

    Value: "android.provider.extra.ADDRESS_BOOK_INDEX"

### EXTRA_ADDRESS_BOOK_INDEX_COUNTS

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

```
static val EXTRA_ADDRESS_BOOK_INDEX_COUNTS: String
```

The array of group counts for the corresponding group. Contains the same number of elements as the EXTRA_ADDRESS_BOOK_INDEX_TITLES array.

TYPE: int\[\]

    Value: "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS"

### EXTRA_ADDRESS_BOOK_INDEX_TITLES

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

```
static val EXTRA_ADDRESS_BOOK_INDEX_TITLES: String
```

The array of address book index titles, which are returned in the same order as the data in the cursor.

TYPE: String\[\]

    Value: "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES"

### FORMATTED_ADDRESS

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

```
static val FORMATTED_ADDRESS: String
```

The full, unstructured postal address. *This field must be consistent with any structured data.*

Type: TEXT

    Value: "data1"

### NEIGHBORHOOD

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

```
static val NEIGHBORHOOD: String
```

This is used to disambiguate a street address when a city contains more than one street with the same name, or to specify a small place whose mail is routed through a larger postal town. In China it could be a county or a minor city.

Type: TEXT

    Value: "data6"

### POBOX

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

```
static val POBOX: String
```

Covers actual P.O. boxes, drawers, locked bags, etc. This is usually but not always mutually exclusive with street.

Type: TEXT

    Value: "data5"

### POSTCODE

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

```
static val POSTCODE: String
```

Postal code. Usually country-wide, but sometimes specific to the city (e.g. "2" in "Dublin 2, Ireland" addresses).

Type: TEXT

    Value: "data9"

### REGION

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

```
static val REGION: String
```

A state, province, county (in Ireland), Land (in Germany), departement (in France), etc.

Type: TEXT

    Value: "data8"

### STREET

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

```
static val STREET: String
```

Can be street, avenue, road, etc. This element also includes the house number and room/apartment/flat/floor number.

Type: TEXT

    Value: "data4"

### TYPE_HOME

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

```
static val TYPE_HOME: Int
```

    Value: 1

### TYPE_OTHER

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

```
static val TYPE_OTHER: Int
```

    Value: 3

### TYPE_WORK

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

```
static val TYPE_WORK: Int
```

    Value: 2

## Public methods

### getTypeLabel

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

```
static fun getTypeLabel(
    res: Resources!, 
    type: Int, 
    label: CharSequence?
): CharSequence!
```

Return a `https://developer.android.com/reference/kotlin/java/lang/CharSequence.html#` that best describes the given type, possibly substituting the given `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.CommonColumns#LABEL:kotlin.String` value for `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.BaseTypes#TYPE_CUSTOM:kotlin.Int`.

| Parameters ||
|---|---|
| `label` | [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)?: This value may be `null`. |

### getTypeLabelResource

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

```
static fun getTypeLabelResource(type: Int): Int
```

Return the string resource that best describes the given `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.CommonColumns#TYPE:kotlin.String`. Will always return a valid resource.

## Properties

### CONTENT_URI

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

```
static val CONTENT_URI: Uri!
```

The content:// style URI for all data records of the `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#CONTENT_ITEM_TYPE:kotlin.String` MIME type.