Try to modify accountPreferences Android API activity
author"Vincent Veronis"
Thu, 21 Apr 2011 21:05:25 +0200
changeset 885 193a934390ba
parent 884 b5104ccb1916
child 886 5d3163053c42
Try to modify accountPreferences Android API activity
AndroidManifest.xml
res/layout/account_settings.xml
res/layout/preferences.xml
res/values/attrs.xml
res/xml/authenticator.xml
res/xml/preferences.xml
src/com/beem/project/beem/BeemConnection.java
src/com/beem/project/beem/account/AccountPreferences.java
src/com/beem/project/beem/account/Authenticator.java
src/com/beem/project/beem/account/AuthenticatorService.java
src/com/beem/project/beem/account/CheckBoxPreference_Custom.java
src/com/beem/project/beem/account/ManageAccountsSettings.java
src/com/beem/project/beem/account/SyncAdapter.java
src/com/beem/project/beem/account/SyncAdapterService.java
--- a/AndroidManifest.xml	Sat Apr 16 13:16:28 2011 +0200
+++ b/AndroidManifest.xml	Thu Apr 21 21:05:25 2011 +0200
@@ -127,14 +127,6 @@
 		<activity
 			android:name="com.beem.project.beem.account.ManageAccountsSettings"
 			android:label="Sync Settings">
-			<intent-filter>
-				<action
-					android:name="android.intent.action.MAIN" />
-				<action
-					android:name="android.settings.ACCOUNT_SYNC_SETTINGS" />
-				<category
-					android:name="android.intent.category.DEFAULT" />
-			</intent-filter>
 		</activity>
 		<!--
 			Could be interesting if we would launch beem at startup <receiver
