diff --git a/jni/sflphone b/jni/sflphone
index 9d8f134c27febd9cecf1b8b3dacb94f6cce92304..59e26a8cc4692d36df5f61db0340b895d1be0d70 160000
--- a/jni/sflphone
+++ b/jni/sflphone
@@ -1 +1 @@
-Subproject commit 9d8f134c27febd9cecf1b8b3dacb94f6cce92304
+Subproject commit 59e26a8cc4692d36df5f61db0340b895d1be0d70
diff --git a/res/layout/dialog_codecs_list.xml b/res/layout/dialog_codecs_list.xml
deleted file mode 100644
index a37e3793b57152fa74cdb3a2416e3721525099f8..0000000000000000000000000000000000000000
--- a/res/layout/dialog_codecs_list.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:orientation="vertical"
-    android:weightSum="1" >
-
-    <TextView
-        android:id="@+id/list_header_title"
-        style="?android:attr/listSeparatorTextViewStyle"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:paddingBottom="2dip"
-        android:paddingLeft="5dip"
-        android:paddingTop="2dip"
-        android:text="Codecs" />
-
-    <org.sflphone.views.dragsortlv.DragSortListView
-        xmlns:dslv="http://schemas.android.com/apk/res/org.sflphone"
-        android:id="@+id/dndlistview"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_margin="3dp"
-        android:choiceMode="multipleChoice"
-        android:descendantFocusability="beforeDescendants"
-        android:dividerHeight="1px"
-        android:padding="3dp"
-        dslv:collapsed_height="1px"
-        dslv:drag_enabled="true"
-        dslv:drag_handle_id="@id/drag_handle"
-        dslv:drag_scroll_start="0.33"
-        dslv:drag_start_mode="onLongPress"
-        dslv:float_alpha="0.6"
-        dslv:float_background_color="@color/sfl_action_blue"
-        dslv:remove_enabled="false"
-        dslv:slide_shuffle_speed="0.3" />
-
-    <ListView
-        android:id="@android:id/list"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent" >
-    </ListView>
-
-</LinearLayout>
\ No newline at end of file
diff --git a/res/layout/double_number_picker_dialog.xml b/res/layout/double_number_picker_dialog.xml
new file mode 100644
index 0000000000000000000000000000000000000000..c31f11ad7836bd23d2e44d961e1b430e9724c0a7
--- /dev/null
+++ b/res/layout/double_number_picker_dialog.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2011 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="match_parent"
+    android:baselineAligned="false"
+    android:gravity="center_horizontal"
+    android:orientation="horizontal"
+    android:weightSum="4" >
+
+    <Space
+        android:layout_width="0dp"
+        android:layout_height="match_parent"
+        android:layout_weight="1" />
+
+    <LinearLayout
+        android:layout_width="0dp"
+        android:layout_height="match_parent"
+        android:layout_weight="1"
+        android:gravity="center"
+        android:orientation="vertical" >
+
+        <TextView
+            android:id="@+id/picker_title_1"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:textAppearance="?android:textAppearanceMedium" />
+
+        <NumberPicker
+            android:id="@+id/number_picker_1"
+            android:layout_width="50dip"
+            android:layout_height="match_parent" />
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="0dp"
+        android:layout_height="match_parent"
+        android:layout_weight="1"
+        android:gravity="center"
+        android:orientation="vertical" >
+
+        <TextView
+            android:id="@+id/picker_title_2"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:textAppearance="?android:textAppearanceMedium" />
+
+        <NumberPicker
+            android:id="@+id/number_picker_2"
+            android:layout_width="50dip"
+            android:layout_height="match_parent" />
+    </LinearLayout>
+
+    <Space
+        android:layout_width="0dp"
+        android:layout_height="match_parent"
+        android:layout_weight="1" />
+
+</LinearLayout>
\ No newline at end of file
diff --git a/res/layout/frag_audio_mgmt.xml b/res/layout/frag_audio_mgmt.xml
new file mode 100644
index 0000000000000000000000000000000000000000..d3171f53245263594fb44b1efad90d8d742d8ecd
--- /dev/null
+++ b/res/layout/frag_audio_mgmt.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    android:weightSum="1" >
+
+    <TextView
+        android:id="@+id/list_header_title"
+        style="?android:attr/listSeparatorTextViewStyle"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:paddingBottom="2dip"
+        android:paddingLeft="5dp"
+        android:layout_marginLeft="10dp"
+        android:layout_marginRight="10dp"
+        android:paddingTop="2dp"
+        android:text="Codecs" />
+
+    <LinearLayout
+        android:id="@+id/lv_holder"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="vertical"
+        android:weightSum="1" >
+
+        <org.sflphone.views.dragsortlv.DragSortListView
+            xmlns:dslv="http://schemas.android.com/apk/res/org.sflphone"
+            android:id="@+id/dndlistview"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_margin="5dp"
+            android:choiceMode="multipleChoice"
+            android:descendantFocusability="beforeDescendants"
+            android:dividerHeight="1px"
+            android:padding="5dp"
+            dslv:collapsed_height="1px"
+            dslv:drag_enabled="true"
+            dslv:drag_handle_id="@id/drag_handle"
+            dslv:drag_scroll_start="0.33"
+            dslv:drag_start_mode="onLongPress"
+            dslv:float_alpha="0.6"
+            dslv:float_background_color="@color/sfl_action_blue"
+            dslv:remove_enabled="false"
+            dslv:slide_shuffle_speed="0.3" />
+    </LinearLayout>
+
+    <ListView
+        android:id="@android:id/list"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content" >
+    </ListView>
+
+</LinearLayout>
\ No newline at end of file
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index a1f3a909381df6307388b0482dad416693522697..be6f9d4b107652fd60fbc1ca2cfcdae4cc761d60 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -56,5 +56,17 @@ as that of the covered work.
         <item>@string/action_call_attended_transfer</item>
         <item>@string/action_call_conference</item>
     </string-array>
+    
+    <string-array name="srtp_entry_values">
+        <item>Deactivated</item>
+        <item>ZRTP</item>
+        <item>SDES</item>
+    </string-array>
+    
+    <string-array name="srtp_entry">
+        <item>Deactivated</item>
+        <item>ZRTP</item>
+        <item>SDES</item>
+    </string-array>
 
 </resources>
\ No newline at end of file
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index bf7c834cf854665ab9055c6409614f619d5269b9..ee2f343f6a799604d0b288ee65e83dedbab6259e 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -89,5 +89,19 @@
         <attr name="maxExternal" format="string" />
         <attr name="minExternal" format="string" />
     </declare-styleable>
+    <declare-styleable name="DoubleNumberPickerPreference">
+        <attr name="defaultValue1" format="integer" />
+        <attr name="defaultValue2" format="integer" />
+        <attr name="max1" format="integer" />
+        <attr name="min1" format="integer" />
+        <attr name="max2" format="integer" />
+        <attr name="min2" format="integer" />
+        <attr name="maxExternal1" format="string" />
+        <attr name="minExternal1" format="string" />
+        <attr name="maxExternal2" format="string" />
+        <attr name="minExternal2" format="string" />
+        <attr name="pickerTitle1" format="string" />
+        <attr name="pickerTitle2" format="string" />
+    </declare-styleable>
 
 </resources>
\ No newline at end of file
diff --git a/res/xml/account_advanced_prefs.xml b/res/xml/account_advanced_prefs.xml
index 8fd4d44bda811418eaff92052f968c680342ec4f..d775a6263c535cf956a91b73751dea421493687f 100644
--- a/res/xml/account_advanced_prefs.xml
+++ b/res/xml/account_advanced_prefs.xml
@@ -36,37 +36,46 @@ as that of the covered work.
     <PreferenceCategory
         android:id="@+id/account_advanced_category"
         android:title="Advanced settings" >
-        <org.sflphone.views.NumberPickerPreference
+        <org.sflphone.views.DoubleNumberPickerPreference
             android:id="@+id/account_registration_expire"
             android:key="Account.registrationExpire"
             android:persistent="false"
             android:title="Registration Expire"
-            app:max="1000"
-            app:min="10" />
+            app:defaultValue1="6"
+            app:defaultValue2="0"
+            app:max1="99"
+            app:max2="99"
+            app:min1="1"
+            app:min2="0" />
 
         <ListPreference
-            android:id="@+id/account_creation_local_interface"
+            android:id="@+id/account_local_interface"
             android:key="Account.localInterface"
             android:persistent="false"
             android:title="Local Interface" />
 
-        <EditTextPreference
+        <org.sflphone.views.DoubleNumberPickerPreference
             android:id="@+id/account_local_port"
             android:key="Account.localPort"
             android:persistent="false"
