# HG changeset patch
# User "Vincent Veronis"
# Date 1303412725 -7200
# Node ID 193a934390ba914545ae649abc5c1bc1b081459b
# Parent b5104ccb1916b38ddbd99dbca089dd3adb75b8ee
Try to modify accountPreferences Android API activity
diff -r b5104ccb1916 -r 193a934390ba AndroidManifest.xml
--- 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 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff -r b5104ccb1916 -r 193a934390ba res/layout/preferences.xml
--- 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 @@
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
+
+
+
-
-
+
-
-
-
+
+
-
+
-
-
+
-
+
-
-
+
-
+
-
-
+
-
-
-
+
-
-
-
-
+
-
+
-
-
-
-
-
-
+
+
+
+
-
-
-
+
-
-
+
\ No newline at end of file
diff -r b5104ccb1916 -r 193a934390ba res/values/attrs.xml
--- /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 @@
+
+
+
+
+
\ No newline at end of file
diff -r b5104ccb1916 -r 193a934390ba res/xml/authenticator.xml
--- 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"
/>
-
\ No newline at end of file
diff -r b5104ccb1916 -r 193a934390ba res/xml/preferences.xml
--- 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 @@
-
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ android:title="Prefer WiFi"
+ android:layout="?android:attr/preferenceLayoutChild" />
+
+
+
\ No newline at end of file
diff -r b5104ccb1916 -r 193a934390ba src/com/beem/project/beem/BeemConnection.java
--- 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 .
+
+ 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);
}
diff -r b5104ccb1916 -r 193a934390ba src/com/beem/project/beem/account/AccountPreferences.java
--- 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");
- }
-
-
-}
diff -r b5104ccb1916 -r 193a934390ba src/com/beem/project/beem/account/Authenticator.java
--- 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 .
+
+ 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 {
diff -r b5104ccb1916 -r 193a934390ba src/com/beem/project/beem/account/AuthenticatorService.java
--- 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 .
+
+ 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;
diff -r b5104ccb1916 -r 193a934390ba src/com/beem/project/beem/account/CheckBoxPreference_Custom.java
--- /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 .
+
+ 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);
+
+ }
+
+}
diff -r b5104ccb1916 -r 193a934390ba src/com/beem/project/beem/account/ManageAccountsSettings.java
--- 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");
- }
-
-}
diff -r b5104ccb1916 -r 193a934390ba src/com/beem/project/beem/account/SyncAdapter.java
--- 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 .
+
+ 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) {
diff -r b5104ccb1916 -r 193a934390ba src/com/beem/project/beem/account/SyncAdapterService.java
--- 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 .
+
+ 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();