lập trình android (phần 4)

Tham khảo tài liệu 'lập trình android (phần 4)', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Storing and retrieving data This chapter covers Storing and retrieving data with SharedPreferences Using the filesystem Working with a SQLite database Accessing and building a Contentprovider Anytime you are developing software one of the most common and basic constructs you have to deal with is the means to store and retrieve data. It s all about the data after all. Though there are many ways to pipe data into and out of various languages and technologies there are typically only a few ways to persist it in memory structures the filesystem databases and network services. Like other technologies Android has its own concepts for getting and sharing data in applications yet these concepts are ultimately implemented using familiar approaches for the most part . Android provides access to the filesystem has support for a local relational database through SQLite and includes a Shared-Preferences object and preferences system that allows you to store simple keyvalue pairs within applications. 126 Download at Licensed to Deborah Christiansen pedbro@ Using preferences 127 In this chapter we are going to take a tour of each of the local data-related mechanisms we will examine the network possibilities in chapter 6 . We will start with preferences and create a small sample application to exercise those concepts. From there we will create another sample application to examine using the filesystem to store data both internal to our application and external using the platform s SD card support. Then we will look at creating and accessing a database. To do this we will take a closer look at some of the code and concepts from the WeatherReporter application we created in chapter 4 which uses SQLite. Beyond the basics Android also includes its own construct that allows applications to share data through a clever URI-based approach called a ContentProvider. This technique combines several other Android concepts such as the URI-based style of intents and the .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã 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.