class SystemComponents(IBaseColumns): BASE_CONTENT_URI # Table name used by our database TABLE_NAME = "system_components" # Identifier in the SystemsComponents table for the manifest tag of this package COLUMN_PACKAGE_ID = "package_id" # Date is stored as int representing time of creation of task COLUMN_PARENT = "parent" # Task is stored as String representing work to be done COLUMN_TYPE = "tag_type" # Status is stored as boolean representing current status of task COLUMN_CONTENT = "content" """ /* The base CONTENT_URI used to query the SystemComponents table from the content provider */ """ CONTENT_URI = Uri.withAppendedPath(BASE_CONTENT_URI, TABLE_NAME) @staticmethod def buildUriWithId(id): """ * Builds a URI that adds the task _ID to the end of the todo content URI path. * This is used to query details about a single todo entry by _ID. This is what we * use for the detail view query. * :param id: Unique id pointing to that row :return: to query details about a single todo entry """ return Uri.withAppendedPath(BASE_CONTENT_URI, '%s/%s' % (SystemComponents.TABLE_NAME, str(id)))
class InstalledPackages(IBaseColumns): BASE_CONTENT_URI # Table name used by our database TABLE_NAME = "installed_packages" # Package name as it is stated in the AndroidManifest.xml file COLUMN_NAME = "name" # Path to the AndroidManifest.xml file COLUMN_PATH = "path" """ /* The base CONTENT_URI used to query the installed_packages table from the content provider */ """ CONTENT_URI = Uri.withAppendedPath(BASE_CONTENT_URI, TABLE_NAME) @staticmethod def buildUriWithId(id): """ * Builds a URI that adds the task _ID to the end of the todo content URI path. * This is used to query details about a single todo entry by _ID. This is what we * use for the detail view query. * :param id: Unique id pointing to that row :return: to query details about a single todo entry """ return Uri.withAppendedPath(BASE_CONTENT_URI, '%s/%s' % (SystemComponents.TABLE_NAME, str(id)))
class TodoEntry(IBaseColumns): global BASE_CONTENT_URI # Table name used by our database TABLE_NAME = "todo" # Date is stored as int representing time of creation of task COLUMN_DATE = "date" # Task is stored as String representing work to be done COLUMN_TASK = "task" # Status is stored as boolean representing current status of task COLUMN_STATUS = "status" """ /* The base CONTENT_URI used to query the Todo table from the content provider */ """ CONTENT_URI = Uri.withAppendedPath(BASE_CONTENT_URI.toString(), TABLE_NAME) def buildTodoUriWithId(self, id): """ * Builds a URI that adds the task _ID to the end of the todo content URI path. * This is used to query details about a single todo entry by _ID. This is what we * use for the detail view query. * :param id: Unique id pointing to that row :return: to query details about a single todo entry """ return Uri.withAppendedPath(BASE_CONTENT_URI.toString(), '%s/%s' % (self.TABLE_NAME, str(id)))
def buildUriWithId(id): """ * Builds a URI that adds the task _ID to the end of the todo content URI path. * This is used to query details about a single todo entry by _ID. This is what we * use for the detail view query. * :param id: Unique id pointing to that row :return: to query details about a single todo entry """ return Uri.withAppendedPath(BASE_CONTENT_URI, '%s/%s' % (SystemComponents.TABLE_NAME, str(id)))