Advanced: Internal and external storage

With Release 1.1.4 GeOrg gives you the choice between storing its data in internal phone memory or using the external storage aka removable storage aka sd-card. This is how it works:

About Android-Storage

Each and every android based phone has internal and external storage (except when you remove your sd-card ;-) ).

Internal memory is built into the device from the start. The regular user normally cannot exchange it, usually you don’t even access it directly. Since it is very important for the device (this is where the operating system and – on non-rooted phones – all your apps and typically their data reside) it’s normally high quality, speedy memory that’s costly and therfore often limited (especially on G1 phones).

External memory on the other side is the removable Micro-SD-Card that you can take out of your device, exchange or mount to your computer. Space normally isn’t a problem here as we are talking GB and not MB.

Remark: Some newer devices manufactured by Samsung feature two “external memories”, with only one of them being removable. On these devices we are talking about the builtin memory here – the one, you can’t remove – as external memory (/sdcard and not /sdcard/sd).

Since the internal memory is so limited on some devices, users who have rooted their phones often use tools like Apps2SD that allow them to store apps to their external memory.

Another thing to consider about internal memory is that it gets wiped when you install a CustomROM to your phone. You have to reinstall everything that used to reside there after installing a new ROM.

CacheDBs in GeOrg

GeOrg saves all its data in one big SQLite-Database (a plain file). This database contains:

  • All CacheDBs and their content
  • All common waypoints
  • Some additional information about the database structure

The SQLite-database is by default placed in internal memory – like GeOrg is. This decision was originally made considering the …

Advantages of using internal memory:

  • Fast
  • Always accessible, user cannot remove it and cause crashes in doing so

Of course, there are also some …

Disadvantages of using internal memory:

  • Limited on some devices
  • Gets overwritten when flashing a new rom
  • User can’t backup GeOrgs data (except when he’s root)
  • Uninstalling GeOrg for any reason completly removes all CacheDBs and Waypoints

Especially the last point gathered some importance when we wanted to switch off copy protection for GeOrg in the market when migrating to version 1.1.5. We suspected that due to a market-bug some users would have to reinstall GeOrg after that update (looking back we now know of at least 4 users who reported they ran into this issue). Users who had to reinstall GeOrg would lose all data if they couldn’t save data to external memory, especially since there was no waypoint export at that time.

The new storage-selection-feature allows you to move you complete SQLite-database between internal and external storage and switch between the two – even to keep different versions of your data in parallel.

It’s useful if you:

  • have problems with limited space in internal memory
  • want to backup your exported database (available on your sd-card at /georg_data/db/GEORGEXTDB)
  • want to flash a new rom and want to export/backup your data befor flashing
  • want to access GeOrgs data directly via SQLite

Usage

These are the options in the new CacheDB-Actions-menu on the MainPage:

  • Switch Storage:
    Switches between using your internal SQLite-database and your external database. This doesn’t change any data, you just select a different SQLite-database possibly containing different CacheDBs and Waypoints.
    This change is reflected by a short (int) or (ext) on the MainPage:

  • Export to external:
    Copies the complete SQLite-database (all CacheDBs and Waypoints) from internal to external storage, overwriting any data that used to exist in your external storage (at /georg_data/db/GEORGEXTDB on your sd-card)

  • Export to internal:
    The other way around. Overwrites data in internal storage.

Copying/Moving of single CacheDBs from and to internal and external storage is not planned currently.