StructuredPostal
class StructuredPostal : ContactsContract.CommonDataKinds.CommonColumns, ContactsContract.DataColumnsWithJoins
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 |
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 |
static Int |
getTypeLabelResource(type: Int) Return the string resource that best describes the given |
Properties | |
---|---|
static Uri! |
The content:// style URI for all data records of the |
Constants
CITY
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
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
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
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
static val FORMATTED_ADDRESS: String
The full, unstructured postal address. This field must be consistent with any structured data.
Type: TEXT
Value: "data1"
NEIGHBORHOOD
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
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
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
static val REGION: String
A state, province, county (in Ireland), Land (in Germany), departement (in France), etc.
Type: TEXT
Value: "data8"
STREET
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"
Public methods
getTypeLabel
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
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
static val CONTENT_URI: Uri!
The content:// style URI for all data records of the StructuredPostal.CONTENT_ITEM_TYPE
MIME type.