Why only CalenGoo’s database can be moved to the SD card:
Sometimes users ask if CalenGoo can be installed on their SD card instead of the internal memory of their phone, because a few phones have only a small amount of internal memory. The reason why the app itself cannot be moved to the SD card is described in Android’s official documentation here:http://developer.android.com/guide/appendix/install-location.html#ShouldNot
The important parts are
- Services
Your running Service will be killed and will not be restarted when external storage is remounted. You can, however, register for the ACTION_EXTERNAL_APPLICATIONS_AVAILABLE broadcast Intent, which will notify your application when applications installed on external storage have become available to the system again. At which time, you can restart your Service. - Alarm Services
Your alarms registered with AlarmManager will be cancelled. You must manually re-register any alarms when external storage is remounted.
- App Widgets
Your App Widget will be removed from the home screen. When external storage is remounted, your App Widget will not be available for the user to select until the system resets the home application (usually not until a system reboot).
- Broadcast Receivers listening for "boot completed"
The system delivers the ACTION_BOOT_COMPLETED broadcast before the external storage is mounted to the device. If your application is installed on the external storage, it can never receive this broadcast.
So it isn’t possible to move the CalenGoo app to the SD card, but you can move its database to the SD card, then it will only use about 5 MB of internal memory.
How to move CalenGoo’s database to the SD card
To move CalenGoo’s database to the SD card, you just have to turn “Settings > Display and Use > Maintenance > Move DB to SD card” on. Then only the app itself will remain in the internal memory of your phone and it needs only a few MB.Why the SD card isn’t the SD card on some devices
CalenGoo uses the official Android commandgetExternalStorageDirectory
to get the SD card directory where it will write certain files into. However on some devices this isn’t really the SD card, but a special part of the internal memory that emulates what used to be the SD card. It is a decision of the device’s manufacturer, which directory is returned by this command. However this is the only command that the Android SDK offers to find the SD card directory, so CalenGoo can use only this command to find the directory. But even if it doesn’t point to your device’s SD card, it should nevertheless point to a directory that can be accessed from your computer when connecting the device via USB.
Advantages/Disadvantages of turning "Move DB to SD card" on
Advantages | Disadvantages |
---|---|
Saves internal memory | Connecting the phone to a computer via USB can block the SD card and prevent CalenGoo from accessing its database while the phone is connected. |
DB survives uninstalling an reinstalling CalenGoo. I.e. you can uninstall CalenGoo and when you install it again, it automatically finds its database on your SD card and uses it. | The SD card is a public directory, i.e. other apps can access the "calengoo.sqlite" file, too. |
The file "calengoo.sqlite" can be accessed and copied somewhere else as a backup. |