[Sony Cross-Device Development Themes and Apps] venkat kamesh:
About preferences

Here i will give small example what we can do in preferences

So in above post there you had krypton_settings.xml

open with notepad++

you will find this

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:icon="@drawable/ic_settings_kamesh" android:title="@string/wireless_networks_settings_title"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">

</PreferenceScreen>

you can add subsettings / switches / color boxes / checkboxes/ External app shortcuts/ Seekbar and almost all

Adding Shortcut of another APP to your settings

1. For example i need to add my kryptonian app as shortcut

Decompile the Kryptonian app ( any app you wish to add )

and open AndroidManifest.xml

you need to find Package and Targets of the app as i shown in picture below

if you find these package and target here go the code you need to add

<Preference android:enabled="true" android:title="Kryptonian Shortcut" android:summary="discription you like to give">
<intent android:targetPackage="[COLOR="SandyBrown"]com.wubydax.krypton[/COLOR]" android:action="android.intent.action.MAIN" android:targetClass="[COLOR="sandybrown"]com.wubydax.krypto[/COLOR][COLOR="Red"].MainViewActivity[/COLOR]" />
</Preference>

adding this to preference look like

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:icon="@drawable/ic_settings_kamesh" android:title="@string/wireless_networks_settings_title"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">

[COLOR="DeepSkyBlue"] <Preference android:enabled="true" android:title="Kryptonian Shortcut" android:summary="discription you like to give">
<intent android:targetPackage="[COLOR="SandyBrown"]com.wubydax.krypton[/COLOR]" android:action="android.intent.action.MAIN" android:targetClass="[COLOR="sandybrown"]com.wubydax.krypto[/COLOR][COLOR="Red"].MainViewActivity[/COLOR]" />
</Preference>[/COLOR]

</PreferenceScreen>

and done you will have a Shortcut .. click on that you will enter to that app ( make sure the defined app installed )

Adding SubSettings to Subsettings ( preferences )

1. Follow Post one and Skip point 3 and follow Point 4

and done :p

Adding SubSettings to Subsettings Or DashBoard Settings without any Smali( preferences )

Just create any example.xml

add this preference code to empty example.xml

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:icon="@drawable/ic_settings_kamesh" android:title="@string/wireless_networks_settings_title"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">

</PreferenceScreen>

so if you need to wake this example.xml all you need is

add this code to any display or any xml you like to add

<PreferenceScreen android:icon="[COLOR="SandyBrown"]@drawable/ic_sony_kamesh[/COLOR]" android:id="@+id/example_id" android:title="Give title" android:fragment="com.sonymobile.settings.GenericSettingsFragment">
<extra android:name="extra_after_id" android:value="data_usage_settings" />
[COLOR="Red"]<extra android:name="extra_fragment_preference_xml" android:value="example" [/COLOR]/>
</PreferenceScreen>

the red line value is the name of XML you give

and Done ...!

compile and test

Adding Switches and Checkbox ( preferences )

Follow this Tut

Click here

Adding Seekbar Preferences (easy use no heavy smali trails everyone can play)

Follow this link

Click here

Adding Color Preferences (easy use no heavy smali trails everyone can play)

Follow this Guide

Click here