(1) put in AndroidManifest.xml
(2)put android:settingsActivity="com.foo.FooSettings" in tab in foo.xml under @xml
(3)write foo_settings.xml and string.xml then put them into @xml and @value respectively.
(4)write Java codes using addPreferencesFromResource and so on.