Is there any way in Java to actually find out if your android application is installed on the SD-Card or the Internal Phone storage.
If my application is installed on the Internal Phone storage, and my application creates a text file, then the text file is also stored on the Internal Phone storage, right? So when moving the application to the SD-Card, would the text file move to the SD-Card too?
Does that make sense? =P
Thanks in advance.
Look at ApplicationInfo.FLAG_EXTERNAL_STORAGE
Not necessarily – it depends what method you use to create the file. Creating internal or external files generally use completely different methods.
For example the preferred method to create internal files is to use..
Similarly the preferred method for reading internal files is…
If the original file was moved to SD card then it wouldn’t be found as
openFileInput(String name)only works for internal storage. In other words if the move process moved internal files, it would ‘break’ the programmer’s code.No, creation of data files and where they are stored is independent of where the actual app is physically installed for the reason above.