Putting SQL to Work

In Chapter 6, Storing Local Data, on page 120, we explored keeping data around in preferences and in plain files. That works fine when the amount of data is small or when the data is all one type (such as a picture or an audio file). However, there is a better way to store large amounts of structured data: a relational database.

For the past thirty years, databases have been a staple of enterprise application development, but until recently they were too expensive and unwieldy for smaller-scale use. That is changing with small embedded engines such as the one included with the Android platform.

This chapter will show you how to use Android's embedded database engine, SQLite. You'll also learn how to use Android's data binding to connect your data sources to your user interface. Finally, you'll look at the ContentProvider class, which allows two applications to share the same data.

0 0

Post a comment