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. complex sample application

Hello,
I am really new to java and android development. I have some history
in programming, so I was able to fix some bugs in example code. Now I
want to move from Hello apps to real one but I still don't understand
some basic concepts. What helped me in this phase on .net platform was
PortalVSCS, complex and well documented example application. Is there
anything like that on Android? Or..does this platform require
knowledge of java and all documentation rely on this?

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

2. Code protection

I have a stupid questions. Since Android code development is based on
Java, will my published application be easily decompiled and stolen? I
know you can obfuscate, but that doesn't sound too good to me.

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

3. Android for Joggers & Walkers

4. Don't believe me on my stats? SEE THIS VIDEO Download....

5. Eclipse Android preferences disappear after installing a second plugin

6. after hello world, standard calendar does not run in Eclipse, Howto resolve?

7. Which version of Android?