Method to get the current size of the database

by Kalki » Thu, 23 Apr 2009 00:59:57 GMT


Sponsored Links
 Hi ,

I have created a database using the method openorCreateDatabase() and
set the maximum size of the database to 1MB using the method
setMaximumSize().

Now is there any methods available to check the current size of the
database.
Will an exception be thrown if the size exceeds 1MB.
--~--~---------~--~----~------------~-------~--~----~



Method to get the current size of the database

by Jeff Hamilton » Wed, 29 Apr 2009 00:51:58 GMT


 There isn't a method currently to return that, but you could do
something like this:

long getDbSize(SQLiteDatabase db) {
    return db.getPageSize() * DatabaseUtils.longForQuery(db, "PRAGMA
page_count;", null);
}

-Jeff




--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. Nokia N810 Support?

Does the current version or future version of Android support the
Nokia N810?

Thanks.

--~--~---------~--~----~------------~-------~--~----~

2. Jabber / XMPP Room for Android Developers Group

Hi all, fellow Android developers, i suggest we have Jabber / XMMP
room for live discussion about Android. According to Jabber / XMMP it
self was being developed for that purposes, advancing forum technique
from passive to active discussion. Thank you and fellow developers and
group admins might consider this.

--~--~---------~--~----~------------~-------~--~----~

3. Custom LayoutParams?

4. long click on MapView

5. XSLT on Android

6. duplicate entry: classes.dex

7. Problem with bindService