I can\'t get the total amount of data used by an Android Application (or package), because the official API support has been deleted:
http://groups.google.com/group/
You can use this raw query as well, on sqlite 3.16.0+:
SELECT page_count * page_size as size FROM pragma_page_count(), pragma_page_size();
It returns the "size" column with the single row.
You can query the database with these two:
pragma page_size;
pragma page_count;
(see the sqlite pragma docs).
Multiply the first by the second and you'll get total pages used.
Perhaps someone could verify if this is an acceptable approach, but for a while I was using this:
File f = context.getDatabasePath(dbName);
long dbSize = f.length();
Cheers
Just to add-on about the size.
When I used the code by DroidBot, it works. But the size may not straightaway increase when data is entered into the database (especially if the data is very small). Database will only increment in 1024 bytes (e.g from 8192 bytes to 9216 bytes).
So, to see the database size increase straightaway, try putting in a large amount of data.