How to get the current sqlite database size or package size in Android?

前端 未结 4 1246
别跟我提以往
别跟我提以往 2020-12-10 03:50

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/

4条回答
  •  佛祖请我去吃肉
    2020-12-10 04:41

    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

提交回复
热议问题