-            android:title="Local Port" />
+            android:title="Local Port"
+            app:defaultValue1="50"
+            app:defaultValue2="60"
+            app:max1="99"
+            app:max2="99"
+            app:min1="1"
+            app:min2="0" />
 
         <CheckBoxPreference
-            android:id="@+id/account_creation_stun_enable"
-            android:defaultValue="false"
+            android:id="@+id/account_stun_enable"
             android:key="STUN.enable"
             android:persistent="false"
-            android:summaryOff="disabled"
-            android:summaryOn="enabled"
-            android:title="Stun Enabled" />
+            android:summaryOff="Disabled"
+            android:summaryOn="Enabled"
+            android:title="Use Stun" />
 
         <EditTextPreference
-            android:id="@+id/account_creation_stun_server"
+            android:id="@+id/account_stun_server"
             android:defaultValue=""
             android:enabled="false"
             android:key="STUN.server"
@@ -75,242 +84,30 @@ as that of the covered work.
             android:title="Stun Server" />
 
         <CheckBoxPreference
-            android:id="@+id/account_creation_published_sameas_local"
+            android:id="@+id/account_published_sameas_local"
             android:key="Account.publishedSameAsLocal"
             android:persistent="false"
             android:title="Published same as local" />
 
-        <EditTextPreference
-            android:id="@+id/account_creation_published_port"
+        <org.sflphone.views.DoubleNumberPickerPreference
+            android:id="@+id/account_published_port"
             android:enabled="false"
             android:key="Account.publishedPort"
             android:persistent="false"
-            android:title="Published Port" />
+            android:title="Published Port"
+            app:defaultValue1="50"
+            app:defaultValue2="60"
+            app:max1="99"
+            app:max2="99"
+            app:min1="1"
+            app:min2="0" />
+
         <EditTextPreference
-            android:id="@+id/account_creation_published_address"
-            android:defaultValue="0.0.0.0"
+            android:id="@+id/account_published_address"
             android:enabled="false"
             android:key="Account.publishedAddress"
             android:persistent="false"
             android:title="Published Address" />
     </PreferenceCategory>
-    <!-- <EditTextPreference -->
-    <!-- android:id="@+id/account_creation_credential_number" -->
-    <!-- android:key="Credential.count" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="0" -->
-    <!-- android:title="Credential Number" -->
-    <!-- android:summary="0"/> -->
-    <!-- <EditTextPreference -->
-    <!-- android:id="@+id/account_creation_dtmf_type" -->
-    <!-- android:key="Account.dtmfType" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="SIP" -->
-    <!-- android:title="DTMF Type" -->
-    <!-- android:summary="SIP"/> -->
-    <!-- <EditTextPreference -->
-    <!-- android:id="@+id/account_creation_ringtone_path" -->
-    <!-- android:key="Account.ringtonePath" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="" -->
-    <!-- android:title="Ringtone Path"/> -->
-    <!-- <CheckBoxPreference -->
-    <!-- android:id="@+id/account_creation_ringtone_enabled" -->
-    <!-- android:key="Account.ringtoneEnabled" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="true" -->
-    <!-- android:title="Ringtone Enabled"/> -->
-    <!-- <CheckBoxPreference -->
-    <!-- android:id="@+id/account_creation_keep_alive" -->
-    <!-- android:key="Account.keepAliveEnabled" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="false" -->
-    <!-- android:title="Keep Alive"/> -->
-
-
-    <!-- android:id="@+id/account_creation_display_name" -->
-    <!-- android:key="Account.displayName" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="SFLPhone" -->
-    <!-- android:title="Display Name" -->
-    <!-- android:summary="SFLPhone"/> -->
-
-
-    <!-- <PreferenceCategory -->
-    <!-- android:id="@+id/account_srtp_category" -->
-    <!-- android:title="SRTP settings"> -->
-    <!-- <CheckBoxPreference -->
-    <!-- android:id="@+id/account_creation_srtp_enable" -->
-    <!-- android:key="SRTP.enable" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="false" -->
-    <!-- android:title="SRTP Enabled" -->
-    <!-- android:summaryOn="enabled" -->
-    <!-- android:summaryOff="disabled"/> -->
-    <!-- <CheckBoxPreference -->
-    <!-- android:id="@+id/account_creation_srtp_key_exchange" -->
-    <!-- android:key="SRTP.keyExchange" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="false" -->
-    <!-- android:title="SRTP Key Exchange" -->
-    <!-- android:summaryOn="enabled" -->
-    <!-- android:summaryOff="disabled"/> -->
-    <!-- <CheckBoxPreference -->
-    <!-- android:id="@+id/account_creation_srtp_encryp_algo" -->
-    <!-- android:key="SRTP.encryptionAlgorithm" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="false" -->
-    <!-- android:title="SRTP Encrypt Algo" -->
-    <!-- android:summaryOn="enabled" -->
-    <!-- android:summaryOff="disabled"/> -->
-    <!-- <CheckBoxPreference -->
-    <!-- android:id="@+id/account_creation_srtp_rtp_fallback" -->
-    <!-- android:key="SRTP.rtpFallback" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="false" -->
-    <!-- android:title="SRTP RTP Fallback" -->
-    <!-- android:summaryOn="enabled" -->
-    <!-- android:summaryOff="disabled"/> -->
-    <!-- <CheckBoxPreference -->
-    <!-- android:id="@+id/account_creation_srtp_hello_hash" -->
-    <!-- android:key="ZRTP.helloHashEnable" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="disabled" -->
-    <!-- android:title="ZRTP Hello Hash" -->
-    <!-- android:summaryOn="enabled" -->
-    <!-- android:summaryOff="disabled"/> -->
-    <!-- <CheckBoxPreference -->
-    <!-- android:id="@+id/account_creation_srtp_display_sas" -->
-    <!-- android:key="ZRTP.displaySAS" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="false" -->
-    <!-- android:title="ZRTP Display SAS" -->
-    <!-- android:summaryOn="enabled" -->
-    <!-- android:summaryOff="disabled"/> -->
-    <!-- <CheckBoxPreference -->
-    <!-- android:id="@+id/account_creation_srtp_supported_warning" -->
-    <!-- android:key="ZRTP.notSuppWarning" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="false" -->
-    <!-- android:title="ZRTP Not Supported Warning" -->
-    <!-- android:summaryOn="enabled" -->
-    <!-- android:summaryOff="disabled"/> -->
-    <!-- <CheckBoxPreference -->
-    <!-- android:id="@+id/account_creation_srtp_displaysas_once" -->
-    <!-- android:key="ZRTP.displaySasOnce" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="false" -->
-    <!-- android:title="ZRTP Display SAS Once" -->
-    <!-- android:summaryOn="enabled" -->
-    <!-- android:summaryOff="disabled"/> -->
-
-
-    <!-- </PreferenceCategory> -->
-    <!-- <PreferenceCategory -->
-    <!-- android:id="@+id/account_tls_category" -->
-    <!-- android:title="TLS settings"> -->
-    <!-- <CheckBoxPreference -->
-    <!-- android:id="@+id/account_creation_tls_enable" -->
-    <!-- android:key="TLS.enable" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="false" -->
-    <!-- android:title="TLS Enabled" -->
-    <!-- android:summaryOn="enabled" -->
-    <!-- android:summaryOff="disabled"/> -->
-    <!-- <EditTextPreference -->
-    <!-- android:id="@+id/account_creation_tls_listener_port" -->
-    <!-- android:key="TLS.listenerPort" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="5061" -->
-    <!-- android:title="Listener Port" -->
-    <!-- android:summary="5061"/> -->
-    <!-- <EditTextPreference -->
-    <!-- android:id="@+id/account_creation_tls_certificate_list_file" -->
-    <!-- android:key="TLS.certificateListFile" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="" -->
-    <!-- android:title="TLS Certificate List File" -->
-    <!-- android:summary=""/> -->
-    <!-- <EditTextPreference -->
-    <!-- android:id="@+id/account_creation_tls_certificate_file" -->
-    <!-- android:key="TLS.certificateFile" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="" -->
-    <!-- android:title="TLS Certificate File" -->
-    <!-- android:summary=""/> -->
-    <!-- <EditTextPreference -->
-    <!-- android:id="@+id/account_creation_tls_private_key_file" -->
-    <!-- android:key="TLS.privateKeyFile" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="disabled" -->
-    <!-- android:title="TLS Private Key File" -->
-    <!-- android:summary="disabled"/> -->
-    <!-- <EditTextPreference -->
-    <!-- android:id="@+id/account_creation_tls_password" -->
-    <!-- android:key="TLS.password" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="" -->
-    <!-- android:title="TLS Password" -->
-    <!-- android:summary=""/> -->
-    <!-- <EditTextPreference -->
-    <!-- android:id="@+id/account_creation_tls_method" -->
-    <!-- android:key="TLS.method" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="" -->
-    <!-- android:title="TLS Method" -->
-    <!-- android:summary=""/> -->
-    <!-- <EditTextPreference -->
-    <!-- android:id="@+id/account_creation_tls_ciphers" -->
-    <!-- android:key="TLS.ciphers" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="" -->
-    <!-- android:title="TLS Ciphers" -->
-    <!-- android:summary=""/> -->
-    <!-- <EditTextPreference -->
-    <!-- android:id="@+id/account_creation_tls_server_name" -->
-    <!-- android:key="TLS.serverName" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="" -->
-    <!-- android:title="TLS Server Name" -->
-    <!-- android:summary=""/> -->
-    <!-- <CheckBoxPreference -->
-    <!-- android:id="@+id/account_creation_tls_verify_server" -->
-    <!-- android:key="TLS.verifyServer" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="false" -->
-    <!-- android:title="TLS Verify Server" -->
-    <!-- android:summaryOn="enabled" -->
-    <!-- android:summaryOff="disabled"/> -->
-    <!-- <CheckBoxPreference -->
-    <!-- android:id="@+id/account_creation_tls_verify_client" -->
-    <!-- android:key="TLS.verifyClient" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="false" -->
-    <!-- android:title="TLS Verify Client" -->
-    <!-- android:summaryOn="enabled" -->
-    <!-- android:summaryOff="disabled"/> -->
-    <!-- <CheckBoxPreference -->
-    <!-- android:id="@+id/account_creation_tls_require_client_cert" -->
-    <!-- android:key="TLS.requireClientCertificate" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="false" -->
-    <!-- android:title="TLS Require Client Certificate" -->
-    <!-- android:summaryOn="enabled" -->
-    <!-- android:summaryOff="disabled"/> -->
-    <!-- <EditTextPreference -->
-    <!-- android:id="@+id/account_creation_tls_timeout_sec" -->
-    <!-- android:key="TLS.negotiationTimeoutSec" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="60" -->
-    <!-- android:title="TLS Timeout Sec" -->
-    <!-- android:summary="60"/> -->
-    <!-- <EditTextPreference -->
-    <!-- android:id="@+id/account_creation_tls_timeout_msec" -->
-    <!-- android:key="TLS.negotiationTimeoutMsec" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="0" -->
-    <!-- android:title="TLS Timeout Msec" -->
-    <!-- android:summary="0"/> -->
-    <!-- </PreferenceCategory> -->
 
 </PreferenceScreen>
