O'Reilly logo

PhoneGap By Example by Andrey Kovalenko

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

Filesystem plugin installation and usage

The problem with a native camera is that it stores captured pictures in a temporary folder. For example, the imageURI from the camera plugin taken on an iPhone might look like this: file:///var/mobile/Containers/Data/Application/AB784267-B994-4B54-A81C-EF1180B18738/tmp/cdv_photo_005.jpg.

Next time you run the application, this tmp folder might be cleared. Here are a few possible solutions to the issue:

  • Use base64 data of the picture and store in the internal application's database
  • Move the picture to the persistent store where mobile OS is not able to remove files if more space is needed

The first option doesn't work because there is a limit for database file size and, on modern devices, pictures can be really ...

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