EDIT: The problem described below was due to a very peculiar device issue not caused by any coding-related problem.
I have a preferenceActi
On the client's main test device I came across the very same issue. The Device used is a Samsung Galaxy S with SDK level 8 (2.2.1).
The strange behavior is that either SharedPreferences
are not saved, or, as after a factory reset, they're too persistent, that is to say they are not deleted after having reinstalled the application.
Due to the current distribution of 2.2.x, and the number of Samsung Galaxy S devices sold being several millions, the probability of an occurrence of this issue is significant.
So it can be considered as crucial to implement a workaround for saving preferences.
For collecting detailed characteristics to isolate this workaround in a sharp-edged way, could everyone who is also facing that issue please provide the corresponding kernel version (System.getProperty("os.version"
) here?
I was thinking of something like this:
// !! I know that 2.6.32.9 is not yet correct. This would be a false positive !!
if ((System.getProperty("os.version").startsWith("2.6.32.9"))
&& (android.os.Build.DEVICE.contains("GT-I9000")))
useInternalStorage();
else
useSharedPreferences();
I can post the real code here also once it's ready and someone is interested.
EDIT: some additional information:
Devices facing that issue:
Property | Values ---------------------------------+------------------------------------ Build.DEVICE | "GT-I9000T" Build.VERSION.INCREMENTAL | "UBJP9" Build.VERSION.RELEASE | "2.2.1" Build.VERSION.SDK | 8 System.getProperty("os.version") | "2.6.32.9"
Similar devices NOT facing that issue:
Property | Values ---------------------------------+------------------------------------ Build.DEVICE | "GT-I9000" Build.VERSION.INCREMENTAL | "AOJP4" Build.VERSION.RELEASE | "2.2" Build.VERSION.SDK | 8 System.getProperty("os.version") | "2.6.32.9"