What is a maximum size of SQLite database on Android?

后端 未结 4 2042
鱼传尺愫
鱼传尺愫 2020-11-27 17:05

I have a SQLite db that size is over 2.6 GiB. (The db contains maps.) This db is used by RMaps app. When move the maps to some parts at maximum zoom, the app suddenly closes

4条回答
  •  孤城傲影
    2020-11-27 17:40

    I suspect it is ~2 gigabytes (that might be due to 32-bit architecture, although certain programs come with largefile support, allowing more that that). Fortunately android.database.sqlite.SQLiteDatabase has following API call that returns the maximum size the database may grow to:

    long getMaximumSize()
    

    Eventually you might want to look into database sharding ;)

提交回复
热议问题