Day 3: Time Is Money

Or, Keeping a History of Conversions

Today we’ll store history. When a user does a currency conversion, he’s probably on a trip somewhere, and there’s a good chance he won’t have Internet access all the time.

We’ll keep a local record of each conversion the user does, so in the case that he’s offline, he can refer back to the last rate he loaded. It may not be the most up-to-date rate, but chances are it will still be close enough to be useful.

Keeping a History of Conversions

To keep the history of conversions, we’ll write data to a local SQLite database. To do this we’ll need to look at how to reference a database and get it set up the first time it’s used.

Writing History Records

Working with SQLite on Android requires ...

Get Seven Mobile Apps in Seven Weeks now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.