So, Shared preferences also last saved in internal file storage .
the Share preferences as a key-value pair, it stores data in memory and, finally, is stored in the internal file storage by the system.
if you want to access the value often, you can use Shared preferences .
If the data structure is small and not complicated, you can direct use Share preferences
if you just want to save the data, and a lot of memory space will be taken for the data, you can simply use the file to save.
source share