Added in API level 1

Address


open class Address : Parcelable
kotlin.Any
   ↳ android.location.Address

A class representing an Address, that is, a set of Strings describing a location. The address format is a simplified version of xAL (eXtensible Address Language) http://www.oasis-open.org/committees/ciq/ciq.html#6

Summary

Inherited constants
Public constructors
Address(locale: Locale!)

Constructs a new Address object set to the given Locale and with all other fields initialized to null or false.

Public methods
open Unit

Removes any latitude associated with this address.

open Unit

Removes any longitude associated with this address.

open Int

open String!

Returns a line of the address numbered by the given index (starting at 0), or null if no such line is present.

open String!

Returns the administrative area name of the address, for example, "CA", or null if it is unknown

open String!

Returns the country code of the address, for example "US", or null if it is unknown.

open String!

Returns the localized country name of the address, for example "Iceland", or null if it is unknown.

open Bundle!

Returns additional provider-specific information about the address as a Bundle.

open String!

Returns the feature name of the address, for example, "Golden Gate Bridge", or null if it is unknown

open Double

Returns the latitude of the address if known.

open Locale!

Returns the Locale associated with this address.

open String!

Returns the locality of the address, for example "Mountain View", or null if it is unknown.

open Double

Returns the longitude of the address if known.

open Int

Returns the largest index currently in use to specify an address line.

open String!

Returns the phone number of the address if known, or null if it is unknown.

open String!

Returns the postal code of the address, for example "94110", or null if it is unknown.

open String!

Returns the premises of the address, or null if it is unknown.

open String!

Returns the sub-administrative area name of the address, for example, "Santa Clara County", or null if it is unknown

open String!

Returns the sub-locality of the address, or null if it is unknown.

open String!

Returns the sub-thoroughfare name of the address, which may be null.

open String!

Returns the thoroughfare name of the address, for example, "1600 Ampitheater Parkway", which may be null

open String!

Returns the public URL for the address if known, or null if it is unknown.

open Boolean

Returns true if a latitude has been assigned to this Address, false otherwise.

open Boolean

Returns true if a longitude has been assigned to this Address, false otherwise.

open Unit
setAddressLine(index: Int, line: String!)

Sets the line of the address numbered by index (starting at 0) to the given String, which may be null.

open Unit
setAdminArea(adminArea: String!)

Sets the administrative area name of the address to the given String, which may be null

open Unit
setCountryCode(countryCode: String!)

Sets the country code of the address to the given String, which may be null.

open Unit
setCountryName(countryName: String!)

Sets the country name of the address to the given String, which may be null.

open Unit
setExtras(extras: Bundle!)

Sets the extra information associated with this fix to the given Bundle.

open Unit
setFeatureName(featureName: String!)

Sets the feature name of the address to the given String, which may be null

open Unit
setLatitude(latitude: Double)

Sets the latitude associated with this address.

open Unit
setLocality(locality: String!)

Sets the locality of the address to the given String, which may be null.

open Unit
setLongitude(longitude: Double)

Sets the longitude associated with this address.

open Unit
setPhone(phone: String!)

Sets the phone number associated with this address.

open Unit
setPostalCode(postalCode: String!)

Sets the postal code of the address to the given String, which may be null.

open Unit
setPremises(premises: String!)

Sets the premises of the address to the given String, which may be null.

open Unit
setSubAdminArea(subAdminArea: String!)

Sets the sub-administrative area name of the address to the given String, which may be null

open Unit
setSubLocality(sublocality: String!)

Sets the sub-locality of the address to the given String, which may be null.

open Unit
setSubThoroughfare(subthoroughfare: String!)

Sets the sub-thoroughfare name of the address, which may be null.

open Unit
setThoroughfare(thoroughfare: String!)

Sets the thoroughfare name of the address, which may be null.

open Unit
setUrl(Url: String!)

Sets the public URL associated with this address.

open String

open Unit
writeToParcel(parcel: Parcel, flags: Int)

Properties
static Parcelable.Creator<Address!>

Public constructors

Address

Added in API level 1
Address(locale: Locale!)

Constructs a new Address object set to the given Locale and with all other fields initialized to null or false.

Public methods

clearLatitude

Added in API level 1
open fun clearLatitude(): Unit

Removes any latitude associated with this address.

clearLongitude

Added in API level 1
open fun clearLongitude(): Unit

Removes any longitude associated with this address.

describeContents

Added in API level 1
open fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

getAddressLine

Added in API level 1
open fun getAddressLine(index: Int): String!

Returns a line of the address numbered by the given index (starting at 0), or null if no such line is present.

Exceptions
java.lang.IllegalArgumentException if index < 0

getAdminArea

Added in API level 1
open fun getAdminArea(): String!

Returns the administrative area name of the address, for example, "CA", or null if it is unknown

getCountryCode

Added in API level 1
open fun getCountryCode(): String!

Returns the country code of the address, for example "US", or null if it is unknown.

getCountryName

Added in API level 1
open fun getCountryName(): String!

Returns the localized country name of the address, for example "Iceland", or null if it is unknown.

getExtras

Added in API level 1
open fun getExtras(): Bundle!

Returns additional provider-specific information about the address as a Bundle. The keys and values are determined by the provider. If no additional information is available, null is returned.

getFeatureName

