Applications that should not be installed on External Storage
When a user enables USB memory to share files with a computer (or detaches or removes external memory), any application installed on the external memory that is currently running will be killed. The system does not effectively detect the existence of the referenced program until the USB memory is disabled and the external memory is remounted to the device. In addition to terminating the application and making it invalid to the user, this can also interrupt some more serious application types. To make your application as expected, if it uses the following features, you should not allow your application to be installed on external storage, when the external storage is detached, it may cause some consequences:
Services
When the external storage is detached, the running service will be terminated, and it will not be restarted when the external storage is remounted. However, you can register the broadcast intent of the action_external_applications_available type. When the application installed on the external storage is valid for the system again, it will send a notification to your application. In this case, you can restart your service.
Alarm services
The alarm you registered with alarmmanager will be canceled. When the external memory is remounted, you must manually register the alarm.
Input Method Engines
Your IME will be replaced by the default ime. When the external storage is remounted, you can enable the system settings to re-enable your ime.
Live wallpapers
Your running livewallpaper will be replaced by the default livewallpaper. When the external storage is remounted, you can select your livewallpaper again.
APP Widgets
Your appwidget will be deleted from the home screen. When the external storage is remounted, your appwidget will not automatically work for users unless the system resets the primary application (usually until the system restarts ).
Account Managers
The account you created with accountmanager will not be displayed until the external storage is remounted.
Sync adapters
It is not until the external memory is remounted that your abstractthreadedsyncadapter and all asynchronous functions will work.
Device Administrators
Your deviceadminreceiver and all administrator capabilities will be disabled, which may produce some unpredictable results and even continue after the external storage is remounted.
Broadcast receiverslistening for "Boot completed"
Before the external memory is detached from the device, the system sends an action_boot_completed broadcast. If your application is installed on external storage, it will not receive this broadcast.
Copy protection
If your application uses the replication protection feature of googlyplay, your application will not be installed on the device's SD card. However, if you use applplay's applicationlicensing instead, your application
The program can be installed on internal or external storage, including the SD card.
If your application uses the above features, you should not allow your application to be installed on external storage. Mo
The system does not allow your applications to be installed on external storage, so you do not have to worry about existing applications. However, if you are sure that your application cannot be installed on external storage, you should declare the anroid: installlocation attribute with the "internalonly" value. Although this will not change the default behavior, it will clearly indicate that your application can only be installed on the internal storage, and tell other developers that it is already determined.
Applications that should be installed on External Storage
Simply put, any application that does not use the features listed above is safe to install on external memory. Generally, some large games allow applications to be installed on external memory, because the games do not provide additional services when they are not active. When the external memory is invalid and the game process is killed, it does not affect the visual effect of the external memory when it becomes effective again and when the user restarts the game (assuming that the game correctly stores their status in the standard activity lifecycle ).
If your application requires several MB of storage space, you should carefully consider whether to allow the application to be installed on external storage so that users can retain the space of internal storage.