TAILIEUCHUNG - Lập trình Androi part 34

SQLite là một cơ sở dữ liệu rất phổ biến nhúng vào, vì nó kết hợp một giao diện sạch SQL với một bộ nhớ rất nhỏ và tốc độ khá. Hơn nữa, nó là công cộng, do đó, mọi người có thể sử dụng nó. Nhiều doanh nghiệp (ví dụ, Adobe, Apple, Google, Sun, và Symbian) và mã nguồn mở dự án (ví dụ, Mozilla, PHP, và Python) với sản phẩm tàu SQLite. | Chapter Managing and Accessing Local Databases SQLite is a very popular embedded database as it combines a clean SQL interface with a very small memory footprint and decent speed. Moreover it is public domain so everyone can use it. Many firms . Adobe Apple Google Sun and Symbian and open source projects . Mozilla PHP and Python ship products with SQLite. For Android SQLite is baked into the Android runtime so every Android application can create SQLite databases. Since SQLite uses a SQL interface it is fairly straightforward to use for people with experience in other SQL-based databases. However its native API is not JDBC and JDBC might be too much overhead for a memory-limited device like a phone anyway. Hence Android programmers have a different API to learn. The good news is that it is not that difficult. This chapter will cover the basics of SQLite use in the context of working on Android. It by no means is a thorough coverage of SQLite as a whole. If you want to learn more about SQLite and how to use it in environments other than Android a fine book is The Definitive Guide to SQLite by Michael Owens Apress 2006 . The Database Example Much of the sample code shown in this chapter comes from the Database Constants application. This application presents a list of physical constants with names and values culled from Android s SensorManager as shown in Figure 22-1. 225 CHAPTER 22 Managing and Accessing Local Databases 9 10 AM ConstantsBrowser Gravity Death Star I Gravity Earth Gravity Jupiter Gravity Mars Gravity Mercury Gravity Moon Gravity Neptune 11 Gravity Pluto Gravity Saturn Gravity Sun 275 Gravity The Island Gravity Uranus Gravity Venus Figure 22-1. The Constants sample application as Initially launched You can pop up a menu to add a new constant which brings up a dialog to fill in the name and value of the constant as shown in Figure 22-2. Figure 22-2. The Constants sample application

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.