Added in API level 1
open fun getFeatureName(): String!

Returns the feature name of the address, for example, "Golden Gate Bridge", or null if it is unknown

getLatitude

Added in API level 1
open fun getLatitude(): Double

Returns the latitude of the address if known.

Exceptions
java.lang.IllegalStateException if this Address has not been assigned a latitude.

getLocale

Added in API level 1
open fun getLocale(): Locale!

Returns the Locale associated with this address.

getLocality

Added in API level 1
open fun getLocality(): String!

Returns the locality of the address, for example "Mountain View", or null if it is unknown.

getLongitude

Added in API level 1
open fun getLongitude(): Double

Returns the longitude of the address if known.

Exceptions
java.lang.IllegalStateException if this Address has not been assigned a longitude.

getMaxAddressLineIndex

Added in API level 1
open fun getMaxAddressLineIndex(): Int

Returns the largest index currently in use to specify an address line. If no address lines are specified, -1 is returned.

getPhone

Added in API level 1
open fun getPhone(): String!

Returns the phone number of the address if known, or null if it is unknown.

Exceptions
java.lang.IllegalStateException if this Address has not been assigned a phone number.

getPostalCode

Added in API level 1
open fun getPostalCode(): String!

Returns the postal code of the address, for example "94110", or null if it is unknown.

getPremises

Added in API level 4
open fun getPremises(): String!

Returns the premises of the address, or null if it is unknown.

getSubAdminArea

Added in API level 1
open fun getSubAdminArea(): String!

Returns the sub-administrative area name of the address, for example, "Santa Clara County", or null if it is unknown

getSubLocality

Added in API level 4
open fun getSubLocality(): String!

Returns the sub-locality of the address, or null if it is unknown. For example, this may correspond to the neighborhood of the locality.

getSubThoroughfare

Added in API level 4
open fun getSubThoroughfare(): String!

Returns the sub-thoroughfare name of the address, which may be null. This may correspond to the street number of the address.

getThoroughfare

Added in API level 1
open fun getThoroughfare(): String!

Returns the thoroughfare name of the address, for example, "1600 Ampitheater Parkway", which may be null

getUrl

Added in API level 1
open fun getUrl(): String!

Returns the public URL for the address if known, or null if it is unknown.

hasLatitude

Added in API level 1
open fun hasLatitude(): Boolean

Returns true if a latitude has been assigned to this Address, false otherwise.

hasLongitude

Added in API level 1
open fun hasLongitude(): Boolean

Returns true if a longitude has been assigned to this Address, false otherwise.

setAddressLine

Added in API level 1
open fun setAddressLine(
    index: Int,
    line: String!
): Unit

Sets the line of the address numbered by index (starting at 0) to the given String, which may be null.

Exceptions
java.lang.IllegalArgumentException if index < 0

setAdminArea

Added in API level 1
open fun setAdminArea(adminArea: String!): Unit

Sets the administrative area name of the address to the given String, which may be null

setCountryCode

Added in API level 1
open fun setCountryCode(countryCode: String!): Unit

Sets the country code of the address to the given String, which may be null.

setCountryName

Added in API level 1
open fun setCountryName(countryName: String!): Unit

Sets the country name of the address to the given String, which may be null.

setExtras

Added in API level 1
open fun setExtras(extras: Bundle!): Unit

Sets the extra information associated with this fix to the given Bundle.

setFeatureName

Added in API level 1
open fun setFeatureName(featureName: String!): Unit

Sets the feature name of the address to the given String, which may be null

setLatitude

Added in API level 1
open fun setLatitude(latitude: Double): Unit

Sets the latitude associated with this address.

setLocality

Added in API level 1
open fun setLocality(locality: String!): Unit

Sets the locality of the address to the given String, which may be null.

setLongitude

Added in API level 1
open fun setLongitude(longitude: Double): Unit

Sets the longitude associated with this address.

setPhone

Added in API level 1
open fun setPhone(phone: String!): Unit

Sets the phone number associated with this address.

setPostalCode

Added in API level 1
open fun setPostalCode(postalCode: String!): Unit

Sets the postal code of the address to the given String, which may be null.

setPremises

Added in API level 4
open fun setPremises(premises: String!): Unit

Sets the premises of the address to the given String, which may be null.

setSubAdminArea

Added in API level 1
open fun setSubAdminArea(subAdminArea: String!): Unit

Sets the sub-administrative area name of the address to the given String, which may be null

setSubLocality

Added in API level 4
open fun setSubLocality(sublocality: String!): Unit

Sets the sub-locality of the address to the given String, which may be null.

setSubThoroughfare

Added in API level 4
open fun setSubThoroughfare(subthoroughfare: String!): Unit

Sets the sub-thoroughfare name of the address, which may be null.

setThoroughfare

Added in API level 1
open fun setThoroughfare(thoroughfare: String!): Unit

Sets the thoroughfare name of the address, which may be null.

setUrl

Added in API level 1
open fun setUrl(Url: String!): Unit

Sets the public URL associated with this address.

toString

Added in API level 1
open fun toString(): String
Return
String a string representation of the object.

writeToParcel

Added in API level 1
open fun writeToParcel(
    parcel: Parcel,
    flags: Int
): Unit
Parameters
dest The Parcel in which the object should be written. This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 1
static val CREATOR: Parcelable.Creator<Address!>