Book Image

Android Database Programming

By : Jason Wei
Book Image

Android Database Programming

By: Jason Wei

Overview of this book

<p>We live in an increasingly data-centric and data-driven world. On top of that we live in a very mobile-centric world with the rise of Android smart phones and tablet devices and the surge in demand for the Android platform. Along with the demand for more data, there is a demand for efficient, "snappy" applications, and so developers need to have a strong understanding of when different data storage methods are appropriate and when they are not.</p> <p>Mastering how to use these two fields to successfully create a powerful application will help you boost your knowledge and skills in this area.</p> <p>"Android Database Programming" is designed to help developers create and design data-centric mobile applications on Google’s Android platform. As the world goes increasingly mobile and as consumers’ demand for data-centric applications rises, knowing how to combine the two effectively will become an increasingly important asset to have as a developer. The book starts by looking at the various local data storage methods on Android, and finishes off by examining external databases and ways you can utilize them from within an Android application.</p> <p>This book starts by looking at local data storage methods, focusing on writing SQLite databases for your application and also looking at ways to bind these databases to the user interface. The book, through its practical approach, strives to teach you by examples. Each chapter focuses on flushing out high level design concepts, before drilling down into different code examples.&nbsp;</p> <p>As you continue you will look at external databases, primarily Google’s App Engine platform, and pull things together by helping you understand how you can request, cache, and display this data. The book then teaches the ways and techniques to utilize such external databases from within your application.</p> <p>&nbsp;</p>
Table of Contents (17 chapters)
Android Database Programming
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

SQL vs. Java performance comparisons


So just how powerful and efficient is the SQL language? In the previous two sections, we explored both basic and more advanced features of SQL – all of whose functionality (in theory) could be mimicked with just Java (that is, just do a bare-bones SELECT statement to get back the entire table and parse it with Java if statements, and so on). However, it's time to explore if there's an actual added advantage to filtering and manipulating our data on the SQLite end (as opposed to on the Java end), and if so, how much of an advantage it provides. And so, to start, we'll need a much bigger data set to better illustrate the improvements in performance.

First, we create a new table under a new schema which simply has a column for name, state, and income – think of this as a United States database with each family's name, the state they live in, and their family income. The table has 17,576 rows – still not a lot considering the magnitude of some real application...