Book Image

PhoneGap Beginners Guide (third edition)

Book Image

PhoneGap Beginners Guide (third edition)

Overview of this book

Table of Contents (22 chapters)
PhoneGap Beginner's Guide Third Edition
Credits
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Related Plugin Resources
Index

Chapter 5. Using Device Storage and the Files API

Your knowledge of PhoneGap is coming together well. It's time to add some interaction with external data sources and with the device itself. The main goal of this chapter is to guide you through the offline storage capabilities of PhoneGap and help you understand how to interact with the Files API.

In this chapter, you will:

  • Learn how to read and write data on the device using the localStorage object

  • Learn how to handle the storage on a local database considering the specific platform implementation

  • Understand database storage limitations and learn how to handle them

  • Learn about the Files API, how it works, and how to organize your code to keep it clear and maintainable

  • Use the Files API to explore the device filesystem

  • Learn how to read and render data inside a file

  • Learn how to load and save a file to a device's persistent storage