public final class GmailContract

Contract for use with the Gmail content provider.

Developers can use this content provider to display label information to the user.
The label information includes:

  • Label name
  • Total number of conversations
  • Number of unread conversations
  • Label text color
  • Label background color

This content provider is available in Gmail version 2.3.6 or newer for Froyo/Gingerbread and version 4.0.5 and newer for Honeycomb and Ice Cream Sandwich

An application can query the Content Resolver directly (or use a Loader) to obtain a Cursor with information for all labels on an account

Cursor labelsCursor = getContentResolver().query(GmailContract.Labels.getLabelsUri( selectedAccount), null, null, null, null);

Nested Classes
Public Methods
canReadLabels(Context c)


public static final String AUTHORITY

Authority for the Gmail content provider.

Constant Value: ""

public static final String PERMISSION

Permission required to access this android.content.ContentProvider

Constant Value: ""

Public Methods

public static boolean canReadLabels (Context c)

Check if the installed Gmail app supports querying for label information.

c an application Context
  • true if it's safe to make label API queries