Reputation:
In our Application, the User is able to Download PDF´s and open it via InAppBrowser on iOS or local PDF Reader on Android. To store the Files we use the LocalFileSystem option from Phonegap. It works well, but the Problem is, the Files are stored in the External Storage on Android. This causes some Issues. First, the Files are accessable for the User and second, when I delete the Application, the Files are still persistant. I don´t understand why Phonegap is not using the Internal Storage to make it similar to iOS.
So here is my Question: Is there a way to Store Files in the Internal Storage with Phonegap, do I miss something obvious, or do I have to write my own PlugIn to store Files in the Internal Storage?
Note:
Upvotes: 2
Views: 7413
Reputation:
The Phonegap Documentation doesn´t really go in Detail in general. Here is some Information I would like to add to the LocalFileSystem Documentation: http://docs.phonegap.com/en/2.6.0/cordova_file_file.md.html#LocalFileSystem
LocalFileSystem.Persistant:
LocalFileSystem.Temporary:
Summary: I still have no Idea why Phonegap is not using Internal Storage to make it similar to iOS. But, since I haven´t noticed any differences between Persistant and Temporary on IOS and the Files are getting deleted on uninstalling Application on Android, I would suggest to always take LocalFileSystem.Temporary.
Update: In iOS if you don't use persistent, your data can be deleted by the OS in cases of low memory
Do you agree with that?
Thanks and sorry for my bad English :)
Upvotes: 2
Reputation: 4920
On Android, the method
window.requestFileSystem
will check if there is an SD card available on the device. If there is, your root directory will be the SD card. If there isn't it will use
/data/data/{app package name}
I think you need to specify the root directory on Android so it doesn't use the SD card by default.
This blog might be useful for you.
Upvotes: 2