The comments already answered your question, but I'll provide some details.
Shared preferences are serialized and stored in an XML - for example for the com.android.calendar
app it looks like this:
$ adb shell ls -la /data/data/com.android.calendar/shared_prefs/
-rw-rw---- u0_a6 u0_a6 126 2015-08-03 17:21 _has_set_default_values.xml
-rw-rw---- u0_a6 u0_a6 658 2015-08-05 23:05 com.android.calendar_preferences.xml
And the XML is serialized to look like this:
$ adb shell cat /data/data/com.android.calendar/shared_prefs/com.android.calendar_preferences.xml
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<string name="preferences_week_start_day">2</string>
<string name="preferences_alerts_vibrateWhen">never</string>
<int name="preferred_startView" value="3" />
<boolean name="preferences_alerts" value="true" />
<boolean name="preferences_hide_declined" value="true" />
<string name="preferences_alerts_ringtone">content://settings/system/notification_sound</string>
<boolean name="preferences_home_tz_enabled" value="false" />
<string name="preferences_default_reminder">10</string>
<string name="preferences_home_tz">GMT</string>
<int name="preferences_default_cell_height" value="96" />
</map>
You can see how this is done by looking at the source of SharedPreferencesImpl
, which calls XmlUtils.writeMapXml
to save the preferences...
See line 636 to see how each value in the map is written in the XML.
Also see this question Shared Preferences "limit" where @CommonsWare warns that the entire XML file is read into memory so you wouldn't want to store "100KBS", I assume he means something like "hundreds of KBs". A reasonable arbitrary maximum is probably around a few hundred KBs.
So I'd say as long as the data you're storing is lightweight (i.e. is reasonable to be read/stored) as XML in the format listed above, you're OK and don't need Sqlite.