--- a/res/layout/account_settings.xml	Sat Apr 16 13:16:28 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-	<!--
-		/* //device/apps/common/assets/res/layout/list_content.xml ** **
-		Copyright 2006, 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="match_parent"
-	android:layout_height="match_parent"
-	android:orientation="vertical">
-	<LinearLayout
-		xmlns:android="http://schemas.android.com/apk/res/android"
-		android:layout_width="match_parent"
-		android:layout_height="wrap_content"
-		android:id="@+id/title_area"
-		android:orientation="horizontal">
-		<ImageView
-			android:id="@+id/provider_icon"
-			android:layout_width="48dip"
-			android:layout_height="48dip"
-			android:layout_margin="5dip"
-			android:layout_gravity="center_vertical" />
-		<LinearLayout
-			android:layout_width="0dip"
-			android:layout_weight="1"
-			android:layout_height="wrap_content"
-			android:orientation="vertical">
-			<TextView
-				android:id="@+id/user_id"
-				android:layout_width="match_parent"
-				android:layout_height="wrap_content"
-				android:textStyle="bold"
-				android:singleLine="true"
-				android:ellipsize="end"
-				android:gravity="center_vertical"
-				android:layout_marginTop="5dip" />
-			<TextView
-				android:id="@+id/provider_id"
-				android:layout_width="match_parent"
-				android:layout_height="wrap_content"
-				android:singleLine="true"
-				android:ellipsize="end"
-				android:layout_gravity="bottom"
-				android:layout_marginBottom="5dip" />
-		</LinearLayout>
-	</LinearLayout>
-	<ListView
-		xmlns:android="http://schemas.android.com/apk/res/android"
-		android:id="@android:id/list"
-		android:layout_width="match_parent"
-		android:layout_height="0dip"
-		android:layout_weight="1"
-		android:drawSelectorOnTop="false"
-		android:scrollbarAlwaysDrawVerticalTrack="true" />
-	<TextView
-		android:id="@+id/sync_settings_error_info"
-		android:layout_width="match_parent"
-		android:layout_height="wrap_content"
-		android:text="SYNC FAILING" />
-	<LinearLayout
-		android:id="@+id/remove_account_area"
-		android:layout_width="match_parent"
-		android:layout_height="wrap_content"
-		android:orientation="horizontal"
-		android:background="@android:drawable/bottom_bar">
-		<View
-			android:layout_width="0dip"
-			android:layout_height="match_parent"
-			android:layout_weight="1" />
-		<Button
-			android:id="@+id/remove_account_button"
-			android:layout_width="0dip"
-			android:layout_height="wrap_content"
-			android:layout_weight="2"
-			android:layout_marginTop="5dip"
-			android:text="REMOVE ACCOUNT LABEL" />
-		<View
-			android:layout_width="0dip"
-			android:layout_height="match_parent"
-			android:layout_weight="1" />
-	</LinearLayout>
-	<RelativeLayout
-		android:id="@+id/finish_button_area"
-		android:layout_height="wrap_content"
-		android:layout_width="match_parent"
-		android:background="@android:drawable/bottom_bar"
-		android:visibility="gone">
-		<Button
-			android:id="@+id/finish_button"
-			android:layout_width="150dip"
-			android:layout_height="wrap_content"
-			android:layout_margin="5dip"
-			android:layout_alignParentRight="true"
-			android:drawablePadding="3dip"
-			android:text="FINISH" />
-	</RelativeLayout>
-</LinearLayout>
\ No newline at end of file
--- a/res/layout/preferences.xml	Sat Apr 16 13:16:28 2011 +0200
+++ b/res/layout/preferences.xml	Thu Apr 21 21:05:25 2011 +0200
@@ -1,133 +1,225 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!-- 
-    The format of the preference key is defined in
-    src/com/beem/project/beem/BeemApplication.java
-    Basically it is just a simple name like account_username.
-    TODO: There is still a lot of keys to convert
--->
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
-	android:shouldDisableView="true" android:selectable="true">
-	<PreferenceCategory android:title="@string/general_preferences">
-		<PreferenceScreen android:key="contact_list"
-			android:title="@string/contact_list_preferences" android:summary="@string/contact_list_preferences_sum">
-			<CheckBoxPreference android:title="@string/CLP_hidden_contact"
-				android:defaultValue="false" android:summary="@string/CLP_hidden_contact_sum"
+	<!--
+		The format of the preference key is defined in
+		src/com/beem/project/beem/BeemApplication.java Basically it is just a
+		simple name like account_username. TODO: There is still a lot of keys
+		to convert
+	-->
+<PreferenceScreen
+	xmlns:android="http://schemas.android.com/apk/res/android"
+	android:shouldDisableView="true"
+	android:selectable="true">	
+	<PreferenceCategory
+		android:title="@string/general_preferences">
+		<PreferenceScreen
+			android:key="contact_list"
+			android:title="@string/contact_list_preferences"
+			android:summary="@string/contact_list_preferences_sum">
+			<CheckBoxPreference
+				android:title="@string/CLP_hidden_contact"
+				android:defaultValue="false"
+				android:summary="@string/CLP_hidden_contact_sum"
 				android:key="settings_key_hidden_contact" />
-			<CheckBoxPreference android:title="@string/CLP_hide_groups"
-				android:defaultValue="false" android:summary="@string/CLP_hide_groups_sum"
+			<CheckBoxPreference
+				android:title="@string/CLP_hide_groups"
+				android:defaultValue="false"
+				android:summary="@string/CLP_hide_groups_sum"
 				android:key="settings_key_hide_groups" />
-			<CheckBoxPreference android:title="@string/away_chk_title"
-				android:defaultValue="true" android:summary="@string/away_chk_sum"
+			<CheckBoxPreference
+				android:title="@string/away_chk_title"
+				android:defaultValue="true"
+				android:summary="@string/away_chk_sum"
 				android:key="settings_away_chk" />
-			<EditTextPreference android:dependency="settings_away_chk"
-				android:singleLine="true" android:summary="@string/away_message_sum"
-				android:title="@string/away_message_title" android:key="settings_away_message"
+			<EditTextPreference
+				android:dependency="settings_away_chk"
+				android:singleLine="true"
+				android:summary="@string/away_message_sum"
+				android:title="@string/away_message_title"
+				android:key="settings_away_message"
 				android:hint="@string/away_message_hint" />
 		</PreferenceScreen>
-		<PreferenceScreen android:key="chat"
-			android:title="@string/chat_preferences" android:summary="@string/chat_preferences_sum">
-			<PreferenceCategory android:title="@string/history_preferences">
-				<CheckBoxPreference android:id="@+id/chat_history"
-					android:title="@string/history" android:summary="@string/history_sum"
-					 android:defaultValue="false" android:key="settings_key_history" />
-				<EditTextPreference android:dependency="settings_key_history"
-					android:singleLine="true" android:title="@string/chat_history_path"
-					android:summary="@string/chat_history_path_sum" android:key="settings_chat_history_path"
+		<PreferenceScreen
+			android:key="chat"
+			android:title="@string/chat_preferences"
+			android:summary="@string/chat_preferences_sum">
+			<PreferenceCategory
+				android:title="@string/history_preferences">
+				<CheckBoxPreference
+					android:id="@+id/chat_history"
+					android:title="@string/history"
+					android:summary="@string/history_sum"
+					android:defaultValue="false"
+					android:key="settings_key_history" />
+				<EditTextPreference
+					android:dependency="settings_key_history"
+					android:singleLine="true"
+					android:title="@string/chat_history_path"
+					android:summary="@string/chat_history_path_sum"
+					android:key="settings_chat_history_path"
 					android:hint="/Android/data/com.beem.project.beem/chat/" />
 			</PreferenceCategory>
-			<PreferenceCategory android:title="@string/chat_layout_option">
-				<CheckBoxPreference android:title="@string/settings_chat_compact"
-					android:defaultValue="false" android:summary="@string/settings_chat_compact_sum"
+			<PreferenceCategory
+				android:title="@string/chat_layout_option">
+				<CheckBoxPreference
+					android:title="@string/settings_chat_compact"
+					android:defaultValue="false"
+					android:summary="@string/settings_chat_compact_sum"
 					android:key="settings_chat_compact_key" />
 			</PreferenceCategory>
-			</PreferenceScreen>
-		<PreferenceScreen android:title="@string/notification_preferences">
-			<CheckBoxPreference android:title="@string/notification_enable_vibrate_title"
-				android:defaultValue="false" android:summary="@string/notification_enable_vibrate_sum"
+		</PreferenceScreen>
+		<PreferenceScreen
+			android:title="@string/notification_preferences">
+			<CheckBoxPreference
+				android:title="@string/notification_enable_vibrate_title"
+				android:defaultValue="false"
+				android:summary="@string/notification_enable_vibrate_sum"
 				android:key="notification_vibrate" />
-			<RingtonePreference android:title="@string/notification_snd_title"
-				android:key="notification_sound" android:summary="@string/notification_snd_sum"
-				android:ringtoneType="notification" android:showDefault="true" />
+			<RingtonePreference
+				android:title="@string/notification_snd_title"
+				android:key="notification_sound"
+				android:summary="@string/notification_snd_sum"
+				android:ringtoneType="notification"
+				android:showDefault="true" />
 		</PreferenceScreen>
 	</PreferenceCategory>
-	<PreferenceCategory android:title="@string/user_preferences">
-		<EditTextPreference android:singleLine="true"
-			android:summary="@string/SettingsText" android:title="@string/settings_account_username"
-			android:key="account_username" android:hint="@string/login_username_info_default"
+	<PreferenceCategory
+		android:title="@string/user_preferences">
+		<EditTextPreference
+			android:singleLine="true"
+			android:summary="@string/SettingsText"
+			android:title="@string/settings_account_username"
+			android:key="account_username"
+			android:hint="@string/login_username_info_default"
 			android:inputType="textEmailAddress" />
-		<EditTextPreference android:name="password"
-			android:singleLine="true" android:password="true" android:summary="@string/SettingsPassword"
-			android:title="@string/settings_account_password" android:key="account_password" />
+		<EditTextPreference
+			android:name="password"
+			android:singleLine="true"
+			android:password="true"
+			android:summary="@string/SettingsPassword"
+			android:title="@string/settings_account_password"
+			android:key="account_password" />
 	</PreferenceCategory>
-	<PreferenceCategory android:title="@string/user_preferences_advanced">
-		<EditTextPreference android:key="settings_key_resource"
-			android:title="@string/SettingsResourceTitle" android:summary="@string/SettingsResourceSummary"
+	<PreferenceCategory
+		android:title="@string/user_preferences_advanced">
+		<EditTextPreference
+			android:key="settings_key_resource"
+			android:title="@string/SettingsResourceTitle"
+			android:summary="@string/SettingsResourceSummary"
 			android:defaultValue="Beem" />
-		<EditTextPreference android:key="settings_key_priority"
-			android:title="@string/SettingsPriorityTitle" android:summary="@string/SettingsPrioritySummary"
-			android:numeric="signed" android:defaultValue="0" />
+		<EditTextPreference
+			android:key="settings_key_priority"
+			android:title="@string/SettingsPriorityTitle"
+			android:summary="@string/SettingsPrioritySummary"
+			android:numeric="signed"
+			android:defaultValue="0" />
 	</PreferenceCategory>
-	<PreferenceCategory android:title="@string/network_preferences">
-		<PreferenceScreen android:key="proxy" android:title="@string/SettingsProxy"
+	<PreferenceCategory
+		android:title="@string/network_preferences">
+		<PreferenceScreen
+			android:key="proxy"
+			android:title="@string/SettingsProxy"
 			android:summary="@string/settings_proxy_sum">
-			<CheckBoxPreference android:title="@string/SettingsProxyProxy"
-				android:defaultValue="false" android:summary="@string/SettingsProxySummary"
+			<CheckBoxPreference
+				android:title="@string/SettingsProxyProxy"
+				android:defaultValue="false"
+				android:summary="@string/SettingsProxySummary"
 				android:key="proxy_use" />
-			<PreferenceCategory android:title="@string/proxy_proxy_settings">
-				<ListPreference android:dependency="proxy_use"
-					android:title="@string/SettingsProxyType" android:entries="@array/proxy_types"
+			<PreferenceCategory
+				android:title="@string/proxy_proxy_settings">
+				<ListPreference
+					android:dependency="proxy_use"
+					android:title="@string/SettingsProxyType"
+					android:entries="@array/proxy_types"
 					android:summary="@string/SettingsProxyTypeSummary"
-					android:defaultValue="HTTP" android:entryValues="@array/proxy_types"
+					android:defaultValue="HTTP"
+					android:entryValues="@array/proxy_types"
 					android:key="proxy_type" />
-				<EditTextPreference android:singleLine="true"
-					android:dependency="proxy_use" android:name="serveur"
-					android:summary="@string/SettingsProxyServer" android:title="@string/settings_proxy_server"
+				<EditTextPreference
+					android:singleLine="true"
+					android:dependency="proxy_use"
+					android:name="serveur"
+					android:summary="@string/SettingsProxyServer"
+					android:title="@string/settings_proxy_server"
 					android:key="proxy_server" />
-				<EditTextPreference android:singleLine="true"
-					android:dependency="proxy_use" android:name="port"
-					android:summary="@string/SettingsProxyPort" android:title="@string/settings_proxy_port"
-					android:key="proxy_port" android:numeric="signed"
+				<EditTextPreference
+					android:singleLine="true"
+					android:dependency="proxy_use"
+					android:name="port"
+					android:summary="@string/SettingsProxyPort"
+					android:title="@string/settings_proxy_port"
+					android:key="proxy_port"
+					android:numeric="signed"
 					android:hint="@string/comments_proxy_port" />
 			</PreferenceCategory>
-			<PreferenceCategory android:title="@string/proxy_user_settings">
-				<EditTextPreference android:singleLine="true"
-					android:dependency="proxy_use" android:name="Utilisateur"
-					android:summary="@string/SettingsProxyUser" android:title="@string/settings_proxy_username"
+			<PreferenceCategory
+				android:title="@string/proxy_user_settings">
+				<EditTextPreference
+					android:singleLine="true"
+					android:dependency="proxy_use"
+					android:name="Utilisateur"
+					android:summary="@string/SettingsProxyUser"
+					android:title="@string/settings_proxy_username"
 					android:key="proxy_username" />
-				<EditTextPreference android:singleLine="true"
-					android:dependency="proxy_use" android:name="pass_user"
-					android:password="true" android:summary="@string/SettingsProxyPassword"
-					android:title="@string/settings_proxy_password" android:key="proxy_password" />
+				<EditTextPreference
+					android:singleLine="true"
+					android:dependency="proxy_use"
+					android:name="pass_user"
+					android:password="true"
+					android:summary="@string/SettingsProxyPassword"
+					android:title="@string/settings_proxy_password"
+					android:key="proxy_password" />
 			</PreferenceCategory>
 		</PreferenceScreen>
-
-		<PreferenceScreen android:key="advanced"
-			android:title="@string/SettingsAdvanced" android:summary="@string/settings_advanced_sum">
-			<PreferenceCategory android:title="@string/settings_advanced_service_behaviour">
-				<CheckBoxPreference android:title="@string/settings_xmpp_use_tls"
-					android:defaultValue="false" android:key="settings_key_xmpp_tls_use" />
-				<CheckBoxPreference android:title="@string/settings_smack_debug"
-					android:defaultValue="false" android:key="smack_debug" />
-				<EditTextPreference android:singleLine="true"
-					android:title="@string/settings_reco_delay" android:name="Reconnect delay"
-					android:summary="@string/SettingsAdvancedRecoDelay" android:key="settings_key_reco_delay"
+		<PreferenceScreen
+			android:key="advanced"
+			android:title="@string/SettingsAdvanced"
+			android:summary="@string/settings_advanced_sum">
+			<PreferenceCategory
+				android:title="@string/settings_advanced_service_behaviour">
+				<CheckBoxPreference
+					android:title="@string/settings_xmpp_use_tls"
+					android:defaultValue="false"
+					android:key="settings_key_xmpp_tls_use" />
+				<CheckBoxPreference
+					android:title="@string/settings_smack_debug"
+					android:defaultValue="false"
+					android:key="smack_debug" />
+				<EditTextPreference
+					android:singleLine="true"
+					android:title="@string/settings_reco_delay"
+					android:name="Reconnect delay"
+					android:summary="@string/SettingsAdvancedRecoDelay"
+					android:key="settings_key_reco_delay"
 					android:defaultValue="10" />
 			</PreferenceCategory>
-			<CheckBoxPreference android:title="@string/SettingsAdvancedOptions"
-				android:defaultValue="false" android:summary="@string/SettingsAdvancedSpecOpt"
+			<CheckBoxPreference
+				android:title="@string/SettingsAdvancedOptions"
+				android:defaultValue="false"
+				android:summary="@string/SettingsAdvancedSpecOpt"
 				android:key="settings_key_specific_server" />
-			<EditTextPreference android:singleLine="true"
-				android:dependency="settings_key_specific_server" android:name="adresse"
-				android:summary="@string/SettingsAdvancedAddOpt" android:title="@string/settings_xmpp_server"
-				android:key="settings_key_xmpp_server" android:hint="@string/comments_xmpp_server" />
-			<EditTextPreference android:singleLine="true"
-				android:dependency="settings_key_specific_server" android:name="port"
-				android:summary="@string/SettingsAdvancedPortOpt" android:title="@string/settings_xmpp_port"
-				android:defaultValue="5222" android:numeric="signed" android:key="settings_key_xmpp_port"
+			<EditTextPreference
+				android:singleLine="true"
+				android:dependency="settings_key_specific_server"
+				android:name="adresse"
+				android:summary="@string/SettingsAdvancedAddOpt"
+				android:title="@string/settings_xmpp_server"
+				android:key="settings_key_xmpp_server"
+				android:hint="@string/comments_xmpp_server" />
+			<EditTextPreference
+				android:singleLine="true"
+				android:dependency="settings_key_specific_server"
+				android:name="port"
+				android:summary="@string/SettingsAdvancedPortOpt"
+				android:title="@string/settings_xmpp_port"
+				android:defaultValue="5222"
+				android:numeric="signed"
+				android:key="settings_key_xmpp_port"
 				android:hint="@string/comments_xmpp_port" />
-			<CheckBoxPreference android:title="@string/settings_full_jid_login"
-				android:defaultValue="false" android:summary="@string/settings_full_jid_login_sum"
+			<CheckBoxPreference
+				android:title="@string/settings_full_jid_login"
+				android:defaultValue="false"
+				android:summary="@string/settings_full_jid_login_sum"
 				android:key="full_jid_login" />
 		</PreferenceScreen>
 	</PreferenceCategory>
-</PreferenceScreen>
+</PreferenceScreen>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/res/values/attrs.xml	Thu Apr 21 21:05:25 2011 +0200
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+	<declare-styleable
+		name="CheckBoxPreference_Custom">
+	</declare-styleable>
+</resources>
\ No newline at end of file
--- a/res/xml/authenticator.xml	Sat Apr 16 13:16:28 2011 +0200
+++ b/res/xml/authenticator.xml	Thu Apr 21 21:05:25 2011 +0200
@@ -4,7 +4,7 @@
 	android:accountType="com.beem.project.com"
 	android:icon="@drawable/beem_launcher_icon_silver"
 	android:smallIcon="@drawable/beem_status_icon"
-	android:label="@string/app_name"	
+	android:label="@string/app_name"
+	android:accountPreferences="@xml/preferences"
 	/>
-<!--	android:accountPreferences="@xml/preferences" /> -->
 	
\ No newline at end of file
--- a/res/xml/preferences.xml	Sat Apr 16 13:16:28 2011 +0200
+++ b/res/xml/preferences.xml	Thu Apr 21 21:05:25 2011 +0200
@@ -1,8 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <PreferenceScreen
-	xmlns:android="http://schemas.android.com/apk/res/android">	
-    <PreferenceCategory android:key="dataAndSynchronization"
-            android:title="SYNCRHONISATION BEEM" />
+	xmlns:android="http://schemas.android.com/apk/res/android">
 	<PreferenceCategory
 		android:title="General Settings" />
 	<PreferenceScreen
@@ -25,5 +23,14 @@
 	</PreferenceScreen>
 	<CheckBoxPreference
 		android:key="prefer wifi"
-		android:title="Prefer WiFi" />
+		android:title="Prefer WiFi"
+		android:layout="?android:attr/preferenceLayoutChild" />
+	<PreferenceCategory
+		android:key="custom"
+		android:title="Custom">
+		<com.beem.project.beem.account.CheckBoxPreference_Custom
+			android:key="custom_checkbox"
+			android:title="Title"
+			android:summary="Summary" />
+	</PreferenceCategory>
 </PreferenceScreen>
\ No newline at end of file
--- a/src/com/beem/project/beem/BeemConnection.java	Sat Apr 16 13:16:28 2011 +0200
+++ b/src/com/beem/project/beem/BeemConnection.java	Thu Apr 21 21:05:25 2011 +0200
@@ -1,6 +1,51 @@
+/*
+    BEEM is a videoconference application on the Android Platform.
+
+    Copyright (C) 2009 by Frederic-Charles Barthelery,
+                          Jean-Manuel Da Silva,
+                          Nikita Kozlov,
+                          Philippe Lago,
+                          Jean Baptiste Vergely,
+                          Vincent Veronis.
+
+    This file is part of BEEM.
+
+    BEEM is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    BEEM is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with BEEM.  If not, see <http://www.gnu.org/licenses/>.
+
+    Please send bug reports with examples or suggestions to
+    contact@beem-project.com or http://dev.beem-project.com/
+
+    Epitech, hereby disclaims all copyright interest in the program "Beem"
+    written by Frederic-Charles Barthelery,
+               Jean-Manuel Da Silva,
+               Nikita Kozlov,
+               Philippe Lago,
+               Jean Baptiste Vergely,
+               Vincent Veronis.
+
+    Nicolas Sadirac, November 26, 2009
+    President of Epitech.
+
+    Flavien Astraud, November 26, 2009
+    Head of the EIP Laboratory.
+
+ */
+
 package com.beem.project.beem;
 
 import org.jivesoftware.smack.ConnectionConfiguration;