\ No newline at end of file
diff --git a/res/xml/account_audio_prefs.xml b/res/xml/account_audio_prefs.xml
index d65f9b71e0ff1c57cf3da531a276599b49d23093..106e1a809d3874314e041929167fd2ca1a4580d0 100644
--- a/res/xml/account_audio_prefs.xml
+++ b/res/xml/account_audio_prefs.xml
@@ -32,41 +32,26 @@ as that of the covered work.
 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
 
     <PreferenceCategory
-        android:id="@+id/audio_codec_category"
-        android:key="Audio.codec"
-        android:title="Codecs" >
-
-        <!-- <org.sflphone.views.AudioCodecListPreference -->
-        <!-- android:id="@+id/audio_codecs" -->
-        <!-- android:key="Audio.codec" -->
-        <!-- android:persistent="false" -->
-        <!-- android:title="Codecs" /> -->
+        android:id="@+id/audio_dtmf_category"
+        android:title="Ringtones" >
+        <EditTextPreference
+            android:id="@+id/account_dtmf_type"
+            android:defaultValue="SIP"
+            android:key="Account.dtmfType"
+            android:persistent="false"
+            android:summary="SIP"
+            android:title="DTMF Type" />
+    </PreferenceCategory>
+    <PreferenceCategory
+        android:id="@+id/audio_ringtone_category"
+        android:title="Ringtones" >
+        <EditTextPreference
+            android:id="@+id/audio_ringtone"
+            android:defaultValue=""
+            android:key="Audio.ringtone"
+            android:persistent="false"
+            android:summary=""
+            android:title="Ringtone" />
     </PreferenceCategory>
-    <!-- <PreferenceCategory -->
-    <!-- android:id="@+id/audio_dtmf_category" -->
-    <!-- android:title="Ringtones" > -->
-    <!-- <EditTextPreference -->
-    <!-- android:id="@+id/account_dtmf_type" -->
-    <!-- android:key="Account.dtmfType" -->
-    <!-- android:persistent="false" -->
-    <!-- android:defaultValue="SIP" -->
-    <!-- android:title="DTMF Type" -->
-    <!-- android:summary="SIP"/> -->
-
-
-    <!-- </PreferenceCategory> -->
-
-
-    <!-- <PreferenceCategory -->
-    <!-- android:id="@+id/audio_ringtone_category" -->
-    <!-- android:title="Ringtones" > -->
-    <!-- <EditTextPreference -->
-    <!-- android:id="@+id/audio_ringtone" -->
-    <!-- android:defaultValue="" -->
-    <!-- android:key="Audio.ringtone" -->
-    <!-- android:persistent="false" -->
-    <!-- android:summary="" -->
-    <!-- android:title="Ringtone" /> -->
-    <!-- </PreferenceCategory> -->
 
 </PreferenceScreen>
\ No newline at end of file
diff --git a/res/xml/account_security_prefs.xml b/res/xml/account_security_prefs.xml
index 9151274f6643459b5791ceecb6ec71c90ccea36b..4bcbc6b31cad8ee7229f6c81791fb45bd1e4d68b 100644
--- a/res/xml/account_security_prefs.xml
+++ b/res/xml/account_security_prefs.xml
@@ -37,12 +37,24 @@ as that of the covered work.
         android:title="Credentials" >
         <PreferenceScreen
             android:id="@+id/account_credential_number"
-            android:fragment="org.sflphone.fragments.AdvancedAccountFragment"
             android:key="Credential.count"
             android:title="Credential Number" >
-            <extra
-                android:name="someKey"
-                android:value="somePrefValue" />
+<!--             <CheckBoxPreference -->
+<!--                 android:id="@+id/account_creation_tls_enable" -->
+<!--                 android:defaultValue="false" -->
+<!--                 android:key="TLS.enable" -->
+<!--                 android:persistent="false" -->
+<!--                 android:summaryOff="disabled" -->
+<!--                 android:summaryOn="enabled" -->
+<!--                 android:title="TLS Enabled" /> -->
+
+<!--             <ListPreference -->
+<!--                 android:id="@+id/account_srtp_enable" -->
+<!--                 android:defaultValue="Deactivated" -->
+<!--                 android:key="SRTP.enable" -->
+<!--                 android:persistent="false" -->
+<!--                 android:summary="Deactivated" -->
+<!--                 android:title="SRTP Exchange" /> -->
         </PreferenceScreen>
     </PreferenceCategory>
     <PreferenceCategory
@@ -55,7 +67,7 @@ as that of the covered work.
             android:persistent="false"
             android:summaryOff="disabled"
             android:summaryOn="enabled"
-            android:title="TLS Enabled" />
+            android:title="TLS" />
 
         <ListPreference
             android:id="@+id/account_srtp_enable"
@@ -63,6 +75,8 @@ as that of the covered work.
             android:key="SRTP.enable"
             android:persistent="false"
             android:summary="Deactivated"
+            android:entries="@array/srtp_entry"
+            android:entryValues="@array/srtp_entry_values"
             android:title="SRTP Exchange" />
 
         <PreferenceScreen
@@ -99,7 +113,7 @@ as that of the covered work.
                 android:persistent="false"
                 android:summaryOff="disabled"
                 android:summaryOn="enabled"
-                android:title="TLS Enabled" />
+                android:title="TLS" />
         </PreferenceScreen>
     </PreferenceCategory>
     <!-- <CheckBoxPreference -->
