I wanted to follow the good paths and try to use Android's Preference API. From the documentation:
If you want to provide settings for your app, you should use Android's Preference APIs to build an interface that's consistent with the user experience in other Android apps (including the system settings).
I tried to make a simple proof-of-concept XML file for this:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:title="Profile information"
android:key="pref_key_profile_settings">
<EditTextPreference
android:title="Username"
android:key="pref_key_username"
android:defaultValue="John Doe"/>
<EditTextPreference
android:title="Phone number"
android:key="pref_key_phone_number"/>
<EditTextPreference
android:title="Email"
android:key="pref_key_email"/>
</PreferenceCategory>
<PreferenceCategory
android:title="Account"
android:key="pref_key_account_settings">
<Preference
android:key="pref_key_credit"
android:title="Remaining calling credits"
android:summary="Calling credits are consumed by the second on a per-call basis. Rates vary according to destination. During testing phases, call credits are offered and may not be topped up."/>
</PreferenceCategory>
<PreferenceCategory
android:title="Text-Call"
android:key="pref_key_text_call_settings">
</PreferenceCategory>
<PreferenceCategory
android:title="Application"
android:key="pref_key_application_settings">
</PreferenceCategory>
</PreferenceScreen>
The end result is pretty disappointing. It renders more or less the same as system Settings in Nexus 5, while on LG L Fino or Samsung Galaxy S4 it is completely different than native Android Settings.
Am I missing something (a style?) or does the statement from the documentation about being inline with other apps on the device is nothing more than a wish that has never become a true?
And here it how it looks like on Samsung S4: the demo and Gmail settings. The checkboxes are not the same, the fonts and colours as well. Does it mean every app settings UI look and feel is different? Where is the consistency?