Android APIs
public static class

CallLog.Calls

extends Object
implements BaseColumns
java.lang.Object
   ↳ android.provider.CallLog.Calls

Class Overview

Contains the recent calls.

Summary

Constants
String CACHED_FORMATTED_NUMBER The cached phone number, formatted with formatting rules based on the country the user was in when the call was made or received.
String CACHED_LOOKUP_URI The cached URI to look up the contact associated with the phone number, if it exists.
String CACHED_MATCHED_NUMBER The cached phone number of the contact which matches this entry, if it exists.
String CACHED_NAME The cached name associated with the phone number, if it exists.
String CACHED_NORMALIZED_NUMBER The cached normalized(E164) version of the phone number, if it exists.
String CACHED_NUMBER_LABEL The cached number label, for a custom number type, associated with the phone number, if it exists.
String CACHED_NUMBER_TYPE The cached number type (Home, Work, etc) associated with the phone number, if it exists.
String CACHED_PHOTO_ID The cached photo id of the picture associated with the phone number, if it exists.
String CONTENT_ITEM_TYPE The MIME type of a CONTENT_URI sub-directory of a single call.
String CONTENT_TYPE The MIME type of CONTENT_URI and CONTENT_FILTER_URI providing a directory of calls.
String COUNTRY_ISO The ISO 3166-1 two letters country code of the country where the user received or made the call.
String DATE The date the call occured, in milliseconds since the epoch

Type: INTEGER (long)

String DEFAULT_SORT_ORDER The default sort order for this table
String DURATION The duration of the call in seconds

Type: INTEGER (long)

String GEOCODED_LOCATION A geocoded location for the number associated with this call.
int INCOMING_TYPE Call log type for incoming calls.
String IS_READ Whether this item has been read or otherwise consumed by the user.
String LIMIT_PARAM_KEY Query parameter used to limit the number of call logs returned.
int MISSED_TYPE Call log type for missed calls.
String NEW Whether or not the call has been acknowledged

Type: INTEGER (boolean)

String NUMBER The phone number as the user entered it.
String NUMBER_PRESENTATION The number presenting rules set by the network.
String OFFSET_PARAM_KEY Query parameter used to specify the starting record to return.
int OUTGOING_TYPE Call log type for outgoing calls.
int PRESENTATION_ALLOWED Number is allowed to display for caller id.
int PRESENTATION_PAYPHONE Number is a pay phone.
int PRESENTATION_RESTRICTED Number is blocked by user.
int PRESENTATION_UNKNOWN Number is not specified or unknown by network.
String TYPE The type of the call (incoming, outgoing or missed).
int VOICEMAIL_TYPE Call log type for voicemails.
String VOICEMAIL_URI URI of the voicemail entry.
[Expand]
Inherited Constants
From interface android.provider.BaseColumns
Fields
public static final Uri CONTENT_FILTER_URI The content:// style URL for filtering this table on phone numbers
public static final Uri CONTENT_URI The content:// style URL for this table
public static final Uri CONTENT_URI_WITH_VOICEMAIL Content uri used to access call log entries, including voicemail records.
Public Constructors
CallLog.Calls()
Public Methods
static String getLastOutgoingCall(Context context)
Query the call log database for the last dialed number.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String CACHED_FORMATTED_NUMBER

The cached phone number, formatted with formatting rules based on the country the user was in when the call was made or received. This value is not guaranteed to be present, and may not be current if the contact information associated with this number has changed.

Type: TEXT

Constant Value: "formatted_number"

public static final String CACHED_LOOKUP_URI

The cached URI to look up the contact associated with the phone number, if it exists. This value may not be current if the contact information associated with this number has changed.

Type: TEXT

Constant Value: "lookup_uri"

public static final String CACHED_MATCHED_NUMBER

The cached phone number of the contact which matches this entry, if it exists. This value may not be current if the contact information associated with this number has changed.

Type: TEXT

Constant Value: "matched_number"

public static final String CACHED_NAME

Added in API level 1

The cached name associated with the phone number, if it exists. This value is not guaranteed to be current, if the contact information associated with this number has changed.

Type: TEXT

Constant Value: "name"

public static final String CACHED_NORMALIZED_NUMBER

The cached normalized(E164) version of the phone number, if it exists. This value may not be current if the contact information associated with this number has changed.

Type: TEXT

Constant Value: "normalized_number"

public static final String CACHED_NUMBER_LABEL

Added in API level 1

The cached number label, for a custom number type, associated with the phone number, if it exists. This value is not guaranteed to be current, if the contact information associated with this number has changed.

Type: TEXT

Constant Value: "numberlabel"

public static final String CACHED_NUMBER_TYPE

Added in API level 1