+
 import org.jivesoftware.smack.ConnectionConfiguration.SecurityMode;
 import org.jivesoftware.smack.proxy.ProxyInfo;
 import org.jivesoftware.smack.proxy.ProxyInfo.ProxyType;
@@ -10,6 +55,10 @@
 
 import android.content.SharedPreferences;
 
+/**
+ * Class for connection informations
+ * @author marseille 
+ */
 public class BeemConnection {
 
     private static final int DEFAULT_XMPP_PORT = 5222;
@@ -95,6 +144,9 @@
 	mSettings.unregisterOnSharedPreferenceChangeListener(mPreferenceListener);
     }
 
+    /**
+     * Don't send presence ex. SyncAdapter.
+     */
     public void setNoPresence() {
 	mConnectionConfiguration.setSendPresence(false);
     }
--- a/src/com/beem/project/beem/account/AccountPreferences.java	Sat Apr 16 13:16:28 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/**
- * 
- */
-package com.beem.project.beem.account;
-
-import android.accounts.Account;
-import android.accounts.OnAccountsUpdateListener;
-import android.os.Bundle;
-import android.preference.PreferenceActivity;
-import android.util.Log;
-
-/**
- * @author marseille
- */
-public class AccountPreferences extends PreferenceActivity implements OnAccountsUpdateListener {
-    
-    private static final String TAG = "AccountPreferences";
-
-    
-    /**
-     * 
-     */
-    @Override
-    public void onAccountsUpdated(Account[] accounts) {
-	// TODO Auto-generated method stub
-	
-    }
-
-    
-    @Override
-    public void onCreate(Bundle icicle) {
-        super.onCreate(icicle);
-        Log.e(TAG, "ONCREATE");
-    }
-
-
-}
--- a/src/com/beem/project/beem/account/Authenticator.java	Sat Apr 16 13:16:28 2011 +0200
+++ b/src/com/beem/project/beem/account/Authenticator.java	Thu Apr 21 21:05:25 2011 +0200
@@ -1,3 +1,47 @@
+/*
+    BEEM is a videoconference application on the Android Platform.
+
+    Copyright (C) 2009 by Frederic-Charles Barthelery,
+                          Jean-Manuel Da Silva,
+                          Nikita Kozlov,
+                          Philippe Lago,
+                          Jean Baptiste Vergely,
+                          Vincent Veronis.
+
+    This file is part of BEEM.
+
+    BEEM is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    BEEM is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with BEEM.  If not, see <http://www.gnu.org/licenses/>.
+
+    Please send bug reports with examples or suggestions to
+    contact@beem-project.com or http://dev.beem-project.com/
+
+    Epitech, hereby disclaims all copyright interest in the program "Beem"
+    written by Frederic-Charles Barthelery,
+               Jean-Manuel Da Silva,
+               Nikita Kozlov,
+               Philippe Lago,
+               Jean Baptiste Vergely,
+               Vincent Veronis.
+
+    Nicolas Sadirac, November 26, 2009
+    President of Epitech.
+
+    Flavien Astraud, November 26, 2009
+    Head of the EIP Laboratory.
+
+ */
+
 package com.beem.project.beem.account;
 
 import android.accounts.AbstractAccountAuthenticator;
