David
David

Reputation: 10738

phonegap SQLite plugin - find out how much storage is available

I'm using the following plugin for my phonegap app

https://github.com/brodyspark/PhoneGap-sqlitePlugin-Android

I know i'm not limited to 5mb now but I'm trying to figure out how much storage is actually available to my app. Is there a way to get the maximum capacity of the available storage of the SQLite database? I know some phones limit the amount of resources apps can use and i'd like my app to be smart enough to know what that limit is.

I'm not sure if this is possible.

Upvotes: 1

Views: 498

Answers (1)

Nick Roth
Nick Roth

Reputation: 3077

PhoneGap itself doesn't provide any functionality like that. You will need to write a separate plugin or extend the one you referenced you add this functionality. It looks like Android provides a method that may be what you're looking for if you can get a File handle to the database file or parent directory.

http://developer.android.com/reference/java/io/File.html#getUsableSpace()

Upvotes: 1

Related Questions