The cached number type (Home, Work, etc) associated with the phone number, if it exists. This value is not guaranteed to be current, if the contact information associated with this number has changed.

Type: INTEGER

Constant Value: "numbertype"

public static final String CACHED_PHOTO_ID

The cached photo id of the picture associated with the phone number, if it exists. This value may not be current if the contact information associated with this number has changed.

Type: INTEGER (long)

Constant Value: "photo_id"

public static final String CONTENT_ITEM_TYPE

Added in API level 1

The MIME type of a CONTENT_URI sub-directory of a single call.

Constant Value: "vnd.android.cursor.item/calls"

public static final String CONTENT_TYPE

Added in API level 1

The MIME type of CONTENT_URI and CONTENT_FILTER_URI providing a directory of calls.

Constant Value: "vnd.android.cursor.dir/calls"

public static final String COUNTRY_ISO

The ISO 3166-1 two letters country code of the country where the user received or made the call.

Type: TEXT

Constant Value: "countryiso"

public static final String DATE

Added in API level 1

The date the call occured, in milliseconds since the epoch

Type: INTEGER (long)

Constant Value: "date"

public static final String DEFAULT_SORT_ORDER

Added in API level 1

The default sort order for this table

Constant Value: "date DESC"

public static final String DURATION

Added in API level 1

The duration of the call in seconds

Type: INTEGER (long)

Constant Value: "duration"

public static final String GEOCODED_LOCATION

A geocoded location for the number associated with this call.

The string represents a city, state, or country associated with the number.

Type: TEXT

Constant Value: "geocoded_location"

public static final int INCOMING_TYPE

Added in API level 1

Call log type for incoming calls.

Constant Value: 1 (0x00000001)

public static final String IS_READ

Added in API level 14

Whether this item has been read or otherwise consumed by the user.

Unlike the NEW field, which requires the user to have acknowledged the existence of the entry, this implies the user has interacted with the entry.

Type: INTEGER (boolean)

Constant Value: "is_read"

public static final String LIMIT_PARAM_KEY

Added in API level 17

Query parameter used to limit the number of call logs returned.

TYPE: integer

Constant Value: "limit"

public static final int MISSED_TYPE

Added in API level 1

Call log type for missed calls.

Constant Value: 3 (0x00000003)

public static final String NEW

Added in API level 1

Whether or not the call has been acknowledged

Type: INTEGER (boolean)

Constant Value: "new"

public static final String NUMBER

Added in API level 1

The phone number as the user entered it.

Type: TEXT

Constant Value: "number"

public static final String NUMBER_PRESENTATION

Added in API level 19

The number presenting rules set by the network.

Allowed values:

Type: INTEGER

Constant Value: "presentation"

public static final String OFFSET_PARAM_KEY

Added in API level 17

Query parameter used to specify the starting record to return.

TYPE: integer

Constant Value: "offset"

public static final int OUTGOING_TYPE

Added in API level 1

Call log type for outgoing calls.

Constant Value: 2 (0x00000002)

public static final int PRESENTATION_ALLOWED

Added in API level 19

Number is allowed to display for caller id.

Constant Value: 1 (0x00000001)

public static final int PRESENTATION_PAYPHONE

Added in API level 19

Number is a pay phone.

Constant Value: 4 (0x00000004)

public static final int PRESENTATION_RESTRICTED

Added in API level 19

Number is blocked by user.

Constant Value: 2 (0x00000002)

public static final int PRESENTATION_UNKNOWN

Added in API level 19

Number is not specified or unknown by network.

Constant Value: 3 (0x00000003)

public static final String TYPE

Added in API level 1

The type of the call (incoming, outgoing or missed).

Type: INTEGER (int)

Constant Value: "type"

public static final int VOICEMAIL_TYPE

Call log type for voicemails.

Constant Value: 4 (0x00000004)

public static final String VOICEMAIL_URI

URI of the voicemail entry. Populated only for VOICEMAIL_TYPE.

Type: TEXT

Constant Value: "voicemail_uri"

Fields

public static final Uri CONTENT_FILTER_URI

Added in API level 1

The content:// style URL for filtering this table on phone numbers

public static final Uri CONTENT_URI

Added in API level 1

The content:// style URL for this table

public static final Uri CONTENT_URI_WITH_VOICEMAIL

Content uri used to access call log entries, including voicemail records. You must have the READ_CALL_LOG and WRITE_CALL_LOG permissions to read and write to the call log.

Public Constructors

public CallLog.Calls ()

Added in API level 1

Public Methods

public static String getLastOutgoingCall (Context context)

Added in API level 8

Query the call log database for the last dialed number.

Parameters
context Used to get the content resolver.
Returns
  • The last phone number dialed (outgoing) or an empty string if none exist yet.