diff --git a/src/org/sflphone/account/AccountDetailAdvanced.java b/src/org/sflphone/account/AccountDetailAdvanced.java
index 2bf771fc75faa8e434e28d382593e9482cef7f7a..236602e1c9a1a0b09bc269f7c5817fd147e503f8 100644
--- a/src/org/sflphone/account/AccountDetailAdvanced.java
+++ b/src/org/sflphone/account/AccountDetailAdvanced.java
@@ -31,7 +31,6 @@ import android.util.Log;
 public class AccountDetailAdvanced implements AccountDetail {
 
     private static final String TAG = "AccountDetailAdvanced";
-    public static final String BUNDLE_TAG = "AdvancedPreferenceArrayList";
 
     public static final String CONFIG_ACCOUNT_MAILBOX = "Account.mailbox";
     public static final String CONFIG_ACCOUNT_REGISTRATION_EXPIRE = "Account.registrationExpire";
@@ -49,30 +48,17 @@ public class AccountDetailAdvanced implements AccountDetail {
     public static final String CONFIG_LOCAL_PORT = "Account.localPort";
     public static final String CONFIG_PUBLISHED_PORT = "Account.publishedPort";
     public static final String CONFIG_PUBLISHED_ADDRESS = "Account.publishedAddress";
-    
-
-    public static final String CONFIG_DEFAULT_LOCAL_PORT = "5060";
-    public static final String CONFIG_DEFAULT_PUBLISHED_PORT = "5060";
-    public static final String CONFIG_DEFAULT_PUBLISHED_SAMEAS_LOCAL = "true";
-
-    public static final String CONFIG_DEFAULT_INTERFACE = "default";
-    public static final String CONFIG_DEFAULT_REGISTRATION_EXPIRE = "60";
 
     public static final String CONFIG_DISPLAY_NAME = "Account.displayName";
-    public static final String CONFIG_DEFAULT_ADDRESS = "0.0.0.0";
-
     public static final String CONFIG_STUN_SERVER = "STUN.server";
     public static final String CONFIG_STUN_ENABLE = "STUN.enable";
-    
-    public static final String CONFIG_DEFAULT_DTMF_TYPE = "overrtp";
-    
+
     public static final String TRUE_STR = "true";
     public static final String FALSE_STR = "false";
 
     private ArrayList<AccountDetail.PreferenceEntry> privateArray;
 
-    public static ArrayList<AccountDetail.PreferenceEntry> getPreferenceEntries()
-    {
+    public static ArrayList<AccountDetail.PreferenceEntry> getPreferenceEntries() {
         ArrayList<AccountDetail.PreferenceEntry> preference = new ArrayList<AccountDetail.PreferenceEntry>();
 
         preference.add(new PreferenceEntry(CONFIG_ACCOUNT_REGISTRATION_EXPIRE, R.string.account_registration_exp_label));
@@ -96,70 +82,62 @@ public class AccountDetailAdvanced implements AccountDetail {
         return preference;
     }
 
-    public AccountDetailAdvanced()
-    {
+    public AccountDetailAdvanced() {
         privateArray = getPreferenceEntries();
     }
 
-    public AccountDetailAdvanced(HashMap<String, String> pref)
-    {
+    public AccountDetailAdvanced(HashMap<String, String> pref) {
         privateArray = getPreferenceEntries();
 
-        for(AccountDetail.PreferenceEntry p : privateArray) {
+        for (AccountDetail.PreferenceEntry p : privateArray) {
             p.mValue = pref.get(p.mKey);
         }
     }
 
-    public AccountDetailAdvanced(ArrayList<String> pref)
-    {
+    public AccountDetailAdvanced(ArrayList<String> pref) {
         privateArray = getPreferenceEntries();
 
-        if(pref.size() != privateArray.size()) {
+        if (pref.size() != privateArray.size()) {
             Log.i(TAG, "Error list are not of equal size");
-        }
-        else {
+        } else {
             int index = 0;
-            for(String s : pref) {
+            for (String s : pref) {
                 privateArray.get(index).mValue = s;
                 index++;
             }
         }
     }
 
-    public ArrayList<AccountDetail.PreferenceEntry> getDetailValues()
-    {
+    public ArrayList<AccountDetail.PreferenceEntry> getDetailValues() {
         return privateArray;
     }
 
-    public ArrayList<String> getValuesOnly()
-    {
+    public ArrayList<String> getValuesOnly() {
         ArrayList<String> valueList = new ArrayList<String>();
 
-        for(AccountDetail.PreferenceEntry p : privateArray) {
-            Log.i(TAG,""+p.mValue);
+        for (AccountDetail.PreferenceEntry p : privateArray) {
+            Log.i(TAG, "" + p.mValue);
             valueList.add(p.mValue);
         }
 
         return valueList;
     }
 
-    public HashMap<String, String> getDetailsHashMap()
-    {
+    public HashMap<String, String> getDetailsHashMap() {
         HashMap<String, String> map = new HashMap<String, String>();
 
-        for(AccountDetail.PreferenceEntry p : privateArray) {
+        for (AccountDetail.PreferenceEntry p : privateArray) {
             map.put(p.mKey, p.mValue);
         }
 
         return map;
     }
 
-    public String getDetailString(String key)
-    {
+    public String getDetailString(String key) {
         String value = "";
 
-        for(AccountDetail.PreferenceEntry p : privateArray) {
-            if(p.mKey.equals(key)) {
+        for (AccountDetail.PreferenceEntry p : privateArray) {
+            if (p.mKey.equals(key)) {
                 value = p.mValue;
                 return value;
             }
@@ -167,15 +145,14 @@ public class AccountDetailAdvanced implements AccountDetail {
         return value;
     }
 
-    public void setDetailString(String key, String newValue)
-    {
-        for(int i = 0 ; i < privateArray.size() ; ++i) {
+    public void setDetailString(String key, String newValue) {
+        for (int i = 0; i < privateArray.size(); ++i) {
             PreferenceEntry p = privateArray.get(i);
-            if(p.mKey.equals(key)) {
+            if (p.mKey.equals(key)) {
                 privateArray.get(i).mValue = newValue;
             }
         }
-        
+
     }
 
 }
diff --git a/src/org/sflphone/account/AccountDetailBasic.java b/src/org/sflphone/account/AccountDetailBasic.java
index dc91e9fcafbca53ad8e5dcefa3ce8e11f13ad837..6b312bc1ff8fa704d204119a16bce9645c6a25a8 100644
--- a/src/org/sflphone/account/AccountDetailBasic.java
+++ b/src/org/sflphone/account/AccountDetailBasic.java
@@ -115,7 +115,6 @@ public class AccountDetailBasic implements AccountDetail {
         HashMap<String, String> map = new HashMap<String, String>();
 
         for (AccountDetail.PreferenceEntry p : privateArray) {
-            Log.i(TAG, "putting:" + p.mKey + " " + p.mValue);
             map.put(p.mKey, p.mValue);
         }
 
diff --git a/src/org/sflphone/account/AccountDetailsHandler.java b/src/org/sflphone/account/AccountDetailsHandler.java
index 39bb0c59257cf63d9ed70720d410a978eb1ed9a9..b16022c903aeb2d0324be879c13a647c00f31bc8 100644
--- a/src/org/sflphone/account/AccountDetailsHandler.java
+++ b/src/org/sflphone/account/AccountDetailsHandler.java
@@ -2,6 +2,7 @@
  * Copyright (C) 2004-2013 Savoir-Faire Linux Inc.
  *
  *  Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com>
+ *          Alexandre Lision <alexandre.lision@savoirfairelinux.com>
  *
  *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
diff --git a/src/org/sflphone/client/AccountEditionActivity.java b/src/org/sflphone/client/AccountEditionActivity.java
index e5dcc2dd7aff16dc76094b278ac1467fb1495f17..a84d1279e4bd58e87bffc25031d0b096daa84035 100644
--- a/src/org/sflphone/client/AccountEditionActivity.java
+++ b/src/org/sflphone/client/AccountEditionActivity.java
@@ -40,6 +40,7 @@ import org.sflphone.account.AccountDetailBasic;
 import org.sflphone.fragments.AdvancedAccountFragment;
 import org.sflphone.fragments.AudioManagementFragment;
 import org.sflphone.fragments.GeneralAccountFragment;
+import org.sflphone.fragments.NestedSettingsFragment;
 import org.sflphone.fragments.SecurityAccountFragment;
 import org.sflphone.model.Account;
 import org.sflphone.service.ISipService;
@@ -70,7 +71,7 @@ import android.view.MenuInflater;
 import android.view.MenuItem;
 
 public class AccountEditionActivity extends Activity implements TabListener, GeneralAccountFragment.Callbacks, AudioManagementFragment.Callbacks,
-        AdvancedAccountFragment.Callbacks, SecurityAccountFragment.Callbacks {
+        AdvancedAccountFragment.Callbacks, SecurityAccountFragment.Callbacks, NestedSettingsFragment.Callbacks {
     private static final String TAG = "AccoutPreferenceActivity";
 
     public static final String KEY_MODE = "mode";
@@ -212,8 +213,6 @@ public class AccountEditionActivity extends Activity implements TabListener, Gen
         AlertDialog dialog;
         ArrayList<String> missingValue = new ArrayList<String>();
 
-        Log.i(TAG, "AUTOANSWER " + acc_selected.getBasicDetails().getDetailString(AccountDetailBasic.CONFIG_ACCOUNT_AUTOANSWER));
-
         if (validateAccountCreation(missingValue)) {
             try {
                 service.setAccountDetails(acc_selected.getAccountID(), acc_selected.getDetails());
diff --git a/src/org/sflphone/client/SettingsActivity.java b/src/org/sflphone/client/SettingsActivity.java
index 228b192f2a37bc7ce322b4f5c36bddd4b45f3ecd..f5239e52f6b79d01a5580df8909314695ba18a17 100644
--- a/src/org/sflphone/client/SettingsActivity.java
+++ b/src/org/sflphone/client/SettingsActivity.java
@@ -34,7 +34,7 @@ package org.sflphone.client;
 import java.util.Locale;
 
 import org.sflphone.R;
-import org.sflphone.fragments.AccountManagementFragment;
+import org.sflphone.fragments.AccountsManagementFragment;
 import org.sflphone.service.ISipService;
 import org.sflphone.service.SipService;
 
@@ -52,7 +52,7 @@ import android.support.v4.view.ViewPager;
 import android.util.Log;
 import android.view.MenuItem;
 
-public class SettingsActivity extends Activity implements AccountManagementFragment.Callbacks{
+public class SettingsActivity extends Activity implements AccountsManagementFragment.Callbacks{
 
     static final String TAG = SettingsActivity.class.getSimpleName();
     PreferencesPagerAdapter mPreferencesPagerAdapter;
@@ -164,7 +164,7 @@ public class SettingsActivity extends Activity implements AccountManagementFragm
 
             switch (position) {
             case 0:
-                fragment = new AccountManagementFragment();
+                fragment = new AccountsManagementFragment();
                 break;
             // case 1:
             // fragment = new AudioManagementFragment();
diff --git a/src/org/sflphone/fragments/AccountManagementFragment.java b/src/org/sflphone/fragments/AccountsManagementFragment.java
similarity index 98%
rename from src/org/sflphone/fragments/AccountManagementFragment.java
rename to src/org/sflphone/fragments/AccountsManagementFragment.java
index f68d9b4259b56b8266d3f85bd93be5813b261295..30181a83194c41119bac05559e704b5da0a715df 100644
--- a/src/org/sflphone/fragments/AccountManagementFragment.java
+++ b/src/org/sflphone/fragments/AccountsManagementFragment.java
@@ -73,7 +73,7 @@ import android.widget.CheckBox;
 import android.widget.ListView;
 import android.widget.TextView;
 
-public class AccountManagementFragment extends ListFragment implements LoaderCallbacks<Bundle>, AccountsInterface {
+public class AccountsManagementFragment extends ListFragment implements LoaderCallbacks<Bundle>, AccountsInterface {
     static final String TAG = "AccountManagementFragment";
     static final String DEFAULT_ACCOUNT_ID = "IP2IP";
     static final int ACCOUNT_CREATE_REQUEST = 1;
@@ -127,7 +127,6 @@ public class AccountManagementFragment extends ListFragment implements LoaderCal
         }
 
         mCallbacks = (Callbacks) activity;
-        getActivity().getLoaderManager().restartLoader(LoaderConstants.ACCOUNTS_LOADER, null, this);
     }
 
     @Override
diff --git a/src/org/sflphone/fragments/AdvancedAccountFragment.java b/src/org/sflphone/fragments/AdvancedAccountFragment.java
index ac180f1f483652a9c15cd3d4be8279c54d5424b5..6ccf4b91a6185772e68861c27a93088bf3dcc416 100644
--- a/src/org/sflphone/fragments/AdvancedAccountFragment.java
+++ b/src/org/sflphone/fragments/AdvancedAccountFragment.java
@@ -9,12 +9,10 @@ import org.sflphone.R;
 import org.sflphone.account.AccountDetail;
 import org.sflphone.account.AccountDetailAdvanced;
 import org.sflphone.model.Account;
-import org.sflphone.views.NumberPickerPreference;
 
 import android.app.Activity;
 import android.os.Bundle;
 import android.preference.CheckBoxPreference;
-import android.preference.EditTextPreference;
 import android.preference.ListPreference;
 import android.preference.Preference;
 import android.preference.Preference.OnPreferenceChangeListener;
@@ -23,7 +21,7 @@ import android.util.Log;
 
 public class AdvancedAccountFragment extends PreferenceFragment {
 
-    private static final String TAG = GeneralAccountFragment.class.getSimpleName();
+    private static final String TAG = AdvancedAccountFragment.class.getSimpleName();
 
     private boolean isDifferent = false;
 
@@ -67,8 +65,7 @@ public class AdvancedAccountFragment extends PreferenceFragment {
         addPreferencesFromResource(R.xml.account_advanced_prefs);
         setPreferenceDetails(mCallbacks.getAccount().getAdvancedDetails());
         addPreferenceListener(mCallbacks.getAccount().getAdvancedDetails(), changeAdvancedPreferenceListener);
-        
-        
+
     }
 
     private void setPreferenceDetails(AccountDetail details) {
@@ -77,18 +74,7 @@ public class AdvancedAccountFragment extends PreferenceFragment {
             Preference pref = findPreference(p.mKey);
             if (pref != null) {
                 if (p.mKey == AccountDetailAdvanced.CONFIG_LOCAL_INTERFACE) {
-                    ArrayList<CharSequence> entries = new ArrayList<CharSequence>();
-                    try {
-
-                        for (Enumeration<NetworkInterface> list = NetworkInterface.getNetworkInterfaces(); list.hasMoreElements();) {
-                            NetworkInterface i = list.nextElement();
-                            Log.e("network_interfaces", "display name " + i.getDisplayName());
-                            if (i.isUp())
-                                entries.add(i.getDisplayName());
-                        }
-                    } catch (SocketException e) {
-                        Log.e(TAG, e.toString());
-                    }
+                    ArrayList<CharSequence> entries = getNetworkInterfaces();
                     CharSequence[] display = new CharSequence[entries.size()];
                     entries.toArray(display);
                     ((ListPreference) pref).setEntries(display);
@@ -97,9 +83,14 @@ public class AdvancedAccountFragment extends PreferenceFragment {
                     continue;
                 }
                 if (!p.isTwoState) {
-
                     pref.setSummary(p.mValue);
-
+                } else if(pref.getKey().contentEquals("STUN.enable")){
+                    ((CheckBoxPreference)pref).setChecked(p.mValue.contentEquals("true"));
+                    findPreference("STUN.server").setEnabled(p.mValue.contentEquals("true"));
+                } else if(pref.getKey().contentEquals("Account.publishedSameAsLocal")){
+                    ((CheckBoxPreference)pref).setChecked(p.mValue.contentEquals("true"));
+                    findPreference("Account.publishedPort").setEnabled(!p.mValue.contentEquals("true"));
+                    findPreference("Account.publishedAddress").setEnabled(!p.mValue.contentEquals("true"));
                 }
             } else {
                 Log.w(TAG, "pref not found");
@@ -107,6 +98,23 @@ public class AdvancedAccountFragment extends PreferenceFragment {
         }
     }
 
+    private ArrayList<CharSequence> getNetworkInterfaces() {
+        ArrayList<CharSequence> result = new ArrayList<CharSequence>();
+        
+        result.add("default");
+        try {
+
+            for (Enumeration<NetworkInterface> list = NetworkInterface.getNetworkInterfaces(); list.hasMoreElements();) {
+                NetworkInterface i = list.nextElement();
+                if (i.isUp())
+                    result.add(i.getDisplayName());
+            }
+        } catch (SocketException e) {
+            Log.e(TAG, e.toString());
+        }
+        return result;
+    }
+
     private void addPreferenceListener(AccountDetail details, OnPreferenceChangeListener listener) {
         for (AccountDetail.PreferenceEntry p : details.getDetailValues()) {
             Log.i(TAG, "addPreferenceListener: pref " + p.mKey + p.mValue);
@@ -126,18 +134,17 @@ public class AdvancedAccountFragment extends PreferenceFragment {
         public boolean onPreferenceChange(Preference preference, Object newValue) {
             setDifferent(true);
             if (preference instanceof CheckBoxPreference) {
-                     mCallbacks.getAccount().getAdvancedDetails().setDetailString(preference.getKey(), ((Boolean) newValue).toString());
-                     if(preference.getKey().contentEquals("STUN.enable")){
-                         findPreference("STUN.server").setEnabled((Boolean) newValue);
-                     } else if (preference.getKey().contentEquals("Account.publishedSameAsLocal")){
-                         findPreference("Account.publishedPort").setEnabled((Boolean) newValue);
-                         findPreference("Account.publishedAddress").setEnabled((Boolean) newValue);
-                     }
-                    
-                    
+                mCallbacks.getAccount().getAdvancedDetails().setDetailString(preference.getKey(), ((Boolean) newValue).toString());
+                if (preference.getKey().contentEquals("STUN.enable")) {
+                    findPreference("STUN.server").setEnabled((Boolean) newValue);
+                } else if (preference.getKey().contentEquals("Account.publishedSameAsLocal")) {
+                    findPreference("Account.publishedPort").setEnabled(!(Boolean) newValue);
+                    findPreference("Account.publishedAddress").setEnabled(!(Boolean) newValue);
+                }
+
             } else {
                 preference.setSummary((CharSequence) newValue);
-                Log.i(TAG, "Changing preference value:" + newValue);
+                Log.i(TAG, "Changing" + preference.getKey() + " value:" + newValue);
                 mCallbacks.getAccount().getAdvancedDetails().setDetailString(preference.getKey(), ((CharSequence) newValue).toString());
             }
             return true;
diff --git a/src/org/sflphone/fragments/AudioManagementFragment.java b/src/org/sflphone/fragments/AudioManagementFragment.java
index dc8854dbf94405aea7137e933f594edd1e4c9894..6afdbdbd71bc581c1a4806af4846f8a9ef5eaab5 100644
--- a/src/org/sflphone/fragments/AudioManagementFragment.java
+++ b/src/org/sflphone/fragments/AudioManagementFragment.java
@@ -48,17 +48,23 @@ import android.preference.PreferenceFragment;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.View.MeasureSpec;
 import android.widget.AdapterView;
 import android.widget.AdapterView.OnItemClickListener;
 import android.widget.BaseAdapter;
 import android.widget.CheckBox;
+import android.widget.LinearLayout;
+import android.widget.ListAdapter;
+import android.widget.ListView;
 import android.widget.TextView;
 
 public class AudioManagementFragment extends PreferenceFragment {
-    static final String TAG = "AudioManagementFragment";
+    static final String TAG = AudioManagementFragment.class.getSimpleName();
 
     protected Callbacks mCallbacks = sDummyCallbacks;
     ArrayList<Codec> codecs;
+    private DragSortListView v;
+    CodecAdapter listAdapter;
     private static Callbacks sDummyCallbacks = new Callbacks() {
 
         @Override
@@ -102,8 +108,6 @@ public class AudioManagementFragment extends PreferenceFragment {
         super.onDetach();
         mCallbacks = sDummyCallbacks;
     }
-    
-    CodecAdapter listAdapter;
 
     private DragSortListView.DropListener onDrop = new DragSortListView.DropListener() {
         @Override
@@ -120,7 +124,7 @@ public class AudioManagementFragment extends PreferenceFragment {
             }
         }
     };
-    
+
     public ArrayList<String> getActiveCodecList() {
         ArrayList<String> results = new ArrayList<String>();
         for (int i = 0; i < listAdapter.getCount(); ++i) {
@@ -130,12 +134,12 @@ public class AudioManagementFragment extends PreferenceFragment {
         }
         return results;
     }
-    
+
     @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
+    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
         super.onCreateView(inflater, container, savedInstanceState);
-        View rootView = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_codecs_list, null);
-        DragSortListView v = (DragSortListView) rootView.findViewById(R.id.dndlistview);
+        View rootView = LayoutInflater.from(getActivity()).inflate(R.layout.frag_audio_mgmt, null);
+        v = (DragSortListView) rootView.findViewById(R.id.dndlistview);
         v.setAdapter(listAdapter);
         v.setDropListener(onDrop);
         v.setOnItemClickListener(new OnItemClickListener() {
@@ -155,10 +159,54 @@ public class AudioManagementFragment extends PreferenceFragment {
         return rootView;
     }
 
+    @Override
+    public void onViewCreated(View view, Bundle savedInstanceState) {
+        super.onViewCreated(view, savedInstanceState);
+        final LinearLayout holder = (LinearLayout) getView().findViewById(R.id.lv_holder);
+        holder.post(new Runnable() {
+
+            @Override
+            public void run() {
+                setListViewHeight(v, holder);
+            }
+        });
+
+    }
+
+    // Sets the ListView holder's height
+    public void setListViewHeight(ListView listView, LinearLayout llMain) {
+        ListAdapter listAdapter = listView.getAdapter();
+        if (listAdapter == null) {
+            return;
+        }
+
+        int totalHeight = 0;
+        int firstHeight = 0;
+        int desiredWidth = MeasureSpec.makeMeasureSpec(listView.getWidth(), MeasureSpec.AT_MOST);
+
+        for (int i = 0; i < listAdapter.getCount(); i++) {
+
+            if (i == 0) {
+                View listItem = listAdapter.getView(i, null, listView);
+                listItem.measure(desiredWidth, MeasureSpec.UNSPECIFIED);
+                firstHeight = listItem.getMeasuredHeight();
+            }
+            totalHeight += firstHeight;
+        }
+
+        // totalHeight -= iv.getMeasuredHeight();
+
+        LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) llMain.getLayoutParams();
+
+        params.height = totalHeight + (listView.getDividerHeight() * (listAdapter.getCount() - 1));
+        llMain.setLayoutParams(params);
+        getView().requestLayout();
+    }
+
     @Override
     public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);   
-        
+        super.onCreate(savedInstanceState);
+
         addPreferencesFromResource(R.xml.account_audio_prefs);
         listAdapter = new CodecAdapter(getActivity());
         listAdapter.setDataset(codecs);
@@ -171,8 +219,6 @@ public class AudioManagementFragment extends PreferenceFragment {
         }
     };
 
-
-
     public static class CodecAdapter extends BaseAdapter {
 
         ArrayList<Codec> items;
diff --git a/src/org/sflphone/fragments/NestedSettingsFragment.java b/src/org/sflphone/fragments/NestedSettingsFragment.java
new file mode 100644
index 0000000000000000000000000000000000000000..6a27c6e39018a4cbcaca34a204a193866eb9d620
--- /dev/null
+++ b/src/org/sflphone/fragments/NestedSettingsFragment.java
@@ -0,0 +1,154 @@
+package org.sflphone.fragments;
+
+import java.net.NetworkInterface;
+import java.net.SocketException;
+import java.util.ArrayList;
+import java.util.Enumeration;
+
+import org.sflphone.R;
+import org.sflphone.account.AccountDetail;
+import org.sflphone.account.AccountDetailAdvanced;
+import org.sflphone.model.Account;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.preference.CheckBoxPreference;
+import android.preference.ListPreference;
+import android.preference.Preference;
+import android.preference.Preference.OnPreferenceChangeListener;
+import android.preference.PreferenceFragment;
+import android.util.Log;
+
+public class NestedSettingsFragment extends PreferenceFragment {
+
+    private static final String TAG = AdvancedAccountFragment.class.getSimpleName();
+
+    private boolean isDifferent = false;
+
+    private Callbacks mCallbacks = sDummyCallbacks;
+    private static Callbacks sDummyCallbacks = new Callbacks() {
+
+        @Override
+        public Account getAccount() {
+            return null;
+        }
+
+    };
+
+    public interface Callbacks {
+
+        public Account getAccount();
+
+    }
+
+    @Override
+    public void onAttach(Activity activity) {
+        super.onAttach(activity);
+        if (!(activity instanceof Callbacks)) {
+            throw new IllegalStateException("Activity must implement fragment's callbacks.");
+        }
+
+        Log.e(TAG,"Attaching Adavnced");
+        mCallbacks = (Callbacks) activity;
+    }
+
+    @Override
+    public void onDetach() {
+        super.onDetach();
+        mCallbacks = sDummyCallbacks;
+    }
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        // Load the preferences from an XML resource
+//        addPreferencesFromResource(R.xml.account_advanced_prefs);
+//        setPreferenceDetails(mCallbacks.getAccount().getAdvancedDetails());
+//        addPreferenceListener(mCallbacks.getAccount().getAdvancedDetails(), changeAdvancedPreferenceListener);
+        
+        
+    }
+
+    private void setPreferenceDetails(AccountDetail details) {
+        for (AccountDetail.PreferenceEntry p : details.getDetailValues()) {
+            Log.i(TAG, "setPreferenceDetails: pref " + p.mKey + " value " + p.mValue);
+            Preference pref = findPreference(p.mKey);
+            if (pref != null) {
+                if (p.mKey == AccountDetailAdvanced.CONFIG_LOCAL_INTERFACE) {
+                    ArrayList<CharSequence> entries = new ArrayList<CharSequence>();
+                    try {
+
+                        for (Enumeration<NetworkInterface> list = NetworkInterface.getNetworkInterfaces(); list.hasMoreElements();) {
+                            NetworkInterface i = list.nextElement();
+                            Log.e("network_interfaces", "display name " + i.getDisplayName());
+                            if (i.isUp())
+                                entries.add(i.getDisplayName());
+                        }
+                    } catch (SocketException e) {
+                        Log.e(TAG, e.toString());
+                    }
+                    CharSequence[] display = new CharSequence[entries.size()];
+                    entries.toArray(display);
+                    ((ListPreference) pref).setEntries(display);
+                    ((ListPreference) pref).setEntryValues(display);
+                    pref.setSummary(p.mValue);
+                    continue;
+                }
+                if (!p.isTwoState) {
+
+                    pref.setSummary(p.mValue);
+
+                }
+            } else {
+                Log.w(TAG, "pref not found");
+            }
+        }
+    }
+
+    private void addPreferenceListener(AccountDetail details, OnPreferenceChangeListener listener) {
+        for (AccountDetail.PreferenceEntry p : details.getDetailValues()) {
+            Log.i(TAG, "addPreferenceListener: pref " + p.mKey + p.mValue);
+            Preference pref = findPreference(p.mKey);
+            if (pref != null) {
+
+                pref.setOnPreferenceChangeListener(listener);
+
+            } else {
+                Log.w(TAG, "addPreferenceListener: pref not found");
+            }
+        }
+    }
+
+    Preference.OnPreferenceChangeListener changeAdvancedPreferenceListener = new Preference.OnPreferenceChangeListener() {
+        @Override
+        public boolean onPreferenceChange(Preference preference, Object newValue) {
+            setDifferent(true);
+            if (preference instanceof CheckBoxPreference) {
+                     mCallbacks.getAccount().getAdvancedDetails().setDetailString(preference.getKey(), ((Boolean) newValue).toString());
+                     if(preference.getKey().contentEquals("STUN.enable")){
+                         findPreference("STUN.server").setEnabled((Boolean) newValue);
+                     } else if (preference.getKey().contentEquals("Account.publishedSameAsLocal")){
+                         findPreference("Account.publishedPort").setEnabled((Boolean) newValue);
+                         findPreference("Account.publishedAddress").setEnabled((Boolean) newValue);
+                     }
+                    
+                    
+            } else {
+                preference.setSummary((CharSequence) newValue);
+                Log.i(TAG, "Changing preference value:" + newValue);
+                mCallbacks.getAccount().getAdvancedDetails().setDetailString(preference.getKey(), ((CharSequence) newValue).toString());
+            }
+            return true;
+        }
+    };
+
+    public boolean isDifferent() {
+        return isDifferent;
+    }
+
+    public void setDifferent(boolean isDifferent) {
+        this.isDifferent = isDifferent;
+    }
+
+}
\ No newline at end of file
diff --git a/src/org/sflphone/fragments/SecurityAccountFragment.java b/src/org/sflphone/fragments/SecurityAccountFragment.java
index 840a4ebf8e3f17e7dafbceaf64bf900b6339a5de..020edc07fd530c3f62f6deef47d9ad3b72cef1d7 100644
--- a/src/org/sflphone/fragments/SecurityAccountFragment.java
+++ b/src/org/sflphone/fragments/SecurityAccountFragment.java
@@ -1,20 +1,13 @@
 package org.sflphone.fragments;
 
-import java.net.NetworkInterface;
-import java.net.SocketException;
-import java.util.ArrayList;
-import java.util.Enumeration;
-
 import org.sflphone.R;
 import org.sflphone.account.AccountDetail;
-import org.sflphone.account.AccountDetailAdvanced;
 import org.sflphone.model.Account;
 
 import android.app.Activity;
 import android.os.Bundle;
 import android.preference.CheckBoxPreference;
 import android.preference.EditTextPreference;
-import android.preference.ListPreference;
 import android.preference.Preference;
 import android.preference.Preference.OnPreferenceChangeListener;
 import android.preference.PreferenceFragment;
@@ -22,7 +15,7 @@ import android.util.Log;
 
 public class SecurityAccountFragment extends PreferenceFragment {
 
-    private static final String TAG = GeneralAccountFragment.class.getSimpleName();
+    private static final String TAG = SecurityAccountFragment.class.getSimpleName();
 
     private boolean isDifferent = false;
 
@@ -64,10 +57,10 @@ public class SecurityAccountFragment extends PreferenceFragment {
 
         // Load the preferences from an XML resource
         addPreferencesFromResource(R.xml.account_security_prefs);
-        setPreferenceDetails(mCallbacks.getAccount().getTlsDetails());
-        setPreferenceDetails(mCallbacks.getAccount().getSrtpDetails());
-        addPreferenceListener(mCallbacks.getAccount().getTlsDetails(), changeTlsPreferenceListener);
-        addPreferenceListener(mCallbacks.getAccount().getSrtpDetails(), changeSrtpPreferenceListener);
+//        setPreferenceDetails(mCallbacks.getAccount().getTlsDetails());
+//        setPreferenceDetails(mCallbacks.getAccount().getSrtpDetails());
+//        addPreferenceListener(mCallbacks.getAccount().getTlsDetails(), changeTlsPreferenceListener);
+//        addPreferenceListener(mCallbacks.getAccount().getSrtpDetails(), changeSrtpPreferenceListener);
 
     }
 
@@ -76,26 +69,6 @@ public class SecurityAccountFragment extends PreferenceFragment {
             Log.i(TAG, "setPreferenceDetails: pref " + p.mKey + " value " + p.mValue);
             Preference pref = findPreference(p.mKey);
             if (pref != null) {
-                if (p.mKey == AccountDetailAdvanced.CONFIG_LOCAL_INTERFACE) {
-                    ArrayList<CharSequence> entries = new ArrayList<CharSequence>();
-                    try {
-
-                        for (Enumeration<NetworkInterface> list = NetworkInterface.getNetworkInterfaces(); list.hasMoreElements();) {
-                            NetworkInterface i = list.nextElement();
-                            Log.e("network_interfaces", "display name " + i.getDisplayName());
-                            if (i.isUp())
-                                entries.add(i.getDisplayName());
-                        }
-                    } catch (SocketException e) {
-                        Log.e(TAG, e.toString());
-                    }
-                    CharSequence[] display = new CharSequence[entries.size()];
-                    entries.toArray(display);
-                    ((ListPreference) pref).setEntries(display);
-                    ((ListPreference) pref).setEntryValues(display);
-                    pref.setSummary(p.mValue);
-                    continue;
-                }
                 if (!p.isTwoState) {
                     ((EditTextPreference) pref).setText(p.mValue);
                     pref.setSummary(p.mValue);
diff --git a/src/org/sflphone/service/SipService.java b/src/org/sflphone/service/SipService.java
index 3fe2b314f20333701effe24f8678f5932766b870..998e37fffb758ddd5eb7f407f3717881978af1e0 100644
--- a/src/org/sflphone/service/SipService.java
+++ b/src/org/sflphone/service/SipService.java
@@ -34,6 +34,7 @@ import java.util.Map.Entry;
 import java.util.Random;
 
 import org.sflphone.R;
+import org.sflphone.account.AccountDetailAdvanced;
 import org.sflphone.account.AccountDetailBasic;
 import org.sflphone.account.AccountDetailsHandler;
 import org.sflphone.account.CallDetailsHandler;
@@ -549,14 +550,13 @@ public class SipService extends Service {
         public void setAccountDetails(final String accountId, final Map map) {
             HashMap<String, String> nativemap = (HashMap<String, String>) map;
 
-            Log.e(TAG,"auto:"+map.get(AccountDetailBasic.CONFIG_ACCOUNT_AUTOANSWER));
+            Log.e(TAG,"CONFIG_ACCOUNT_REGISTRATION_EXPIRE:"+map.get(AccountDetailAdvanced.CONFIG_ACCOUNT_REGISTRATION_EXPIRE));
             final StringMap swigmap = AccountDetailsHandler.convertFromNativeToSwig(nativemap);
 
             getExecutor().execute(new SipRunnable() {
                 @Override
                 protected void doRun() throws SameThreadException {
 
-                    Log.e(TAG,"auto:"+swigmap.get(AccountDetailBasic.CONFIG_ACCOUNT_AUTOANSWER));
                     configurationManagerJNI.setCredentials(accountId, extractCredentials(map));
                     configurationManagerJNI.setAccountDetails(accountId, swigmap);
 
diff --git a/src/org/sflphone/views/DoubleNumberPickerPreference.java b/src/org/sflphone/views/DoubleNumberPickerPreference.java
new file mode 100644
index 0000000000000000000000000000000000000000..7bb76faa99c478a96022d96c40c4d1477ca593fe
--- /dev/null
+++ b/src/org/sflphone/views/DoubleNumberPickerPreference.java
@@ -0,0 +1,216 @@
+package org.sflphone.views;
+
+/*
+ * Copyright (C) 2011 The CyanogenMod Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.lang.reflect.Field;
+
+import org.sflphone.R;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.preference.DialogPreference;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.EditText;
+import android.widget.NumberPicker;
+import android.widget.TextView;
+
+/*
+ * @author Danesh
+ * @author nebkat
+ */
+
+public class DoubleNumberPickerPreference extends DialogPreference {
+    private int mMin1, mMax1, mDefault1;
+    private int mMin2, mMax2, mDefault2;
+
+    private String mMaxExternalKey1, mMinExternalKey1;
+    private String mMaxExternalKey2, mMinExternalKey2;
+
+    private String mPickerTitle1;
+    private String mPickerTitle2;
+
+    private NumberPicker mNumberPicker1;
+    private NumberPicker mNumberPicker2;
+
+    public DoubleNumberPickerPreference(Context context, AttributeSet attrs) {
+        super(context, attrs);
+        // TypedArray dialogType = context.obtainStyledAttributes(attrs,
+        // com.android.internal.R.styleable.DialogPreference, 0, 0);
+        TypedArray doubleNumberPickerType = context.obtainStyledAttributes(attrs, R.styleable.DoubleNumberPickerPreference, 0, 0);
+
+        mMaxExternalKey1 = doubleNumberPickerType.getString(R.styleable.DoubleNumberPickerPreference_maxExternal1);
+        mMinExternalKey1 = doubleNumberPickerType.getString(R.styleable.DoubleNumberPickerPreference_minExternal1);
+        mMaxExternalKey2 = doubleNumberPickerType.getString(R.styleable.DoubleNumberPickerPreference_maxExternal2);
+        mMinExternalKey2 = doubleNumberPickerType.getString(R.styleable.DoubleNumberPickerPreference_minExternal2);
+
+        mPickerTitle1 = doubleNumberPickerType.getString(R.styleable.DoubleNumberPickerPreference_pickerTitle1);
+        mPickerTitle2 = doubleNumberPickerType.getString(R.styleable.DoubleNumberPickerPreference_pickerTitle2);
+
+        mMax1 = doubleNumberPickerType.getInt(R.styleable.DoubleNumberPickerPreference_max1, 5);
+        mMin1 = doubleNumberPickerType.getInt(R.styleable.DoubleNumberPickerPreference_min1, 0);
+        mMax2 = doubleNumberPickerType.getInt(R.styleable.DoubleNumberPickerPreference_max2, 5);
+        mMin2 = doubleNumberPickerType.getInt(R.styleable.DoubleNumberPickerPreference_min2, 0);
+
+        mDefault1 = doubleNumberPickerType.getInt(R.styleable.DoubleNumberPickerPreference_defaultValue1, mMin1);
+        mDefault2 = doubleNumberPickerType.getInt(R.styleable.DoubleNumberPickerPreference_defaultValue2, mMin2);
+
+        // dialogType.recycle();
+        doubleNumberPickerType.recycle();
+    }
+
+    @Override
+    protected View onCreateDialogView() {
+        int max1 = mMax1;
+        int min1 = mMin1;
+        int max2 = mMax2;
+        int min2 = mMin2;
+
+        // External values
+        if (mMaxExternalKey1 != null) {
+            max1 = getSharedPreferences().getInt(mMaxExternalKey1, mMax1);
+        }
+        if (mMinExternalKey1 != null) {
+            min1 = getSharedPreferences().getInt(mMinExternalKey1, mMin1);
+        }
+        if (mMaxExternalKey2 != null) {
+            max2 = getSharedPreferences().getInt(mMaxExternalKey2, mMax2);
+        }
+        if (mMinExternalKey2 != null) {
+            min2 = getSharedPreferences().getInt(mMinExternalKey2, mMin2);
+        }
+
+        LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+        View view = inflater.inflate(R.layout.double_number_picker_dialog, null);
+
+        mNumberPicker1 = (NumberPicker) view.findViewById(R.id.number_picker_1);
+        mNumberPicker2 = (NumberPicker) view.findViewById(R.id.number_picker_2);
+
+        if (mNumberPicker1 == null || mNumberPicker2 == null) {
+            throw new RuntimeException("mNumberPicker1 or mNumberPicker2 is null!");
+        }
+
+        // Initialize state
+        mNumberPicker1.setWrapSelectorWheel(false);
+        mNumberPicker1.setMaxValue(max1);
+        mNumberPicker1.setMinValue(min1);
+        mNumberPicker1.setValue(getPersistedValue(1));
+        mNumberPicker2.setWrapSelectorWheel(false);
+        mNumberPicker2.setMaxValue(max2);
+        mNumberPicker2.setMinValue(min2);
+        mNumberPicker2.setValue(getPersistedValue(2));
+
+        // Titles
+        TextView pickerTitle1 = (TextView) view.findViewById(R.id.picker_title_1);
+        TextView pickerTitle2 = (TextView) view.findViewById(R.id.picker_title_2);
+
+        if (pickerTitle1 != null && pickerTitle2 != null) {
+            pickerTitle1.setText(mPickerTitle1);
+            pickerTitle2.setText(mPickerTitle2);
+        }
+
+        // No keyboard popup
+        disableTextInput(mNumberPicker1);
+        disableTextInput(mNumberPicker2);
+        // EditText textInput1 = (EditText) mNumberPicker1.findViewById(com.android.internal.R.id.numberpicker_input);
+        // EditText textInput2 = (EditText) mNumberPicker2.findViewById(com.android.internal.R.id.numberpicker_input);
+        // if (textInput1 != null && textInput2 != null) {
+        // textInput1.setCursorVisible(false);
+        // textInput1.setFocusable(false);
+        // textInput1.setFocusableInTouchMode(false);
+        // textInput2.setCursorVisible(false);
+        // textInput2.setFocusable(false);
+        // textInput2.setFocusableInTouchMode(false);
+        // }
+
+        return view;
+    }
+
+    private int getPersistedValue(int value) {
+        String[] values = getPersistedString(mDefault1 + "|" + mDefault2).split("\\|");
+        if (value == 1) {
+            try {
+                return Integer.parseInt(values[0]);
+            } catch (NumberFormatException e) {
+                return mDefault1;
+            }
+        } else {
+            try {
+                return Integer.parseInt(values[1]);
+            } catch (NumberFormatException e) {
+                return mDefault2;
+            }
+        }
+    }
+
+    @Override
+    protected void onDialogClosed(boolean positiveResult) {
+        if (positiveResult) {
+            persistString(mNumberPicker1.getValue() + "|" + mNumberPicker2.getValue());
+            getOnPreferenceChangeListener().onPreferenceChange(this, mNumberPicker1.getValue()+""+mNumberPicker2.getValue());
+        }
+    }
+
+    public void setMin1(int min) {
+        mMin1 = min;
+    }
+
+    public void setMax1(int max) {
+        mMax1 = max;
+    }
+
+    public void setMin2(int min) {
+        mMin2 = min;
+    }
+
+    public void setMax2(int max) {
+        mMax2 = max;
+    }
+
+    public void setDefault1(int def) {
+        mDefault1 = def;
+    }
+
+    public void setDefault2(int def) {
+        mDefault2 = def;
+    }
+
+    /*
+     * reflection of NumberPicker.java verified in 4.1, 4.2
+     */
+    private void disableTextInput(NumberPicker np) {
+        if (np == null)
+            return;
+        Class<?> classType = np.getClass();
+        Field inputTextField;
+        try {
+            inputTextField = classType.getDeclaredField("mInputText");
+            inputTextField.setAccessible(true);
+            EditText textInput = (EditText) inputTextField.get(np);
+            if (textInput != null) {
+                textInput.setCursorVisible(false);
+                textInput.setFocusable(false);
+                textInput.setFocusableInTouchMode(false);
+            }
+        } catch (Exception e) {
+            Log.d("trebuchet", "DoubleNumberPickerPreference disableTextInput error", e);
+        }
+    }
+
+}
diff --git a/src/org/sflphone/views/NumberPickerPreference.java b/src/org/sflphone/views/NumberPickerPreference.java
index 3f2b84dcab8eb295d487730c13db0a3f2b5d5f0c..6d1d81b1a97c9782e846d3ff61ac55498215a652 100644
--- a/src/org/sflphone/views/NumberPickerPreference.java
+++ b/src/org/sflphone/views/NumberPickerPreference.java
@@ -83,6 +83,7 @@ public class NumberPickerPreference extends DialogPreference {
     protected void onDialogClosed(boolean positiveResult) {
         if (positiveResult) {
             persistInt(mNumberPicker.getValue());
+            getOnPreferenceChangeListener().onPreferenceChange(this, String.valueOf(mNumberPicker.getValue()));
         }
     }