TAILIEUCHUNG - Lập trình Androi part 39

Bất kỳ Uri trong Android bắt đầu với nội dung: / / Đề án đại diện cho một nguồn tài nguyên phục vụ bởi một nhà cung cấp nội dung. Cung cấp nội dung cung cấp dữ liệu đóng gói bằng cách sử dụng như xử lý các trường hợp Uri. Bạn không biết cũng không chăm sóc, nơi các dữ liệu đại diện là Uri đến từ, miễn là nó có sẵn cho bạn khi cần thiết. Các dữ liệu có thể được lưu trữ trong một cơ sở dữ liệu SQLite, trong các tập tin phẳng, hoặc trên. | Chapter Using a Content Provider Any Uri in Android that begins with the content scheme represents a resource served up by a content provider. Content providers offer data encapsulation using Uri instances as handles. You neither know nor care where the data represented by the Uri comes from as long as it is available to you when needed. The data could be stored in a SQLite database in flat files or on some far-off server accessed over the Internet. Given a Uri you can perform basic CRUD create read update delete operations using a content provider. Uri instances can represent either collections or individual pieces of content. Given a collection Uri you can create new pieces of content via insert operations. Given an instance Uri you can read data represented by the Uri update that data or delete the instance outright. Android lets you use existing content providers or create your own. This chapter covers using content providers. Chapter 27 explains how you can serve up your own data using the content provider framework. Pieces of Me The simplified model of the construction of a content Uri is the scheme the namespace of data and optionally the instance identifier all separated by slashes in URL-style notation. The scheme of a content Uri is always content . So a content Uri of content constants 5 represents the constants instance with an identifier of 5. The combination of the scheme and the namespace is known as the base Uri of a content provider or a set of data supported by a content provider. In the preceding example content constants is the base Uri for a content provider that serves up information about constants in this case physical constants . The base Uri can be more complicated. For example if the base Uri for contacts were content contacts people the Contacts content provider may serve up other data using other base Uri values. 259 The base Uri represents a collection of instances. The base Uri combined with an instance identifier . 5 represents a

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.