O'Reilly logo

Seven Mobile Apps in Seven Weeks by Tony Hillerson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required