AdsApp.Address
Stay organized with collections
Save and categorize content based on your preferences.
Represents the address of a geographical point. Contains information about
the street address, country, province / state, and postal code.
For instance, the address "1600 Amphitheatre Parkway, Mountain View, CA
94043" will have the following values:
getStreetAddress()
: "1600 Amphitheatre Parkway"
getStreetAddress2()
: null
getCityName()
: "Mountain View"
getProvinceCode()
: "CA"
getProvinceName()
: "California"
getPostalCode()
: "94043"
getCountryCode()
: "US"
Methods:
getCityName()
Returns the city name, or
null
if not known.
Return values:
Type | Description |
String |
The city name, or null if not known. |
getCountryCode()
Returns the country code, or
null
if not known.
Return values:
Type | Description |
String |
The country code, or null if not known. |
getPostalCode()
Returns the postal code, or
null
if not known.
Return values:
Type | Description |
String |
The postal code, or null if not known. |
getProvinceCode()
Returns the province / state code, or
null
if not known.
For instance, addresses in California would return "CA"
.
Return values:
Type | Description |
String |
The province code, or null if not known. |
getProvinceName()
Returns the province / state name, or
null
if not known.
Return values:
Type | Description |
String |
The province name, or null if not known. |
getStreetAddress()
Returns the street address, or
null
if not known.
Return values:
Type | Description |
String |
The street address, or null if not known. |
getStreetAddress2()
Returns the second line of the street address, or
null
if not
known.
Return values:
Type | Description |
String |
The second line of the street address, or null if not
known. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-25 UTC.
[null,null,["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eRepresents the address of a geographical point, including street address, city, province/state, postal code, and country.\u003c/p\u003e\n"],["\u003cp\u003eProvides methods to access individual address components like street address, city, province/state, postal code, and country.\u003c/p\u003e\n"],["\u003cp\u003eAll address component methods return a string value or \u003ccode\u003enull\u003c/code\u003e if the information is not available.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egetStreetAddress2()\u003c/code\u003e method, which retrieves the second line of the street address, is deprecated.\u003c/p\u003e\n"]]],[],null,["# AdsApp.Address\n\nRepresents the address of a geographical point. Contains information about the street address, country, province / state, and postal code.\n\nFor instance, the address \"1600 Amphitheatre Parkway, Mountain View, CA\n94043\" will have the following values:\n\n- `getStreetAddress()`: \"1600 Amphitheatre Parkway\"\n- `getStreetAddress2()`: `null`\n- `getCityName()`: \"Mountain View\"\n- `getProvinceCode()`: \"CA\"\n- `getProvinceName()`: \"California\"\n- `getPostalCode()`: \"94043\"\n- `getCountryCode()`: \"US\"\n\n### Methods:\n\n| Member | Type | Description |\n|-------------------------------------------|----------|------------------------------------------------------------------------|\n| [getCityName()](#getCityName) | `String` | Returns the city name, or `null` if not known. |\n| [getCountryCode()](#getCountryCode) | `String` | Returns the country code, or `null` if not known. |\n| [getPostalCode()](#getPostalCode) | `String` | Returns the postal code, or `null` if not known. |\n| [getProvinceCode()](#getProvinceCode) | `String` | Returns the province / state code, or `null` if not known. |\n| [getProvinceName()](#getProvinceName) | `String` | Returns the province / state name, or `null` if not known. |\n| [getStreetAddress()](#getStreetAddress) | `String` | Returns the street address, or `null` if not known. |\n| [getStreetAddress2()](#getStreetAddress2) | `String` | Returns the second line of the street address, or `null` if not known. |\n\n`getCityName()`\n---------------\n\nReturns the city name, or `null` if not known.\n\n### Return values:\n\n| Type | Description |\n|----------|----------------------------------------|\n| `String` | The city name, or `null` if not known. |\n\n`getCountryCode()`\n------------------\n\nReturns the country code, or `null` if not known.\n\n### Return values:\n\n| Type | Description |\n|----------|-------------------------------------------|\n| `String` | The country code, or `null` if not known. |\n\n`getPostalCode()`\n-----------------\n\nReturns the postal code, or `null` if not known.\n\n### Return values:\n\n| Type | Description |\n|----------|------------------------------------------|\n| `String` | The postal code, or `null` if not known. |\n\n`getProvinceCode()`\n-------------------\n\nReturns the province / state code, or `null` if not known.\n\nFor instance, addresses in California would return `\"CA\"`.\n\n### Return values:\n\n| Type | Description |\n|----------|--------------------------------------------|\n| `String` | The province code, or `null` if not known. |\n\n`getProvinceName()`\n-------------------\n\nReturns the province / state name, or `null` if not known.\n\n### Return values:\n\n| Type | Description |\n|----------|--------------------------------------------|\n| `String` | The province name, or `null` if not known. |\n\n`getStreetAddress()`\n--------------------\n\nReturns the street address, or `null` if not known.\n\n### Return values:\n\n| Type | Description |\n|----------|---------------------------------------------|\n| `String` | The street address, or `null` if not known. |\n\ngetStreetAddress2()\n-------------------\n\nReturns the second line of the street address, or `null` if not known. **Deprecated.**\n\n### Return values:\n\n| Type | Description |\n|----------|----------------------------------------------------------------|\n| `String` | The second line of the street address, or `null` if not known. |"]]