@@ -12,15 +56,26 @@
 
 import com.beem.project.beem.ui.wizard.AccountConfigure;
 
+/**
+ * Class to integrate beem in android's account
+ * @author marseille 
+ */
 public class Authenticator extends AbstractAccountAuthenticator {
 
     private Context mContext;
 
+    /**
+     * Contructor
+     * @param context context 
+     */
     public Authenticator(Context context) {
 	super(context);
 	mContext = context;
     }
     
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType,
 	String[] requiredFeatures, Bundle options) throws NetworkErrorException {
@@ -33,6 +88,10 @@
 	return reply;
     }
 
+
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public Bundle confirmCredentials(AccountAuthenticatorResponse response, Account account, Bundle options)
 	throws NetworkErrorException {
@@ -40,12 +99,20 @@
 	return null;
     }
 
+
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public Bundle editProperties(AccountAuthenticatorResponse response, String accountType) {
 	Log.e("AUTHENTICATOR", "edit properties");
 	return null;
     }
 
+
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public Bundle getAuthToken(AccountAuthenticatorResponse response, Account account, String authTokenType,
 	Bundle options) throws NetworkErrorException {
@@ -53,12 +120,20 @@
 	return null;
     }
 
+
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public String getAuthTokenLabel(String authTokenType) {
 	Log.e("AUTHENTICATOR", "get auth token label");
 	return null;
     }
 
