The MAF Setting Screen component provides extensions to the Android standard preferences. Native preference controls can only handle string and Boolean values. MAF controls extend the native preferences by adding float, long, and integer datatype handling, and skinnability functionality.
<?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" xmlns:sap="http://sap.com/" > <PreferenceCategory android:title = "Sample Preferences"> <com.sap.maf.uicontrols.settingscreen.MAFIntegerPreference android:key = "TestIntegerPref" android:title = "Test Integer Preferences" android:defaultValue = "100" /> <com.sap.maf.uicontrols.settingscreen.MAFFloatPreference android:key = "TestFloatPref" android:title = "Test Float Preferences" android:defaultValue = "1.2" /> <com.sap.maf.uicontrols.settingscreen.MAFLongPreference android:key = "TestLongPref" android:title = "Test Long Preferences" android:defaultValue = "123456" /> <com.sap.maf.uicontrols.settingscreen.MAFStringPreference android:key = "TestStringPref" android:title = "Test String Preferences" android:defaultValue = "test" /> <com.sap.maf.uicontrols.settingscreen.MAFPreference android:key = "TestSimplePref" android:title = "Test Simple Preferences" /> <com.sap.maf.uicontrols.settingscreen.MAFListPreference android:key = "TestListPref" android:title = "Test List Preferences" android:entries = "@array/listpref" android:entryValues="@array/listprefvalues" /> </PreferenceCategory> <PreferenceCategory android:title = "Sample Preferences Section2"> <com.sap.maf.uicontrols.settingscreen.MAFBooleanPreference android:key = "TestBoolPref" android:title = "Test Boolean Preferences" android:defaultValue = "false" /> </PreferenceCategory> </PreferenceScreen> To use the native Android preference activity programmatically, enter: public class SamplePreferenceActivity extends PreferenceActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.preferences); } }