Added in API level 5

StructuredPostal

class StructuredPostal : ContactsContract.DataColumnsWithJoins, ContactsContract.CommonDataKinds.CommonColumns
kotlin.Any
   ↳ android.provider.ContactsContract.CommonDataKinds.StructuredPostal

A data kind representing a postal addresses.

You can use all columns defined for ContactsContract.Data as well as the following aliases.

Column aliases

Type Alias Data column
String FORMATTED_ADDRESS DATA1
int TYPE DATA2 Allowed values are:

String LABEL DATA3
String STREET DATA4
String POBOX DATA5 Post Office Box number
String NEIGHBORHOOD DATA6
String CITY DATA7
String REGION DATA8
String POSTCODE DATA9
String COUNTRY DATA10

Summary

Constants
static String

Can be city, village, town, borough, etc.

static String

MIME type used when storing this in data table.

static String

The MIME type of CONTENT_URI providing a directory of postal addresses.

static String

The name or code of the country.

static String

Add this query parameter to a URI to get back row counts grouped by the address book index as cursor extras.

static String

The array of group counts for the corresponding group.

static String

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

static String

The full, unstructured postal address.

static 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

Covers actual P.

static String

Postal code.

static String

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

static String

Can be street, avenue, road, etc.

static Int

static Int

static Int

Inherited constants
Public methods
static CharSequence!
getTypeLabel(res: Resources!, type: Int, label: CharSequence?)

Return a CharSequence that best describes the given type, possibly substituting the given LABEL value for TYPE_CUSTOM.

static Int

Return the string resource that best describes the given TYPE.

Properties
static Uri!

The content:// style URI for all data records of the StructuredPostal#CONTENT_ITEM_TYPE MIME type.

Constants

CITY

Added in API level 5
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
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
static val CONTENT_TYPE: String

The MIME type of CONTENT_URI providing a directory of postal addresses.

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

COUNTRY

Added in API level 5
static val COUNTRY: String

The name or code of the country.

Type: TEXT

Value: "data10"

EXTRA_ADDRESS_BOOK_INDEX

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.

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);
  }
  

Value: "android.provider.extra.ADDRESS_BOOK_INDEX"

EXTRA_ADDRESS_BOOK_INDEX_COUNTS

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

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
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
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
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
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
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
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
static val TYPE_HOME: Int
Value: 1

TYPE_OTHER

Added in API level 5
static val TYPE_OTHER: Int
Value: 3

TYPE_WORK

Added in API level 5
static val TYPE_WORK: Int
Value: 2

Public methods

getTypeLabel

Added in API level 5
static fun getTypeLabel(
    res: Resources!,
    type: Int,
    label: CharSequence?
): CharSequence!

Return a CharSequence that best describes the given type, possibly substituting the given LABEL value for TYPE_CUSTOM.

Parameters
label CharSequence?: This value may be null.

getTypeLabelResource

Added in API level 5
static fun getTypeLabelResource(type: Int): Int

Return the string resource that best describes the given TYPE. Will always return a valid resource.

Properties

CONTENT_URI

Added in API level 5
static val CONTENT_URI: Uri!

The content:// style URI for all data records of the StructuredPostal#CONTENT_ITEM_TYPE MIME type.