+
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public Bundle hasFeatures(AccountAuthenticatorResponse response, Account account, String[] features)
 	throws NetworkErrorException {
@@ -66,6 +141,10 @@
 	return null;
     }
 
+
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public Bundle updateCredentials(AccountAuthenticatorResponse response, Account account, String authTokenType,
 	Bundle options) throws NetworkErrorException {
--- a/src/com/beem/project/beem/account/AuthenticatorService.java	Sat Apr 16 13:16:28 2011 +0200
+++ b/src/com/beem/project/beem/account/AuthenticatorService.java	Thu Apr 21 21:05:25 2011 +0200
@@ -1,23 +1,81 @@
+/*
+    BEEM is a videoconference application on the Android Platform.
+
+    Copyright (C) 2009 by Frederic-Charles Barthelery,
+                          Jean-Manuel Da Silva,
+                          Nikita Kozlov,
+                          Philippe Lago,
+                          Jean Baptiste Vergely,
+                          Vincent Veronis.
+
+    This file is part of BEEM.
+
+    BEEM is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    BEEM is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with BEEM.  If not, see <http://www.gnu.org/licenses/>.
+
+    Please send bug reports with examples or suggestions to
+    contact@beem-project.com or http://dev.beem-project.com/
+
+    Epitech, hereby disclaims all copyright interest in the program "Beem"
+    written by Frederic-Charles Barthelery,
+               Jean-Manuel Da Silva,
+               Nikita Kozlov,
+               Philippe Lago,
+               Jean Baptiste Vergely,
+               Vincent Veronis.
+
+    Nicolas Sadirac, November 26, 2009
+    President of Epitech.
+
+    Flavien Astraud, November 26, 2009
+    Head of the EIP Laboratory.
+
+ */
+
 package com.beem.project.beem.account;
 
 import android.app.Service;
 import android.content.Intent;
 import android.os.IBinder;
 
+/**
+ * Class to integrate beem in android's account 
+ * @author marseille
+ */
+
 public class AuthenticatorService extends Service {
 
     private Authenticator mAuth;
 
+    /**
+     * Constructor
+     */
     public AuthenticatorService() {
 	super();
     }
-
+    
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public void onCreate() {
 	super.onCreate();
 	mAuth = new Authenticator(getApplicationContext());
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public IBinder onBind(Intent intent) {
 	IBinder ret = null;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/account/CheckBoxPreference_Custom.java	Thu Apr 21 21:05:25 2011 +0200
@@ -0,0 +1,92 @@
+/*
+    BEEM is a videoconference application on the Android Platform.
+
+    Copyright (C) 2009 by Frederic-Charles Barthelery,
+                          Jean-Manuel Da Silva,
+                          Nikita Kozlov,
+                          Philippe Lago,
+                          Jean Baptiste Vergely,
+                          Vincent Veronis.
+
+    This file is part of BEEM.
+
+    BEEM is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    BEEM is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with BEEM.  If not, see <http://www.gnu.org/licenses/>.
+
+    Please send bug reports with examples or suggestions to
+    contact@beem-project.com or http://dev.beem-project.com/
+
+    Epitech, hereby disclaims all copyright interest in the program "Beem"
+    written by Frederic-Charles Barthelery,
+               Jean-Manuel Da Silva,
+               Nikita Kozlov,
+               Philippe Lago,
+               Jean Baptiste Vergely,
+               Vincent Veronis.
+
+    Nicolas Sadirac, November 26, 2009
+    President of Epitech.
+
+    Flavien Astraud, November 26, 2009
+    Head of the EIP Laboratory.
+
+ */
+
+package com.beem.project.beem.account;
+
+import android.content.Context;
+import android.preference.CheckBoxPreference;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.widget.CompoundButton;
+import android.widget.CompoundButton.OnCheckedChangeListener;
+
+/**
+ * Custom CheckBoxPreference for Android accountPreferences xml 
+ * @author marseille
+ */
+public class CheckBoxPreference_Custom extends CheckBoxPreference  implements OnCheckedChangeListener {
+
+    private static final String TAG = "CheckBoxPreference_Custom";
+
+    /**
+     * Constructor
+     */
+    public CheckBoxPreference_Custom(Context context) {
+	super(context);
+    }
+
+    /**
+     * Constructor
+     */
+    public CheckBoxPreference_Custom(Context context, AttributeSet attrs) {
+	super(context, attrs);
+    }
+
+    /**
+     * Constructor
+     */
+    public CheckBoxPreference_Custom(Context context, AttributeSet attrs, int defStyle) {
+	super(context, attrs, defStyle);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+	Log.e(TAG, "Checked : " + isChecked);
+
+    }
+
+}
--- a/src/com/beem/project/beem/account/ManageAccountsSettings.java	Sat Apr 16 13:16:28 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-
-package com.beem.project.beem.account;
-
-import android.app.Dialog;
-import android.os.Bundle;
-import android.preference.Preference;
-import android.preference.PreferenceScreen;
-import android.util.Log;
-import android.view.View;
-
-import com.beem.project.beem.R;
-
-public class ManageAccountsSettings extends AccountPreferences implements View.OnClickListener {
-    
-    protected static final String TAG = "AccountSettings";
-    
-    @Override
-    public void onCreate(Bundle icicle) {
-        super.onCreate(icicle);
-        Log.e(TAG,"ONCREATE");
-        setContentView(R.layout.account_settings);
-        addPreferencesFromResource(R.xml.preferences);  
-    }
-
-    @Override
-    public void onDestroy() {
-        super.onDestroy();
-    }
-
-    @Override
-    public boolean onPreferenceTreeClick(PreferenceScreen preferences, Preference preference) {
-	 Log.e(TAG,"OnTreeclick()");
-        return true;
-    }
-
-    @Override
-    protected Dialog onCreateDialog(int id) {
-	Log.e(TAG,"OnCreateDialog()");
-        return null;
-    }
-
-    @Override
-    public void onClick(View v) {
-	Log.e(TAG, "onClick");
-    }
-
-}
--- a/src/com/beem/project/beem/account/SyncAdapter.java	Sat Apr 16 13:16:28 2011 +0200
+++ b/src/com/beem/project/beem/account/SyncAdapter.java	Thu Apr 21 21:05:25 2011 +0200
@@ -1,3 +1,47 @@
+/*
+    BEEM is a videoconference application on the Android Platform.
+
+    Copyright (C) 2009 by Frederic-Charles Barthelery,
+                          Jean-Manuel Da Silva,
+                          Nikita Kozlov,
+                          Philippe Lago,
+                          Jean Baptiste Vergely,
+                          Vincent Veronis.
+
+    This file is part of BEEM.
+
+    BEEM is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    BEEM is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with BEEM.  If not, see <http://www.gnu.org/licenses/>.
+
+    Please send bug reports with examples or suggestions to
+    contact@beem-project.com or http://dev.beem-project.com/
+
+    Epitech, hereby disclaims all copyright interest in the program "Beem"
+    written by Frederic-Charles Barthelery,
+               Jean-Manuel Da Silva,
+               Nikita Kozlov,
+               Philippe Lago,
+               Jean Baptiste Vergely,
+               Vincent Veronis.
+
+    Nicolas Sadirac, November 26, 2009
+    President of Epitech.
+
+    Flavien Astraud, November 26, 2009
+    Head of the EIP Laboratory.
+
+ */
+
 package com.beem.project.beem.account;
 
 import android.accounts.Account;
@@ -9,16 +53,28 @@
 import android.os.Bundle;
 import android.util.Log;
 
+/**
+ * Class to integrate beem in android's account
+ * @author marseille
+ */
 public class SyncAdapter extends AbstractThreadedSyncAdapter {
 
     private Context mContext;
     private static final String TAG = "SyncAdapter";
 
+    /**
+     * Constructor.
+     * @param context context
+     * @param autoInitialize autoInitialize
+     */
     public SyncAdapter(Context context, boolean autoInitialize) {
 	super(context, autoInitialize);
 	mContext = context;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public void onPerformSync(Account account, Bundle extras, String authority, ContentProviderClient provider,
 	SyncResult syncResult) {
--- a/src/com/beem/project/beem/account/SyncAdapterService.java	Sat Apr 16 13:16:28 2011 +0200
+++ b/src/com/beem/project/beem/account/SyncAdapterService.java	Thu Apr 21 21:05:25 2011 +0200
@@ -1,6 +1,47 @@
-/**
- * 
+/*
+    BEEM is a videoconference application on the Android Platform.
+
+    Copyright (C) 2009 by Frederic-Charles Barthelery,
+                          Jean-Manuel Da Silva,
+                          Nikita Kozlov,
+                          Philippe Lago,
+                          Jean Baptiste Vergely,
+                          Vincent Veronis.
+
+    This file is part of BEEM.
+
+    BEEM is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    BEEM is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with BEEM.  If not, see <http://www.gnu.org/licenses/>.
+
+    Please send bug reports with examples or suggestions to
+    contact@beem-project.com or http://dev.beem-project.com/
+
+    Epitech, hereby disclaims all copyright interest in the program "Beem"
+    written by Frederic-Charles Barthelery,
+               Jean-Manuel Da Silva,
+               Nikita Kozlov,
+               Philippe Lago,
+               Jean Baptiste Vergely,
+               Vincent Veronis.
+
+    Nicolas Sadirac, November 26, 2009
+    President of Epitech.
+
+    Flavien Astraud, November 26, 2009
+    Head of the EIP Laboratory.
+
  */
+
 package com.beem.project.beem.account;
 
 import java.util.ArrayList;
@@ -29,14 +70,13 @@
 import android.os.IBinder;
 import android.os.RemoteException;
 import android.provider.ContactsContract;
-import android.provider.ContactsContract.StatusUpdates;
-import android.provider.ContactsContract.CommonDataKinds.Im;
 import android.provider.ContactsContract.CommonDataKinds.StructuredName;
 import android.util.Log;
 
 import com.beem.project.beem.BeemConnection;
 
 /**
+ * Class to integrate beem in android's account
  * @author marseille
  */
 public class SyncAdapterService extends Service {
@@ -46,6 +86,9 @@
     private static ContentResolver mContentResolver = null;
     private static Context mContext;
 
+    /**
+     * Constructor.
+     */
     public SyncAdapterService() {
 	super();
     }
@@ -69,6 +112,16 @@
 	return mSyncAdapter;
     }
 
+    /**
+     * Method to sync Beem roster with Android
+     * @param context context
+     * @param account account
+     * @param extras extras
+     * @param authority authority
+     * @param provider provider
+     * @param syncResult syncResult
+     * @throws OperationCanceledException OperationCanceledException 
+     */
     public static void performSync(Context context, final Account account, Bundle extras, String authority,
 	ContentProviderClient provider, SyncResult syncResult) throws OperationCanceledException {
 	mContentResolver = context.getContentResolver();