Android SQLite Essentials
Preface
Android is probably the buzzword of this decade. In a short span, it has taken over the majority of the handset market. Android is staged to take over wearables, our TV rooms, as well as our cars this autumn with the Android L release. With the frantic pace at which Android is growing, a developer needs to up his or her skill sets as well. Database-oriented application development is one of the key skills every developer should have. SQLite database in applications is the heart of a data-centric product and key to building great products. Understanding SQLite and implementing the Android database can be a steep learning curve for some people. Concepts such as content providers and loaders are more complex to understand and implement. Android SQLite Essentials equips developers with tools to build database-based Android applications in a simplistic manner. It is written keeping in mind the current needs and best practices being followed in the industry. Let us start our journey.
Chapter 1. Enter SQLite
Dr. Richard Hipp, the architect and primary author of SQLite, explains how it all began in his interview with The Guardian published in June 2007: “I started on May 29 2000. Itrsquo;s just over seven years old,” he says. He was working on a project which used a database server, but from time to time the database went offline. “Then my program would give an error message saying that the database isnrsquo;t working, and I got the blame for this. So I said, this is not a demanding application for the database, why donrsquo;t I just talk directly to the disk, and build an SQL database engine that way? That was how it started.” Before we begin our journey exploring SQLite in the context of Android, we would like to inform you of some prerequisites. The following are very basic requirements and will require little effort from you:
○You need to ensure that the environment for building Android applications is in place. When we say “environment,” we refer to the combination of JDK and Eclipse, our IDE choice, ADT plugins, and Android SDK tools. In case these are not in place, the ADT bundle, which consists of IDE, ADT plugins, Android SDK tools, and platform tools, can be downloaded from http://developer.android.com/sdk/index.html.
The steps mentioned in the link are pretty self-explanatory. For JDK, you can visit Oraclersquo;s website to download the latest version and set it up at http://www.oracle.com/technetwork/java/javase/downloads/index.html.
○You need to have a basic knowledge of Android components and have run more than “Hello World” programs on an Android emulator. If not, a very apt guide is present on the Android developer site to set up an emulator. We would suggest you become familiar with basic Android components: Intent, Service, Content Providers, and Broadcast Receiver. The Android developer site has good repositories of samples along with documentation. Some of these are as follows: Emulator: http://developer.android.com/tools/devices/index.html
Android basics:
http://developer.android.com/training/basics/firstapp/index.html
With these things in place, we can now start our foray into SQLite. In this chapter, we will cover the following:
Why SQLite?
The SQLite architecture
A quick review of database fundamentals
SQLite in Android
Why SQLite?
SQLite is an embedded SQL database engine. It is used by prominent names such as Adobe in Adobe Integrated Runtime (AIR); Airbus, in their flight software; Python ships with SQLite; PHP; and many more. In the mobile domain, SQLite is a very popular choice across various platforms because of its lightweight nature. Apple uses it in the iPhone and Google in the Android operating system. It is used as an application file format, a database for electronic gadgets, a database for websites, and as an enterprise RDBMS. What makes SQLite such an interesting choice for these and many other companies? Letrsquo;s take a closer look at the features of SQLite that make it so popular:
Zero-configuration: SQLite is designed in such a manner that it requires no configuration file. It requires no installation steps or initial setup; it has no server process running and no recovery steps to take even if it crashes. There is no server and it is directly embedded in our application. Furthermore, no administrator is required to create or maintain a DB instance, or set permissions for users. In short, this is a true DBA-less database.
No-copyright: SQLite, instead of a license, comes with a blessing. The source code of SQLite is in the public domain; you are free to modify, distribute, and even sell the code. Even the contributors are asked to sign an affidavit to protect from any copyrights warfare that may occur in future.
Cross-platform: Database files from one system can be moved to a system running a different architecture without any hassle. This is possible because the database file format is binary and all the machines use the same format. In the following chapters, we will be pulling out a database from an Android emulator to Windows.
Compact: An SQLite database is a single ordinary disk file; it comes without a server and is designed to be lightweight and simple. These attributes lead to a very lightweight database engine. SQLite Version 3.7.8 has a footprint of less than 350KiB (kibibyte) compared to its other SQL database engines, which are much larger.
Fool proof: The code base is well commented, easy to understa
全文共23457字,剩余内容已隐藏,支付完成后下载完整资料
英语原文共 12 页,剩余内容已隐藏,支付完成后下载完整资料
资料编号:[505]
以上是毕业论文外文翻译,课题毕业论文、任务书、文献综述、开题报告、程序设计、图纸设计等资料可联系客服协助查找。