Author Topic: Offline Mode - Reduce size of database  (Read 2151 times)

0 Members and 1 Guest are viewing this topic.

Offline VanguardLH

  • Jr. Member
  • **
  • Posts: 98
Offline Mode - Reduce size of database
« on: August 10, 2016, 01:50:54 AM »
Avast Wifi Finder sucks up around 50 MB of data storage.  Do you use compression?  Seems you eat up around 200 bytes per record which is raw (no compression). 

How much (in bytes) is stored in each record in your database for a wifi hotspot?
Is the database compressed?

I have moved the Avast WiFi Finder app to the SD card.  Thanks for allowing that.  Still, when I go into the Application Manager and look at the App Info on the Avast Wifi app, I see:

Total: 72.29 MB
Application: 8.19 MB
SD card app: 13.25 MB
Data: 50.46 MB
SD card data: 396 KB

I'm too new to smartphones to know if 21.44 MB (8.19 MB main + 13.25 MB SD card) is considered overly large for this type of app.  It seems a fat app.  What is disturbing is that almost NONE of the database got moved to the SD card when I elected to move the app (or part of it) to the SD card.  That 50 MB is eating up main memory.

There may be performance considerations in having data moved to the SD card, like it would be slower to retrieve the database or read records from it when on the SD card.  How fast do lookups need to be?  There is a polling or scanning interval and the time to read a database's record from a SD card would be trivial to the polling interval. 

If the user has GPS enabled, why not store only a 10-mile radius of wifi hotspots in a cache in main memory?  As the user moved around, the cache would get updated (mostly at the fringe of the radius) to reflect changes in hotspots.  Then the "local" lookup would be in main memory but the bulk of the hotspots the user could never be near would still be in SD storage.

The user cannot move around fast enough to warrant having the entire database in main memory.  The fastest a user will ever travel is while on an airplane but even then the user cannot connect to the ground-based hotspots and the one on the airplane is moving along with the user.  There is no need to have the entire database residing in main memory.  Just pick a decent-sized radius from the user's current GPS location to cache that much smaller list of hotspots into main memory.

If the user doesn't have GPS or other location services running then, yes, you probably do need to have the entire database in main memory because the app won't know where is the user relative to all the hotspots listed in the database.