what happens when move an application to SD card

Ali Abdolahi Source

android 2.2 introduce new feature that provide an ability to move an application to SD card or usb storage of phone.

sample of move to SD http://pad3.whstatic.com/images/e/e8/Move-Applications-from-Internal-Memory-to-an-SD-Card-on-an-Android-Phone-Step-4.jpeg

i want to know what happens when a user choose "move to SD card" on android app info,

  • what file's of application moves?
  • where is moved files on SD card or where is new installation address?
  • is there a way to handle what file's move and what files not move?
  • how can i address new moved applications folder, for example database folder (before moving i can address it like "/data/data/APP_PACKAGE/databases/" )?
androidandroid-manifestandroid-sdcard

Answers

answered 4 years ago CommonsWare #1

android 2.2 introduce new feature that provide an ability to move an application to SD card or usb storage of phone

Note that this has been obsolete for years; you will not find this option on most Android 3.0+ devices.

what file's of application moves?

Quoting the documentation:

The .apk file is saved on the external storage, but all private user data, databases, optimized .dex files, and extracted native code are saved on the internal device memory.

 

where is moved files on SD card or where is new installation address?

That is undocumented. Nothing that you access normally as a developer moves from wherever you accessed it before.

is there a way to handle what file's move and what files not move?

No, other than to not move the app at all (e.g., android:installLocation="internalOnly").

how can i address new moved applications folder, for example database folder (before moving i can address it like "/data/data/APP_PACKAGE/databases/" )?

NEVER HARDCODE PATHS.

You can access the path to a database via getDatabasePath().

comments powered by Disqus