--- a/.classpath Sun Feb 14 17:25:38 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path=""/>
- <classpathentry kind="lib" path="libs/asmack-jse.jar" sourcepath="/home/nikita/devel/asmack/src">
- <attributes>
- <attribute name="javadoc_location" value="file:/home/nikita/devel/smack/jingle/extension/"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="lib" path="libs/jlibrtp.jar"/>
- <classpathentry kind="lib" path="/home/nikita/android/platforms/android-1.6/android.jar">
- <attributes>
- <attribute name="javadoc_location" value="file:/home/nikita/android/docs/reference/"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
--- a/.hgignore Sun Feb 14 17:25:38 2010 +0100
+++ b/.hgignore Sat Dec 25 17:01:00 2010 +0100
@@ -7,4 +7,4 @@
local.properties
**~
**/.*.sw?
-
+.classpath
--- a/.hgtags Sun Feb 14 17:25:38 2010 +0100
+++ b/.hgtags Sat Dec 25 17:01:00 2010 +0100
@@ -1,3 +1,8 @@
16373c4cd73330fa568960a11a6ee7aea6886a4d sfr-release
bccd99644eac57bb19a239697704db089dd585f7 0.1
af35b5109f172411de5798991e89919b7ed5cf85 0.1.1
+25f6fded204ab05c9f89556cbc08cd191e0f2c52 0.1.2
+c77d496146964d9239b4c45446d99b960415a4a6 0.1.3
+1b88edb34d96acb5795b8d28e58b974f1bf2c1d6 0.1.4_rc
+887b6a1fd9662312bf1ec271f9735369ead04cad 0.1.4
+cf5db8d24b2a28ca501cc3e076abc55b38b41d90 0.1.4
--- a/AndroidManifest.xml Sun Feb 14 17:25:38 2010 +0100
+++ b/AndroidManifest.xml Sat Dec 25 17:01:00 2010 +0100
@@ -1,19 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.beem.project.beem" android:versionCode="2"
- android:versionName="0.1.1">
+ package="com.beem.project.beem" android:versionCode="5"
+ android:versionName="0.1.4">
<application android:label="@string/app_name"
android:icon="@drawable/beem_launcher_icon_silver" android:theme="@style/Theme.BEEM.Default"
- android:debuggable="true" android:name="@string/app_name">
+ android:debuggable="true" android:name=".BeemApplication">
<activity android:name=".ui.Login" android:label="@string/app_name"
- android:screenOrientation="portrait" android:launchMode="singleTask">
+ android:launchMode="standard">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
+ <activity android:name=".ui.wizard.Account" android:label="Account wizard" />
+ <activity android:name=".ui.wizard.AccountConfigure" android:label="Account wizard" />
<activity android:name=".ui.LoginAnim" android:label="@string/login_login_progress"
- android:launchMode="singleTop" />
+ android:launchMode="singleTop" android:screenOrientation="portrait" />
<activity android:name=".ui.Settings" android:label="@string/edit_settings_name">
<intent-filter android:label="Beem Connection">
<action
@@ -27,7 +29,9 @@
android:name="com.beem.project.beem.service.XmppConnectionAdapter.CONNECTION_CLOSED" />
</intent-filter>
</activity>
- <activity android:name=".ui.ChangeStatus" android:label="@string/ChangeStatusActTitle">
+ <activity android:name=".ui.ChangeStatus" android:label="@string/ChangeStatusActTitle"
+ android:launchMode="singleTask"
+ android:windowSoftInputMode="stateHidden" >
<intent-filter android:label="Beem Connection">
<action
android:name="com.beem.project.beem.service.XmppConnectionAdapter.CONNECTION_CLOSED" />
@@ -82,22 +86,20 @@
android:label="Beem Service" android:permission="com.beem.project.beem.BEEM_SERVICE">
<intent-filter>
<action android:name="com.beem.project.beem.BeemService"></action>
+ <action android:name="android.intent.action.SCREEN_OFF"></action>
+ <action android:name="android.intent.action.SCREEN_ON"></action>
</intent-filter>
</service>
</application>
<permission android:permissionGroup="android.permission-group.NETWORK"
android:label="BeemService" android:description="@string/BeemServiceDescription"
- android:name="com.beem.project.beem.BEEM_SERVICE"></permission>
- <uses-permission android:name="android.permission.INTERNET"></uses-permission>
- <uses-permission android:name="android.permission.VIBRATE"></uses-permission>
- <uses-permission android:name="android.permission.RECORD_AUDIO"></uses-permission>
- <uses-permission android:name="android.permission.WRITE_SETTINGS"></uses-permission>
- <uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>
- <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission>
- <uses-permission android:name="com.beem.project.beem.BEEM_SERVICE"></uses-permission>
- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
- <uses-permission android:name="android.permission.WAKE_LOCK"></uses-permission>
+ android:name="com.beem.project.beem.BEEM_SERVICE"/>
+ <uses-permission android:name="android.permission.INTERNET"/>
+ <uses-permission android:name="android.permission.VIBRATE"/>
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
+ <uses-permission android:name="com.beem.project.beem.BEEM_SERVICE"/>
<uses-sdk android:minSdkVersion="3" />
-<supports-screens android:largeScreens="true"
+ <supports-screens android:largeScreens="true"
android:normalScreens="true" android:smallScreens="true" android:anyDensity="true" />
</manifest>
--- a/CREDITS Sun Feb 14 17:25:38 2010 +0100
+++ b/CREDITS Sat Dec 25 17:01:00 2010 +0100
@@ -1,9 +1,24 @@
This file contains the name of the people who have contributed to
BEEM. The names are sorted alphabetically by last name.
+Core Team :
Frederic-Charles Barthelery
Jean-Manuel Da Silva
Nikita Kozlov
Philippe Lago
Jean Baptiste Vergely
Vincent Véronis
+
+Contributors :
+Nolan Darilek
+Stefan Endrullis
+
+Tranlators :
+GoApk http://goapk.com for chinese translations
+Daniel Hofmann for german translations
+Andrea Selva for italian translations
+Erik Lindström for swedish translations
+
+
+Thanks to all !
+
--- a/INSTALL Sun Feb 14 17:25:38 2010 +0100
+++ b/INSTALL Sat Dec 25 17:01:00 2010 +0100
@@ -1,13 +1,33 @@
-Howto Install Beem ?
+Android Market
+--------------
+
+First of all, BEEM is available on the Android market. Just search for 'BEEM'.
+
+Development version
+-------------------
1. Dependencies
- First you will need the Android SDK-1.5.
+ First you will need the latest Android SDK. You can download it at http://d.android.com. Beem is usually built with Android SDK 2.1 or superior.
+ You will also need the Apache Ant tool to build the project. You can get it at http://ant.apache.org
2. Android project
- Use the script provides by the SDK to set the Android platform directory.
- > $SDK_DIR/tools/android update project -t 2 -p $BEEM_DIRECTORY
+ Use the android program provides by the SDK to set the Android platform directory.
+
+ Set up the Beem project.
+ > $SDK_DIR/tools/android update project -p $BEEM_DIRECTORY
+
+or
+
+ If you want to build Beem for a different Android Target platform :
+ Get the Target id of the platform you want to build BEEM for.
+ > $SDK_DIR/tools/android list targets
+
+ Then use this id to set up the BEEM project.
+ > $SDK_DIR/tools/android update project -t $TARGET_ID -p $BEEM_DIRECTORY
3. Compile and install
- Use ant to compile and install the application on the Android emulator
+ Use ant to compile and install the application on the Android device
> ant install
+The development version use a private certificate to sign the package. You will need to uninstall it before installing or upgrading a version of BEEM from the Android market.
+
--- a/README Sun Feb 14 17:25:38 2010 +0100
+++ b/README Sat Dec 25 17:01:00 2010 +0100
@@ -1,3 +1,52 @@
+BEEM : Boost Your Eyes, Ears, and Mouth
+---------------------------------------
+
+BEEM is a full featured and easy to use XMPP (formerly named Jabber) client on the Android Platform.
+
+Beem is under constant development. Releases are usually frequent and driven by user contributions, such as bug reports and patches.
+
+Beem is free and contains no ads. All our code is open source and licensed under the GNU General Public License 3 and any later version. This means you can get Beem's code and modify it to suit your needs, as long as you publish the changes you make for everyone to benefit from as well.
+
+
+Features
+--------
+
+- Compatible with any standard XMPP server
+- SASL support
+- Proxy support (SOCKS4 SOCKS5 HTTP)
+- Support of DNS SERV
+
+New in 0.1.2:
+- DNS SERV
+- New options
+- Bug fix
+
+Futur:
+- Geolocation
+- Voip
+- MUC
+- Phone contact list
+
+
+Support & getting help
+----------------------
+
+For getting help or discussing about BEEM, you can join #beem on the freenode IRC network or on XMPP Multi User Chat : beem@conference.elyzion.net.
+We have a mailing list, feel free to subscribe here : http://list.beem-project.com/listinfo/beem-dev
+You can also contact the BEEM Team at beem-dev@list.beem-project.com.
+
+Before submitting a bug report, a patch or a feature request here, please read the Submission guidelines.
+
+
+Contributing and helping out
+----------------------------
+
+Beem is built and maintained by community volunteers. If you enjoy using it and would like to give back to the community, feel free to contact us.
+
+
+
+
Thanks you for downloading BEEM
http://www.beem-project.com
+
Binary file beem_key has changed
--- a/build.xml Sun Feb 14 17:25:38 2010 +0100
+++ b/build.xml Sat Dec 25 17:01:00 2010 +0100
@@ -70,8 +70,11 @@
<target name="clean"
description="Delete old build and dist directories">
<delete verbose="false" dir="${out.dir}"/>
+ <delete verbose="false" dir="gen"/>
</target>
+ <target name="all" depends="clean,debug,javadoc"/>
+
<target name="javadoc">
<javadoc author="true" destdir="${javadoc.output}" doctitle="Beem javadoc" source="1.6" sourcepath="${source.dir}" use="true" version="false" bootclasspathref="android.target.classpath">
<classpath>
--- a/default.properties Sun Feb 14 17:25:38 2010 +0100
+++ b/default.properties Sat Dec 25 17:01:00 2010 +0100
@@ -7,8 +7,5 @@
# "build.properties", and override values to adapt the script to your
# project structure.
-# Indicates whether an apk should be generated for each density.
-split.density=false
# Project target.
-target=android-7
-apk-configurations=
+target=android-9
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/asmack-beem/README.txt Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,43 @@
+INTRODUCTION
+------------
+asmack http://code.google.com/p/asmack/ is a portage of the Smack library for
+the Android platform. The project is mostly maintained by Rene Treffer and you
+can find the binaries at http://code.google.com/p/asmack/ and the sources at
+http://github.com/rtreffer/asmack
+
+The asmack project is based on the development version of the Smack library.
+This version is constantly moving but we want a fixed version for BEEM.
+We patched the asmack build process to use a fixed version of the Smack
+library. Currently, we use the revision 11644 of the Smack SVN repository.
+
+COMPILE
+-------
+
+First check out the last version of asmack
+> git clone git://github.com/rtreffer/asmack.git
+
+Then apply the beem-build-process.patch on the source.
+> cd asmack
+> patch -p1 < beem-build-process.patch
+>
+
+Add the beem flavour to the patch repository
+> cp -R beem_patches patch/beem
+>
+
+The 50-fix_chatmanager.patch is only necessary to fix a little bug in smack. The
+patch has been proposed to the Smack developers. See
+http://www.igniterealtime.org/issues/browse/SMACK-269 for progress.
+
+Edit your local.properties file to contains the path of the android SDK. See
+local.properties.example
+
+Build asmack
+> ./build.batch
+>
+
+The build directory will contains the files :
+ * asmack-android-$VERSION-beem.jar for asmack binaries for android $VERSION
+ * asmack-android-$VERSION-source-beem.zip for the asmack custom sources for
+ android $VERSION.
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/asmack-beem/beem-build-process.patch Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,33 @@
+--- asmack-git/build.bash 2010-05-07 22:08:18.000000000 +0200
++++ asmack/build.bash 2010-05-07 22:06:53.000000000 +0200
+@@ -15,11 +15,11 @@
+ if ! [ -f "${2}/.svn/entries" ]; then
+ mkdir "${2}"
+ cd "${2}"
+- svn co --non-interactive --trust-server-cert "${1}" "."
++ svn co --non-interactive --trust-server-cert "${1}" -r "${3}" "."
+ else
+ cd "${2}"
+ svn cleanup
+- svn up
++ svn up -r "${3}"
+ fi
+ )
+ }
+@@ -37,11 +37,11 @@
+ }
+
+ fetchall() {
+- gitfetch "git://github.com/rtreffer/smack.git" "smack"
+- fetch "http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/management/common/src/main/" "qpid"
+- fetch "http://svn.apache.org/repos/asf/harmony/enhanced/java/trunk/classlib/modules/auth/src/main/java/common/" "harmony"
+- fetch "https://dnsjava.svn.sourceforge.net/svnroot/dnsjava/trunk" "dnsjava"
+- fetch "https://kenai.com/svn/jbosh~main/trunk/jbosh/src/main/java" "jbosh"
++ fetch "http://svn.igniterealtime.org/svn/repos/smack/trunk" "smack" "11644"
++ fetch "http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/management/common/src/main/" "qpid" "HEAD"
++ fetch "http://svn.apache.org/repos/asf/harmony/enhanced/java/trunk/classlib/modules/auth/src/main/java/common/" "harmony" "HEAD"
++ fetch "https://dnsjava.svn.sourceforge.net/svnroot/dnsjava/trunk" "dnsjava" "HEAD"
++ fetch "https://kenai.com/svn/jbosh~main/trunk/jbosh/src/main/java" "jbosh" "HEAD"
+ }
+
+ copyfolder() {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/asmack-beem/beem_patches/10-PubSubManager-non-final.patch Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,13 @@
+Index: org/jivesoftware/smackx/pubsub/PubSubManager.java
+===================================================================
+--- org/jivesoftware/smackx/pubsub/PubSubManager.java (revision 11464)
++++ org/jivesoftware/smackx/pubsub/PubSubManager.java (working copy)
+@@ -41,7 +41,7 @@
+ *
+ * @author Robin Collier
+ */
+-final public class PubSubManager
++public class PubSubManager
+ {
+ private XMPPConnection con;
+ private String to;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/asmack-beem/beem_patches/50-fix-chatmanager.patch Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,32 @@
+ Copyright (C) 2010 by Frederic-Charles Barthelery,
+ Jean-Manuel Da Silva,
+ Nikita Kozlov,
+ Philippe Lago,
+ Jean Baptiste Vergely,
+ Vincent Veronis.
+
+ 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.
+
+--- ../../../src/smack/org/jivesoftware/smack/ChatManager.java 2010-02-23 19:27:26.000000000 +0100
++++ org/jivesoftware/smack/ChatManager.java 2010-02-23 19:37:47.000000000 +0100
+@@ -111,7 +111,9 @@
+ chat = getUserChat(message.getFrom());
+ }
+ }
+-
++ if (chat == null) {
++ chat = getUserChat(StringUtils.parseBareAddress(message.getFrom()));
++ }
+ if(chat == null) {
+ chat = createChat(message);
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/asmack-beem/beem_patches/50-fix-sasl-incorrect-encoding.patch Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,31 @@
+ Copyright (C) 2010 by Frederic-Charles Barthelery,
+ Jean-Manuel Da Silva,
+ Nikita Kozlov,
+ Philippe Lago,
+ Jean Baptiste Vergely,
+ Vincent Veronis.
+
+ 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.
+
+--- org/jivesoftware/smack/sasl/SASLMechanism.java~ 2010-07-20 15:13:25.000000000 +0200
++++ org/jivesoftware/smack/sasl/SASLMechanism.java 2010-07-20 15:15:41.000000000 +0200
+@@ -263,9 +263,6 @@
+ if (authenticationText != null) {
+ stanza.append(authenticationText);
+ }
+- else {
+- stanza.append("=");
+- }
+ stanza.append("</response>");
+ return stanza.toString();
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/asmack-beem/beem_patches/50-improved-pubsub.patch Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,46 @@
+--- ../../../src/smack/org/jivesoftware/smackx/pubsub/provider/ItemProvider.java (révision 11644)
++++ org/jivesoftware/smackx/pubsub/provider/ItemProvider.java (copie de travail)
+@@ -45,6 +45,8 @@
+ }
+ else
+ {
++ while (tag != XmlPullParser.START_TAG)
++ tag = parser.next();
+ String payloadElemName = parser.getName();
+ String payloadNS = parser.getNamespace();
+
+--- ../../../src/org/jivesoftware/smackx/pubsub/Node.java (révision 11644)
++++ org/jivesoftware/smackx/pubsub/Node.java (copie de travail)
+@@ -60,7 +60,7 @@
+ *
+ * For example, OpenFire requires the server to be prefixed by <b>pubsub</b>
+ */
+- void setTo(String toAddress)
++ public void setTo(String toAddress)
+ {
+ to = toAddress;
+ }
+--- ../../../src/org/jivesoftware/smackx/pubsub/LeafNode.java (révision 11644)
++++ org/jivesoftware/smackx/pubsub/LeafNode.java (copie de travail)
+@@ -34,7 +34,7 @@
+ */
+ public class LeafNode extends Node
+ {
+- LeafNode(Connection connection, String nodeName)
++ public LeafNode(Connection connection, String nodeName)
+ {
+ super(connection, nodeName);
+ }
+--- ../../../src/org/jivesoftware/smackx/pubsub/PubSubManager.java (révision 11644)
++++ org/jivesoftware/smackx/pubsub/PubSubManager.java (copie de travail)
+@@ -43,8 +43,8 @@
+ */
+ final public class PubSubManager
+ {
+- private Connection con;
+- private String to;
++ protected Connection con;
++ protected String to;
+ private Map<String, Node> nodeMap = new ConcurrentHashMap<String, Node>();
+
+ /**
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/asmack-beem/beem_patches/50-public-info-features.patch Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,37 @@
+ Copyright (C) 2010 by Frederic-Charles Barthelery,
+ Jean-Manuel Da Silva,
+ Nikita Kozlov,
+ Philippe Lago,
+ Jean Baptiste Vergely,
+ Vincent Veronis.
+
+ 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.
+
+--- org/jivesoftware/smackx/packet/DiscoverInfo.java 2010-07-22 22:16:27.000000000 +0200
++++ org/jivesoftware/smackx/packet/DiscoverInfo.java 2010-07-22 22:58:43.000000000 +0200
+@@ -62,7 +62,7 @@
+ *
+ * @return an Iterator on the discovered features of an XMPP entity
+ */
+- Iterator<Feature> getFeatures() {
++ public Iterator<Feature> getFeatures() {
+ synchronized (features) {
+ return Collections.unmodifiableList(features).iterator();
+ }
+@@ -266,4 +266,4 @@
+ return buf.toString();
+ }
+ }
+-}
+\ Pas de fin de ligne à la fin du fichier.
++}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/asmack-beem/beem_patches/COPYING Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/asmack-beem/beem_patches/README.txt Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,9 @@
+This directory contains different patch to apply on asmack sources. These
+patches will allow us to build a custom flavour of asmack for Beem. This
+directory must be copied in the patch directory of asmack in order to be used.
+Then build asmack the usual way.
+
+All the patches are released under the Apache License, Version 2.0
+You may obtain a copy of the License at
+http://www.apache.org.licenses/LICENCE-2.0
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/libs/README.txt Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,10 @@
+This directory contains the libraries used by BEEM.
+
+The principal one is asmack, a portage of the Smack library for the Android
+platform.
+
+The source of the asmack library can be downloaded at
+http://dev.beem-project.com/attachments/download/51/asmack-android-2.1-source-beem.zip
+
+See the file doc/asmack-beem/README.txt for more informations.
+
Binary file libs/asmack-android-7-beem.jar has changed
Binary file libs/asmack-jse.jar has changed
Binary file libs/jlibrtp.jar has changed
Binary file libs/security.jar has changed
--- a/res/anim/rotate_and_scale.xml Sun Feb 14 17:25:38 2010 +0100
+++ b/res/anim/rotate_and_scale.xml Sat Dec 25 17:01:00 2010 +0100
@@ -1,11 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
- <scale android:fromXScale="0.3" android:toXScale="0.3"
- android:fromYScale="0.3" android:toYScale="0.3"
- android:pivotX="50%" android:pivotY="50%"
- android:repeatMode="reverse" android:duration="8000"
- android:repeatCount="infinite" />
<rotate android:fromDegrees="0" android:toDegrees="360"
android:pivotX="50%" android:pivotY="50%"
android:duration="5000"
Binary file res/drawable-hdpi/beem_icon_launcher_color.png has changed
Binary file res/drawable-ldpi/beem_icon_launcher_color.png has changed
Binary file res/drawable-mdpi/beem_icon_launcher_color.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/drawable/avatar_status.xml Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Layer Level list drawable for Avatar and status icon
+ See src/com/beem/project/beem/utils/Status.java
+ for level values to change the status.
+ The status icon must be resized using method
+ LayerDrawable.setLayerInset();
+ The drawable with id @id/avatar must be replace by the real
+ avatar using the method LayerDrawable.setDrawableByLayerId()
+-->
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@+id/avatar">
+ <shape/>
+ </item>
+ <item android:drawable="@drawable/status_icon" />
+</layer-list>
Binary file res/drawable/beem_launcher_icon_color.png has changed
Binary file res/drawable/bottombar.png has changed
Binary file res/drawable/button_indicator_next.png has changed
Binary file res/drawable/button_indicator_prev.png has changed
Binary file res/drawable/ic_menu_add.png has changed
Binary file res/drawable/ic_menu_close_clear_cancel.png has changed
Binary file res/drawable/ic_menu_manage.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/drawable/status_icon.xml Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Level list drawable for status icon
+ See src/com/beem/project/beem/utils/Status.java
+ for level values
+-->
+<level-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:maxLevel="100" android:drawable="@android:drawable/presence_offline" />
+ <item android:maxLevel="200" android:drawable="@drawable/status_requested" />
+ <item android:maxLevel="300" android:drawable="@android:drawable/presence_away" />
+ <item android:maxLevel="400" android:drawable="@android:drawable/presence_busy" />
+ <item android:maxLevel="600" android:drawable="@android:drawable/presence_online" />
+ </level-list>
--- a/res/layout/addcontact.xml Sun Feb 14 17:25:38 2010 +0100
+++ b/res/layout/addcontact.xml Sat Dec 25 17:01:00 2010 +0100
@@ -11,21 +11,24 @@
<EditText android:id="@+id/addc_login" android:inputType="textEmailAddress"
android:imeOptions="actionNext" android:scrollHorizontally="true"
android:layout_width="fill_parent" android:layout_height="wrap_content"
- android:layout_margin="3dip" />
+ android:layout_margin="3dip"
+ android:contentDescription="@string/AddCLogin"/>
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="@string/AddCAlias"
style="@style/Label" />
<EditText android:id="@+id/addc_alias" android:inputType="text"
android:imeOptions="actionNext" android:textSize="16sp"
android:layout_width="fill_parent" android:layout_height="wrap_content"
- android:scrollHorizontally="true" android:layout_margin="3dip" />
+ android:scrollHorizontally="true" android:layout_margin="3dip"
+ android:contentDescription="@string/AddCAlias"/>
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="@string/AddCGroup"
style="@style/Label" />
<EditText android:id="@+id/addc_group" android:inputType="text"
android:textSize="16sp" android:layout_width="fill_parent"
android:scrollHorizontally="true" android:layout_height="wrap_content"
- android:layout_margin="3dip" />
+ android:layout_margin="3dip"
+ android:contentDescription="@string/AddCGroup"/>
<View android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_marginBottom="18dp" />
<Button android:id="@+id/addc_ok" android:layout_width="fill_parent"
--- a/res/layout/call.xml Sun Feb 14 17:25:38 2010 +0100
+++ b/res/layout/call.xml Sat Dec 25 17:01:00 2010 +0100
@@ -5,7 +5,7 @@
<LinearLayout android:layout_width="fill_parent"
android:layout_height="fill_parent" android:orientation="vertical"
android:layout_weight="1">
- <ImageView android:id="@+id/call_logo_anim" android:src="@drawable/beem_launcher_icon_color"
+ <ImageView android:id="@+id/call_logo_anim" android:src="@drawable/beem_icon_launcher_color"
android:layout_height="fill_parent" android:layout_width="fill_parent"
android:layout_weight="1" />
<TextView android:id="@+id/call_info" android:layout_width="fill_parent"
--- a/res/layout/changestatus.xml Sun Feb 14 17:25:38 2010 +0100
+++ b/res/layout/changestatus.xml Sat Dec 25 17:01:00 2010 +0100
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent" android:layout_height="fill_parent"
+ android:layout_width="fill_parent" android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent"
@@ -10,33 +10,41 @@
android:text="@string/ChangeStatusType" style="@style/Label" />
<Spinner android:id="@+id/ChangeStatusSpinner"
android:layout_width="fill_parent" android:layout_height="wrap_content"
- android:drawSelectorOnTop="true" android:layout_below="@id/ChangeStatusTypeLabel" />
+ android:drawSelectorOnTop="true" android:layout_below="@id/ChangeStatusTypeLabel"
+ android:contentDescription="@string/ChangeStatusType"/>
<TextView android:id="@+id/ChangeStatusMessageLabel"
android:layout_width="fill_parent" android:layout_height="wrap_content"
- android:text="@string/ChangeStatusMessage" style="@style/Label"
- android:layout_below="@id/ChangeStatusSpinner" />
+ android:layout_below="@id/ChangeStatusSpinner"
+ style="@style/Label"
+ android:inputType="textShortMessage|textCapSentences|textAutoCorrect|textMultiLine|textImeMultiLine"
+ android:imeOptions="actionDone"
+ android:selectAllOnFocus="true"
+ android:focusable="true"
+ />
<EditText android:id="@+id/ChangeStatusMessage"
android:inputType="textShortMessage|textAutoCorrect"
android:imeOptions="actionDone" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_below="@id/ChangeStatusMessageLabel"
android:layout_marginBottom="18dp" />
<LinearLayout android:id="@+id/ChangeStatusButtons"
- android:layout_width="fill_parent" android:layout_height="wrap_content"
- android:orientation="horizontal" android:layout_below="@id/ChangeStatusMessage"
- android:layout_alignParentBottom="true">
- <Button android:id="@+id/ChangeStatusOk" android:layout_width="fill_parent"
- android:layout_height="wrap_content" android:layout_weight="1"
+ android:layout_height="wrap_content" android:layout_width="fill_parent"
+ android:layout_below="@id/ChangeStatusMessage"
+ android:orientation="horizontal">
+ <Button android:id="@+id/ChangeStatusOk"
+ android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_weight="1"
android:text="@string/UpdateButton" android:textStyle="bold"
android:textSize="18sp" android:textColor="#333333" />
<Button android:id="@+id/ChangeStatusClear"
android:layout_width="fill_parent" android:layout_height="wrap_content"
- android:layout_weight="1" android:text="@string/ClearButton"
+ android:layout_weight="1"
+ android:text="@string/ClearButton"
android:textStyle="bold" android:textColor="#333333"
android:textSize="18sp" />
</LinearLayout>
<Button android:id="@+id/OpenContactList" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="@string/OpenContactList"
android:layout_below="@+id/ChangeStatusButtons" android:textStyle="bold" android:textColor="#333333"
- android:textSize="18sp" />
+ android:textSize="18sp" />
</RelativeLayout>
</ScrollView>
--- a/res/layout/chat.xml Sun Feb 14 17:25:38 2010 +0100
+++ b/res/layout/chat.xml Sat Dec 25 17:01:00 2010 +0100
@@ -7,32 +7,42 @@
android:orientation="horizontal" android:gravity="center_vertical"
android:background="#222222" android:padding="4px">
<ImageView android:id="@+id/chat_contact_status_icon"
- android:adjustViewBounds="true" android:layout_width="wrap_content"
- android:layout_height="wrap_content" android:gravity="center_vertical" />
+ android:src="@drawable/avatar_status"
+ android:layout_width="48dip"
+ android:layout_height="48dip"
+ />
<LinearLayout android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:paddingLeft="15sp">
<TextView android:id="@+id/chat_contact_name"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:lines="1" android:singleLine="true" android:textSize="16sp"
- android:textStyle="bold" android:textColor="#FFFFFF" />
+ android:textStyle="bold" android:textColor="#FFFFFF"
+ android:focusable="true"/>
<TextView android:id="@+id/chat_contact_status_msg"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:autoLink="all" android:textSize="12sp" android:textColor="#FFFFFF"
- android:textColorLink="#FFFFFF" />
+ android:textColorLink="#FFFFFF"
+ android:focusable="true"/>
+ <TextView android:id="@+id/chat_contact_chat_state"
+ android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:textStyle="italic" android:textSize="12sp"
+ android:focusable="true"/>
</LinearLayout>
</LinearLayout>
<View android:layout_width="fill_parent" android:layout_height="2dp"
android:fadingEdge="horizontal" android:background="#555555" />
<ListView android:id="@+id/chat_messages"
- android:layout_width="fill_parent" android:layout_height="0px"
+ android:layout_width="fill_parent" android:layout_height="0dip"
android:layout_weight="1" android:transcriptMode="normal"
+ android:stackFromBottom="true"
+ android:fadingEdge="none" android:padding="4px"
android:fastScrollEnabled="true" android:smoothScrollbar="false"
- android:layout_marginBottom="20sp" android:padding="4px" />
+ android:focusable="true"/>
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content" android:orientation="horizontal"
android:background="#222222" android:padding="8px">
- <EditText android:id="@+id/chat_input" android:layout_width="wrap_content"
+ <EditText android:id="@+id/chat_input" android:layout_width="0dip"
android:layout_height="fill_parent" android:layout_weight="1"
android:maxLines="5"
android:inputType="textShortMessage|textAutoCorrect|textMultiLine"
--- a/res/layout/chat_msg_row.xml Sun Feb 14 17:25:38 2010 +0100
+++ b/res/layout/chat_msg_row.xml Sat Dec 25 17:01:00 2010 +0100
@@ -1,22 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- >
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical" android:layout_width="fill_parent"
+ android:layout_height="wrap_content">
- <TextView android:id="@+id/chatmessagename"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:textSize="16sp"
- android:textColor="#FFFFFF"
- android:textStyle="bold"
- android:paddingBottom="1dp"
- />
- <TextView android:id="@+id/chatmessagetext"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:autoLink="all"
- />
-</LinearLayout>
+ <TextView android:id="@+id/chatmessagename"
+ android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true" android:layout_alignParentTop="true"
+ android:textSize="16sp" android:textColor="#FFFFFF" android:textStyle="bold"
+ android:paddingBottom="1dp" />
+ <TextView android:id="@+id/chatmessagedate"
+ android:layout_width="wrap_content" android:layout_height="wrap_content"
+ android:layout_alignParentTop="true" android:layout_alignParentRight="true"
+ android:autoLink="none" />
+ <TextView android:id="@+id/chatmessagetext"
+ android:layout_width="wrap_content" android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true" android:layout_below="@id/chatmessagename"
+ android:autoLink="all" />
+</RelativeLayout>
--- a/res/layout/contactdialogaliasdialog.xml Sun Feb 14 17:25:38 2010 +0100
+++ b/res/layout/contactdialogaliasdialog.xml Sat Dec 25 17:01:00 2010 +0100
@@ -11,5 +11,6 @@
android:layout_height="wrap_content" android:layout_width="fill_parent"
android:layout_marginLeft="20dip" android:layout_marginRight="20dip"
android:scrollHorizontally="true" android:autoText="false"
- android:capitalize="none" android:gravity="fill_horizontal" />
+ android:capitalize="none" android:gravity="fill_horizontal"
+ android:contentDescription="@string/userinfo_label_alias"/>
</LinearLayout>
--- a/res/layout/contactlist.xml Sun Feb 14 17:25:38 2010 +0100
+++ b/res/layout/contactlist.xml Sat Dec 25 17:01:00 2010 +0100
@@ -8,6 +8,8 @@
android:layout_height="fill_parent" android:orientation="horizontal"
android:padding="2px">
<ListView android:id="@+id/contactlist" android:layout_width="fill_parent"
- android:layout_height="fill_parent" android:transcriptMode="disabled" />
+ android:layout_height="fill_parent" android:transcriptMode="disabled"
+ android:textFilterEnabled="true" />
+
</LinearLayout>
</LinearLayout>
--- a/res/layout/contactlist_groupstub.xml Sun Feb 14 17:25:38 2010 +0100
+++ b/res/layout/contactlist_groupstub.xml Sat Dec 25 17:01:00 2010 +0100
@@ -4,7 +4,7 @@
android:layout_height="wrap_content">
<Gallery xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/contactlist_banner" android:layout_width="fill_parent"
- android:layout_height="42px" android:spacing="42px"
+ android:layout_height="40dp" android:spacing="25dp"
android:unselectedAlpha="0.4" android:background="#222222" />
<View android:layout_width="fill_parent" android:layout_height="2dp"
android:fadingEdge="horizontal" android:background="#555555" />
--- a/res/layout/contactlistcontact.xml Sun Feb 14 17:25:38 2010 +0100
+++ b/res/layout/contactlistcontact.xml Sat Dec 25 17:01:00 2010 +0100
@@ -1,20 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical" android:layout_width="fill_parent"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
android:layout_height="wrap_content" android:paddingLeft="10px"
android:paddingRight="10px" android:paddingTop="8dip"
android:paddingBottom="8dip" >
+ <ImageView android:id="@+id/avatar"
+ android:layout_width="48dip" android:layout_height="48dip"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true"
+ />
<TextView android:id="@+id/contactlistpseudo"
android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_alignParentTop="true"
+ android:layout_toRightOf="@id/avatar"
android:singleLine="true"
android:maxLines="1" android:textColor="@color/white"
android:drawablePadding="12px"
+ android:paddingLeft="10dip"
android:textSize="18sp" android:textStyle="bold" />
<TextView android:id="@+id/contactlistmsgperso"
android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_below="@id/contactlistpseudo"
+ android:layout_toRightOf="@id/avatar"
android:paddingLeft="30px" android:singleLine="true"
android:maxLines="1" android:linksClickable="false" android:autoLink="all"
android:scrollHorizontally="true" android:textColorLink="@color/white"
android:textSize="12sp" />
-</LinearLayout>
+</RelativeLayout>
--- a/res/layout/create_account.xml Sun Feb 14 17:25:38 2010 +0100
+++ b/res/layout/create_account.xml Sat Dec 25 17:01:00 2010 +0100
@@ -11,21 +11,24 @@
<EditText android:id="@+id/create_account_username"
android:inputType="textEmailAddress" android:imeOptions="actionNext"
android:layout_width="fill_parent" android:layout_height="wrap_content"
- android:singleLine="true" />
+ android:singleLine="true"
+ android:contentDescription="@string/create_account_username"/>
<TextView android:id="@+id/create_account_label_password"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:text="@string/create_account_password" style="@style/Label" />
<EditText android:id="@+id/create_account_password"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:inputType="textPassword" android:imeOptions="actionNext"
- android:password="true" android:singleLine="true" />
+ android:password="true" android:singleLine="true"
+ android:contentDescription="@string/create_account_password"/>
<TextView android:id="@+id/create_account_label_confirm_password"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:text="@string/create_account_confirm_password" style="@style/Label" />
<EditText android:id="@+id/create_account_confirm_password"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:inputType="textPassword" android:imeOptions="actionNext"
- android:password="true" android:singleLine="true" />
+ android:password="true" android:singleLine="true"
+ android:contentDescription="@string/create_account_confirm_password"/>
<View android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_marginBottom="18dp" />
<Button android:id="@+id/create_account_button"
--- a/res/layout/group_list.xml Sun Feb 14 17:25:38 2010 +0100
+++ b/res/layout/group_list.xml Sat Dec 25 17:01:00 2010 +0100
@@ -5,11 +5,12 @@
<ListView android:id="@android:id/list" android:layout_width="fill_parent"
android:layout_height="0dip" android:layout_weight="1"
- android:stackFromBottom="true" android:transcriptMode="normal" />
+ android:stackFromBottom="true" android:transcriptMode="normal"
+ android:focusable="true"/>
<EditText android:id="@+id/GroupListText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:maxLength="20"
android:singleLine="true" />
-</LinearLayout>
\ No newline at end of file
+</LinearLayout>
--- a/res/layout/login.xml Sun Feb 14 17:25:38 2010 +0100
+++ b/res/layout/login.xml Sat Dec 25 17:01:00 2010 +0100
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent" android:layout_height="fill_parent"
- android:orientation="vertical">
+ android:layout_width="fill_parent" android:layout_height="fill_parent" >
<LinearLayout android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="wrap_content">
<ImageView android:id="@+id/log_as_logo" android:src="@drawable/logo"
--- a/res/layout/login_anim.xml Sun Feb 14 17:25:38 2010 +0100
+++ b/res/layout/login_anim.xml Sat Dec 25 17:01:00 2010 +0100
@@ -3,8 +3,9 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent" android:layout_width="fill_parent"
android:orientation="vertical">
- <ImageView android:id="@+id/loginanim_logo_anim" android:src="@drawable/beem_launcher_icon_color"
- android:layout_height="fill_parent" android:layout_width="fill_parent"
+ <ImageView android:id="@+id/loginanim_logo_anim" android:src="@drawable/beem_icon_launcher_color"
+ android:layout_height="wrap_content" android:layout_width="wrap_content"
+ android:layout_gravity="center_vertical|center_horizontal|center"
android:layout_weight="1" />
<TextView android:id="@+id/loginanim_status_text"
android:layout_width="fill_parent" android:layout_height="wrap_content"
--- a/res/layout/preferences.xml Sun Feb 14 17:25:38 2010 +0100
+++ b/res/layout/preferences.xml Sat Dec 25 17:01:00 2010 +0100
@@ -1,4 +1,10 @@
<?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">
@@ -10,62 +16,71 @@
<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"
+ 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"
+ android:hint="@string/away_message_hint" />
+ </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" />
</PreferenceScreen>
</PreferenceCategory>
<PreferenceCategory android:title="@string/user_preferences">
<EditTextPreference android:singleLine="true"
android:summary="@string/SettingsText" android:title="@string/settings_account_username"
- android:key="settings_key_account_username"
- android:hint="@string/login_username_info_default" />
+ 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="settings_key_account_password" />
+ 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"
- 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_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" />
</PreferenceCategory>
-
<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"
- android:key="settings_key_proxy_use" />
+ android:key="proxy_use" />
<PreferenceCategory android:title="@string/proxy_proxy_settings">
- <ListPreference android:dependency="settings_key_proxy_use"
+ <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:key="settings_key_proxy_type" />
+ android:key="proxy_type" />
<EditTextPreference android:singleLine="true"
- android:dependency="settings_key_proxy_use" android:name="serveur"
+ android:dependency="proxy_use" android:name="serveur"
android:summary="@string/SettingsProxyServer" android:title="@string/settings_proxy_server"
- android:key="settings_key_proxy_server" />
+ android:key="proxy_server" />
<EditTextPreference android:singleLine="true"
- android:dependency="settings_key_proxy_use" android:name="port"
+ android:dependency="proxy_use" android:name="port"
android:summary="@string/SettingsProxyPort" android:title="@string/settings_proxy_port"
- android:key="settings_key_proxy_port"
- android:hint="@string/comments_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="settings_key_proxy_use" android:name="Utilisateur"
+ android:dependency="proxy_use" android:name="Utilisateur"
android:summary="@string/SettingsProxyUser" android:title="@string/settings_proxy_username"
- android:key="settings_key_proxy_username" />
+ android:key="proxy_username" />
<EditTextPreference android:singleLine="true"
- android:dependency="settings_key_proxy_use" android:name="pass_user"
+ android:dependency="proxy_use" android:name="pass_user"
android:password="true" android:summary="@string/SettingsProxyPassword"
- android:title="@string/settings_proxy_password" android:key="settings_key_proxy_password" />
+ android:title="@string/settings_proxy_password" android:key="proxy_password" />
</PreferenceCategory>
</PreferenceScreen>
<PreferenceScreen android:key="advanced"
@@ -84,13 +99,12 @@
<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"/>
+ 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:key="settings_key_xmpp_port"
- android:hint="@string/comments_xmpp_port"/>
+ android:defaultValue="5222" android:numeric="signed" android:key="settings_key_xmpp_port"
+ android:hint="@string/comments_xmpp_port" />
</PreferenceScreen>
</PreferenceCategory>
</PreferenceScreen>
--- a/res/layout/privacy_list.xml Sun Feb 14 17:25:38 2010 +0100
+++ b/res/layout/privacy_list.xml Sat Dec 25 17:01:00 2010 +0100
@@ -4,7 +4,9 @@
android:layout_height="fill_parent" android:padding="8dp">
<ListView android:id="@id/android:list" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_weight="1"
- android:drawSelectorOnTop="false" />
+ android:drawSelectorOnTop="false"
+ android:focusable="true"/>
<TextView android:id="@id/android:empty" android:layout_width="fill_parent"
- android:layout_height="fill_parent" android:text="@string/privacy_list_no_data" />
+ android:layout_height="fill_parent" android:text="@string/privacy_list_no_data"
+ android:focusable="true"/>
</LinearLayout>
--- a/res/layout/privacy_list_create_dialog.xml Sun Feb 14 17:25:38 2010 +0100
+++ b/res/layout/privacy_list_create_dialog.xml Sat Dec 25 17:01:00 2010 +0100
@@ -10,5 +10,6 @@
android:layout_height="wrap_content" android:layout_width="fill_parent"
android:layout_marginLeft="20dip" android:layout_marginRight="20dip"
android:scrollHorizontally="true" android:autoText="false"
- android:capitalize="none" android:gravity="fill_horizontal" />
+ android:capitalize="none" android:gravity="fill_horizontal"
+ android:contentDescription="@string/privacy_list_create_dialog_list_name_label"/>
</LinearLayout>
--- a/res/layout/subscription.xml Sun Feb 14 17:25:38 2010 +0100
+++ b/res/layout/subscription.xml Sat Dec 25 17:01:00 2010 +0100
@@ -16,7 +16,8 @@
android:layout_height="fill_parent" android:autoLink="none"
android:id="@+id/SubscriptionText" android:text="@string/SubscriptText"
android:textColor="@color/white" android:textSize="14sp"
- android:layout_weight="1" android:layout_marginBottom="18dp" />
+ android:layout_weight="1" android:layout_marginBottom="18dp"
+ android:focusable="true"/>
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent" android:layout_height="wrap_content">
@@ -30,4 +31,4 @@
android:layout_weight="1" android:text="@string/RefuseButton" />
</LinearLayout>
</LinearLayout>
-</ScrollView>
\ No newline at end of file
+</ScrollView>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/layout/wizard_account.xml Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_height="fill_parent" android:layout_width="fill_parent"
+ android:orientation="vertical"
+ >
+ <ScrollView android:layout_height="fill_parent" android:layout_width="fill_parent"
+ android:layout_weight="1">
+ <LinearLayout android:layout_height="wrap_content" android:layout_width="fill_parent"
+ android:orientation="vertical" >
+ <ImageView android:id="@+id/logo"
+ android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_marginTop="15dp"
+ android:layout_marginBottom="30dp"
+ android:src="@drawable/logo"/>
+ <TextView
+ android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:text="@string/account_wizard_text1"
+ android:textSize="18sp"
+ android:paddingBottom="10dip"
+ android:focusable="true" />
+ <RadioGroup android:id="@+id/configure_group"
+ android:layout_width="fill_parent" android:layout_height="wrap_content" >
+ <RadioButton android:id="@+id/configure_account"
+ android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:text="@string/account_wizard_configure_account"/>
+ <RadioButton android:id="@+id/create_account"
+ android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:text="@string/account_wizard_create_account"/>
+ </RadioGroup>
+ </LinearLayout>
+ </ScrollView>
+
+ <RelativeLayout
+ android:layout_alignParentBottom="true"
+ android:gravity="right|center_vertical"
+ android:layout_height="wrap_content"
+ android:layout_width="fill_parent"
+ android:background="@drawable/bottombar" >
+ <Button
+ android:id="@+id/next"
+ android:text="@string/Continue"
+ android:minWidth="100dp"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:drawableRight="@drawable/button_indicator_next"
+ android:layout_alignParentRight="true"
+ android:layout_centerVertical="true"
+ android:enabled="false"
+ />
+ </RelativeLayout>
+
+</LinearLayout>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/layout/wizard_account_configure.xml Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_height="fill_parent" android:layout_width="fill_parent"
+ android:orientation="vertical" >
+ <ScrollView android:layout_height="fill_parent" android:layout_width="fill_parent"
+ android:layout_weight="1">
+ <LinearLayout android:layout_height="wrap_content" android:layout_width="fill_parent"
+ android:orientation="vertical" >
+ <ImageView android:id="@+id/logo"
+ android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_marginTop="15dp"
+ android:layout_marginBottom="30dp"
+ android:src="@drawable/logo"/>
+ <TextView
+ android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_alignParentTop="true"
+ android:text="@string/account_wizard_configure_text"
+ android:textSize="18sp"
+ android:paddingBottom="10dip" />
+ <TextView
+ android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:text="@string/JabberID" style="@style/Label" />
+ <EditText android:id="@+id/account_username"
+ android:inputType="textEmailAddress" android:imeOptions="actionNext"
+ android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:singleLine="true"
+ android:hint="beem@beem-project.com "
+ android:contentDescription="@string/JabberID"/>
+ <TextView
+ android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:text="@string/Password" style="@style/Label" />
+ <EditText android:id="@+id/account_password"
+ android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:inputType="textPassword" android:imeOptions="actionNext"
+ android:password="true" android:singleLine="true"
+ android:contentDescription="@string/Password"/>
+ </LinearLayout>
+ </ScrollView>
+
+ <RelativeLayout
+ android:layout_alignParentBottom="true"
+ android:gravity="right"
+ android:layout_height="wrap_content"
+ android:layout_width="fill_parent"
+ android:background="@drawable/bottombar" >
+
+ <Button
+ android:id="@+id/manual_setup"
+ android:text="@string/AccountConfigureManualConfiguration"
+ android:minWidth="100dp"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_centerVertical="true"
+ />
+
+ <Button
+ android:id="@+id/next"
+ android:text="@string/Continue"
+ android:minWidth="100dp"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:drawableRight="@drawable/button_indicator_next"
+ android:layout_alignParentRight="true"
+ android:layout_centerVertical="true"
+ android:enabled="false"
+ />
+ </RelativeLayout>
+
+</LinearLayout>
--- a/res/menu/contact_list.xml Sun Feb 14 17:25:38 2010 +0100
+++ b/res/menu/contact_list.xml Sat Dec 25 17:01:00 2010 +0100
@@ -2,9 +2,19 @@
<item android:id="@+id/contact_list_menu_add_contact"
android:visible="true"
android:title="@string/contact_list_menu_add_contact"
- android:icon="@android:drawable/ic_menu_add" />
+ android:icon="@drawable/ic_menu_add" />
+ <item android:id="@+id/menu_change_status"
+ android:visible="true"
+ android:title="@string/contact_list_menu_status"/>
+ <item android:id="@+id/contact_list_menu_chatlist"
+ android:visible="true" android:icon="@drawable/ic_menu_chat_dashboard"
+ android:title="@string/chat_menu_change_chat"/>
<item android:id="@+id/contact_list_menu_settings"
android:visible="true"
android:title="@string/contact_list_menu_settings"
- android:icon="@android:drawable/ic_menu_manage" />
+ android:icon="@drawable/ic_menu_manage" />
+ <item android:id="@+id/menu_disconnect"
+ android:visible="true"
+ android:title="@string/contact_list_menu_disconnect"
+ android:icon="@drawable/ic_menu_close_clear_cancel" />
</menu>
--- a/res/menu/contactlist_context.xml Sun Feb 14 17:25:38 2010 +0100
+++ b/res/menu/contactlist_context.xml Sat Dec 25 17:01:00 2010 +0100
@@ -1,6 +1,9 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/contact_list_context_menu_chat_item"
- android:title="@string/CDChat" />
+ android:title="@string/CDChat">
+ <menu>
+ </menu>
+ </item>
<item android:id="@+id/contact_list_context_menu_call_item"
android:title="@string/CDCall" android:visible="true" />
<item android:id="@+id/contact_list_context_menu_user_info"
@@ -13,7 +16,7 @@
<item android:id="@+id/contact_list_context_menu_userinfo_subscription"
android:title="@string/userinfo_label_re_subscription" />
<item android:id="@+id/contact_list_context_menu_userinfo_block"
- android:title="@string/userinfo_label_block" android:visible="false"/>
+ android:title="@string/userinfo_label_block" android:visible="false" />
<item android:id="@+id/contact_list_context_menu_userinfo_delete"
android:title="@string/userinfo_label_delete" />
</menu>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/values-de/strings.xml Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,298 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Generic terms -->
+ <string name="app_name">Beem</string>
+ <string name="OkButton">Ok</string>
+ <string name="ClearButton">Löschen</string>
+ <string name="CancelButton">Abbrechen</string>
+ <string name="AcceptButton">Authorisieren</string>
+ <string name="RefuseButton">Ablehnen</string>
+ <string name="Password">Passwort</string>
+
+ <!-- Beem class -->
+ <string name="BeemJabberID">Jabber ID</string>
+
+ <!-- BeemApplication class -->
+ <string name="BeemApplicationConnect">Verbinden...</string>
+
+ <!-- BeemService class -->
+ <string name="BeemServiceDescription">Benutze Beem Service</string>
+ <string name="BeemServiceCreated">Beem Service erstellt</string>
+ <string name="BeemServiceDestroyed">Beem Service verworfen</string>
+
+ <!-- ContactDialog class -->
+ <string name="CDChat">Chatten</string>
+ <string name="CDCall">Anrufen</string>
+ <string name="CDInfos">Kontakt bearbeiten</string>
+
+ <!-- AddContact class -->
+ <string name="AddCActTitle">Beem - Kontakt hinzufügen</string>
+
+ <string name="AddCLogin">Benutzername</string>
+ <string name="AddCAlias">Alias</string>
+ <string name="AddCGroup">Gruppe</string>
+ <string name="AddCOkButton">Hinzufügen</string>
+ <string name="AddCContactAdded">Kontakt hinzugefügt</string>
+ <string name="AddCContactAddedError">Fehler, Benutzer nicht hinzugefügt</string>
+ <string name="AddCContactAddedLoginError">Fehler bei der Anmeldung</string>
+ <string name="AddCBadForm">Mangelhafte Form</string>
+ <string name="AddCContactAlready">Kontakt existiert bereits</string>
+
+ <!-- ChangeStatus class -->
+ <string name="ChangeStatusActTitle">Beem - Meinen Status ändern</string>
+ <string name="ChangeStatusType">Mein Status</string>
+ <string name="ChangeStatusMessage">Meine persönliche Nachricht</string>
+ <string name="OpenContactList">Kontaktliste öffnen</string>
+
+ <string name="MenuAddContact">Kontakt hinzufügen</string>
+ <string name="MenuAccountAbout">Beem Project</string>
+ <string name="MenuAccountCreate">Konto erstellen</string>
+ <string name="MenuConnection">Konto bearbeiten</string>
+ <string name="ChangeStatusOk">Aktualisiere Status</string>
+ <string name="ChangeStatusNoChange">Nichts zu ändern</string>
+
+ <!-- Settings class -->
+ <string name="SettingsText">Benutzername bearbeiten</string>
+ <string name="SettingsPassword">Passwort bearbeiten</string>
+ <string name="SettingsProxy">Proxy</string>
+ <string name="SettingsProxyProxy">Benutze einen Proxyserver</string>
+ <string name="SettingsProxySummary">Anmeldung über einen Proxyserver</string>
+ <string name="SettingsProxyType">Protokoll</string>
+ <string name="SettingsProxyTypeSummary">Art des Proxyservers wählen</string>
+ <string name="SettingsProxyServer">Adresse des Proxyservers bearbeiten</string>
+ <string name="SettingsProxyPort">Port des Proxyservers bearbeiten</string>
+ <string name="SettingsProxyUser">Optional, erlaubt das Authentifizieren mit dem Proxyserver</string>
+ <string name="SettingsProxyPassword">Optional, erlaubt das Authentifizieren mit dem Proxyserver</string>
+ <string name="SettingsAdvanced">Erweitert</string>
+ <string name="SettingsAdvancedOptions">Spezifische Server Optionen</string>
+ <string name="SettingsAdvancedRecoDelay">Bearbeite die Verzögerung bei der Wiederverbindung</string>
+ <string name="SettingsAdvancedSpecOpt">Aktivieren, um einen spezifischen Server für die Verbindung zu benutzen</string>
+ <string name="SettingsAdvancedAddOpt">Adresse des Servers bearbeiten</string>
+ <string name="SettingsAdvancedPortOpt">Port des Servers bearbeiten</string>
+ <string name="SettingsResourceTitle">Ressource</string>
+ <string name="SettingsPriorityTitle">Priorität</string>
+ <string name="SettingsResourceSummary">XMPP Ressource des Clients einstellen</string>
+ <string name="SettingsPrioritySummary">Priorität des Clients einstellen</string>
+ <string name="contact_list_preferences">Kontaktliste</string>
+ <string name="contact_list_preferences_sum">Anzeigeoptionen der Kontaktliste</string>
+ <string name="CLP_hide_groups">Gruppen verstecken</string>
+ <string name="CLP_hide_groups_sum">Aktivieren, um Gruppen zu verstecken</string>
+ <string name="CLP_hidden_contact">Kontakte verstecken</string>
+ <string name="CLP_hidden_contact_sum">Aktivieren, um Kontakte zu verstecken, die offline sind</string>
+ <string name="settings_account_username">Benutzername</string>
+ <string name="login_username_info_default">beem@beem-project.com</string>
+ <string name="settings_account_password">Passwort</string>
+ <string name="settings_account_server">Server</string>
+ <string name="settings_account_port">Port</string>
+ <string name="settings_advanced_service_behaviour">Verhalten des Dienstes</string>
+ <string name="settings_advanced_sum">Erweiterte Einstellungen für fortgeschrittene Benutzer</string>
+ <string name="settings_xmpp_server">Adresse</string>
+ <string name="comments_xmpp_server">example.com</string>
+ <string name="settings_xmpp_port">Port</string>
+ <string name="settings_xmpp_use_tls">Verwende SSL/TLS</string>
+ <string name="settings_reco_delay">Verzögerung bei der Wiederverbindung</string>
+ <string name="comments_xmpp_port">Standard: 5222</string>
+ <string name="settings_proxy_sum">Einstellungen für das Benutzen eines Proxyservers</string>
+ <string name="settings_proxy_use">Benutze einen Proxyserver</string>
+ <string name="settings_proxy_type_prompt">Art des Proxyservers wählen</string>
+ <string name="settings_proxy_server">Server</string>
+ <string name="settings_proxy_port">Port</string>
+ <string name="comments_proxy_port">Standard: 1080</string>
+ <string name="settings_proxy_username">Benutzername</string>
+ <string name="settings_proxy_password">Passwort</string>
+ <string name="away_chk_title">Aktiviere automatische Abwesenheit</string>
+ <string name="away_chk_sum">Status auf Abwesend wenn Bildschirm ausgeschaltet ist</string>
+ <string name="away_message_title">Abwesenheitsnachricht</string>
+ <string name="away_message_sum">Angezeigte Abwesenheitsnachricht</string>
+ <string name="away_message_hint">Ich bin abwesend, mein Telefonbildschirm ist ausgeschaltet</string>
+ <string name="notification_preferences">Benachrichtigungseinstellungen</string>
+ <string name="notification_enable_vibrate_title">Vibrieren</string>
+ <string name="notification_enable_vibrate_sum">Vibriere bei eingehenden Nachrichten</string>
+ <string name="notification_snd_title">Nachrichtensignalton</string>
+ <string name="notification_snd_sum">Lege den Signalton für eingehende Nachrichten fest</string>
+
+
+ <!-- Subscription class -->
+ <string name="SubscriptAccept">Zustimmung angenommen</string>
+ <string name="SubscriptError">Zustimmungsfehler</string>
+ <string name="SubscriptRefused">Zustimmung abgelehnt</string>
+ <string name="SubscriptText">%s will dich zu seiner/ihrer Kontaktliste hinzufügen. Willst du ihn/sie authorisieren ?</string>
+ <string name="SubscriptTitle">Kontakt authorisieren ?</string>
+
+ <!-- BeemChatManager -->
+ <string name="BeemChatManagerNewMessage">Du hast eine neue Nachricht</string>
+
+ <!-- BeemBroadcastReceiver class -->
+ <string name="BeemBroadcastReceiverDisconnect">BEEM: Die Verbindung wurde getrennt</string>
+
+ <!-- XmppConnectionAdapter class -->
+ <string name="AcceptContactRequest">%s hat dich gerade zu seiner/ihrer Kontaktliste hinzugefügt.</string>
+ <string name="AcceptContactRequestFrom">Authorisiere %s dich zu kontaktieren.</string>
+
+ <!-- Activities -->
+ <string name="login_tag">Beem - Anmeldung</string>
+ <string name="edit_settings_name">Beem - Einstellungen</string>
+ <string name="edit_settings_tag">Beem - Einstellungen bearbeiten</string>
+ <string name="create_account_name">Beem - Konto erstellen</string>
+ <string name="create_account_tag">Beem - Konto erstellen</string>
+ <string name="contact_list_name">Beem - Kontakte</string>
+ <string name="contact_list_tag">Beem - Kontaktliste</string>
+ <string name="user_info_name">Beem - Benutzerinformation</string>
+
+ <!-- Buttons -->
+ <string name="button_create_account">Dieses Konto erstellen</string>
+ <string name="button_create_login_account">Dieses Konto erstellen und benutzen</string>
+
+ <!-- LogAs Activity -->
+ <string name="login_username">Benutzername</string>
+ <string name="login_password">Passwort</string>
+ <string name="login_error_dialog_title">Anmeldung - Fehler</string>
+ <string name="login_close_dialog_button">Schließen</string>
+ <string name="login_menu_create_account">Konto erstellen</string>
+ <string name="login_menu_settings">Einstellungen</string>
+ <string name="login_menu_about">Über</string>
+ <string name="login_about_title">Beem %s - Über</string>
+ <string name="login_about_msg">Beem ist ein EPITECH Innovative Project. Besuche uns auf http://www.beem-project.com !</string>
+ <string name="login_about_button">Schließen</string>
+ <string name="login_settings_button">Einstellungen</string>
+ <string name="login_login_button">Anmelden</string>
+ <string name="login_login_progress">Verbinden. Bitte warten...</string>
+ <string name="login_error_msg">Leider trat ein Fehler auf.\n\nFehler Detail:\n%s</string>
+ <string name="login_menu_login">Anmelden</string>
+ <string name="login_no_connectivity">Keine Internetverbindung gefunden</string>
+ <string name="login_start_msg">Konfiguration der Einstellungen im Menü</string>
+
+ <!-- LoginAnim activity -->
+ <string name="loganim_connecting">Verbinden ...</string>
+ <string name="loganim_authenticating">Authentifizieren ...</string>
+ <string name="loganim_login_success">Erfolgreich angemeldet</string>
+ <string name="loganim_login_failed">Anmeldung gescheitert</string>
+
+ <!-- EditSettings Activity -->
+ <string name="settings_menu_create_account">Konto erstellen</string>
+ <string name="settings_menu_privacy_lists">Meine Privatsphärenliste verwalten</string>
+ <string name="settings_saved_ok">Die Einstellungen wurden erfolgreich gespeichert.</string>
+
+
+
+ <!-- EditSettings Activity Categories -->
+ <string name="general_preferences">Allgemeine Einstellungen</string>
+ <string name="user_preferences">Benutzereinstellungen (notwendig)</string>
+ <string name="user_preferences_advanced">Zusätzliche Benutzereinstellungen (optional)</string>
+ <string name="network_preferences">Netzwerk Einstellungen</string>
+ <string name="proxy_proxy_settings">Proxy Einstellungen</string>
+ <string name="proxy_user_settings">Proxy Einstellungen</string>
+
+ <!-- EditSettings Activity Tabs -->
+ <string name="settings_tab_tag_account">edit_settings_tab_account</string>
+ <string name="settings_tab_label_account">Konto</string>
+ <string name="settings_tab_tag_xmpp">edit_settings_tab_xmpp</string>
+ <string name="settings_tab_label_xmpp">XMPP</string>
+ <string name="settings_tab_tag_proxy">edit_settings_tab_proxy</string>
+ <string name="settings_tab_label_proxy">Proxy</string>
+
+
+ <!-- wizard activities -->
+ <string name="account_wizard_text1"><b>Willkommen bei BEEM.</b>\n\nDu hast noch kein XMPPP (Jabber) Konto konfiguriert.\nWähle eine der folgenden Optionen :</string>
+ <string name="account_wizard_configure_text"><b>Bitte gib die Daten deines bestehenden Kontos ein</b></string>
+ <string name="account_wizard_configure_account">Ich habe bereits ein Konto, das ich benutzen möchte</string>
+ <string name="account_wizard_create_account">Ich möchte ein neues Konto registrieren</string>
+
+ <!-- Create an account Activity -->
+ <string name="create_account_instr_dialog_title">Konto erstellen - Anweisungen</string>
+ <string name="create_account_err_dialog_title">Konto erstellen - Fehler</string>
+ <string name="create_account_err_dialog_settings_button">Einstellungen ändern</string>
+ <string name="create_account_close_dialog_button">Schließen</string>
+ <string name="create_account_successfull_after">Das Konto %s wurde erfolgreich erstellt</string>
+ <string name="create_account_err_username">Mangelhafte Jabber ID</string>
+ <string name="create_account_err_passwords">Passwörter stimmen nicht überein.</string>
+ <string name="create_account_username">Benutzername</string>
+ <string name="create_account_password">Passwort</string>
+ <string name="create_account_confirm_password">Passwort bestätigen</string>
+
+ <!-- ContactList Activity -->
+ <string name="contact_list_menu_add_contact">Kontakt hinzufügen</string>
+ <string name="contact_list_menu_status">Status ändern</string>
+ <string name="contact_list_menu_settings">Einstellungen</string>
+ <string name="contact_list_menu_disconnect">Verbindung trennen</string>
+ <string name="contact_list_all_contact">Alle Kontakte</string>
+ <string name="contact_list_no_group">Keine Gruppe</string>
+
+ <!-- UserInfo dialog -->
+ <string name="userinfo_label_alias">Alias</string>
+ <string name="userinfo_label_chg_group">Gruppen verwalten</string>
+ <string name="userinfo_label_re_subscription">Einladung erneut senden</string>
+ <string name="userinfo_label_block">Blockieren</string>
+ <string name="userinfo_label_delete">Löschen</string>
+ <string name="userinfo_resend">Zustimmung erneut senden</string>
+ <string name="userinfo_sure2delete">Bist du sicher, dass du diesen Kontakt löschen willst ?</string>
+ <string name="userinfo_yes">Ja</string>
+ <string name="userinfo_no">Nein</string>
+ <string name="userinfo_sureresend">Bist du sicher, dass du die Einladung erneut senden willst ?</string>
+
+ <string name="chat_name">Beem - Chat</string>
+ <string name="chat_input_default_value">Nachricht eingeben</string>
+ <string name="chat_self">Ich</string>
+ <string name="chat_error">Fehler</string>
+ <string name="chat_send_message">Senden</string>
+ <string name="chat_menu_contacts_list">Kontaktliste</string>
+ <string name="chat_menu_change_chat">Chat wechseln</string>
+ <string name="chat_dialog_change_chat_title">Offene Chats</string>
+ <string name="chat_menu_close_chat">Diesen Chat schließen</string>
+ <string name="chat_no_more_chats">Keine weiteren aktiven Chats</string>
+ <string name="chat_state_composing">schreibt gerade</string>
+ <string name="chat_state_gone">hat die Unterhaltung verlassen</string>
+ <string name="chat_state_active">verfolgt die Unterhaltung</string>
+ <string name="chat_state_inactive">macht etwas anderes</string>
+
+ <string name="contact_status_msg_available">Online</string>
+ <string name="contact_status_msg_available_chat">Bereit zum Chatten</string>
+ <string name="contact_status_msg_dnd">Beschäftigt</string>
+ <string name="contact_status_msg_away">Abwesend</string>
+ <string name="contact_status_msg_xa">N/A</string>
+ <string name="contact_status_msg_offline">Offline</string>
+
+ <string name="privacy_list_name">Beem - Meine Privatsphärenliste verwalten</string>
+ <string name="privacy_list_no_data">Keine Privatsphärenliste vorhanden.</string>
+ <string name="privacy_list_menu_create">Privatsphärenliste erstellen</string>
+ <string name="privacy_list_create_dialog_title">Privatsphärenliste erstellen</string>
+ <string name="privacy_list_create_dialog_list_name_label">Titel</string>
+ <string name="privacy_list_create_dialog_create_button">Erstellen</string>
+ <string name="privacy_list_select_dialog_buddies">Kontakte</string>
+ <string name="privacy_list_select_dialog_groups">Gruppen</string>
+ <string name="privacy_list_select_dialog_delete">Löschen</string>
+ <string name="privacy_list_delete_dialog_msg">Bist du sicher, dass du die Privatsphärenliste mit dem Titel \'%s\' löschen willst ?</string>
+ <string name="privacy_list_delete_dialog_yes">Ja</string>
+ <string name="privacy_list_delete_dialog_no">Nein</string>
+
+ <string name="UpdateButton">Aktualisierung</string>
+
+ <!-- Error messages -->
+
+ <string name="error_login_authentication">Ein Fehler ist während der Authentifizierung aufgetreten: mangelhafter Benutzer oder Passwort.</string>
+
+ <string name="interna_server_error">Remoteserver Fehler</string>
+ <string name="bad_request">Mangelhafte Anfrage</string>
+ <string name="forbidden">Verboten</string>
+ <string name="item_not_found">Eintrag nicht gefunden</string>
+ <string name="conflict">Konflikt</string>
+ <string name="feature_not_implemented">Feature nicht vorhanden</string>
+ <string name="gone">verloren</string>
+ <string name="jid_malformed">JID mangelhaft</string>
+ <string name="no_acceptable">nicht akzeptabel</string>
+ <string name="not_allowed">nicht erlaubt</string>
+ <string name="not_authorized">nicht authorisiert</string>
+ <string name="payment_required">Bezahlung erforderlich</string>
+ <string name="recipient_unavailable">Empfänger unerreichbar</string>
+ <string name="redirect">weiterleiten</string>
+ <string name="registration_required">Anmeldung wird benötigt</string>
+ <string name="remote_server_not_found">Remoteserver nicht gefunden</string>
+ <string name="remote_server_timeout">Keine Antwort vom Server</string>
+ <string name="remote_server_error">Remoteserver Fehler</string>
+ <string name="resource_constraint">Ressourceneinschränkung</string>
+ <string name="service_unavailable">Dienst unerreichbar</string>
+ <string name="subscription_required">Zustimmung wird benötigt</string>
+ <string name="undefined_condition">Undefinierte Bedingung</string>
+ <string name="unexpected_condition">Unerwartete Bedingung</string>
+ <string name="request_timeout">Zeitüberschreitung bei der Anfrage</string>
+</resources>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/values-es/strings.xml Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,310 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+<!-- Generic terms -->
+<string name="app_name">Beem</string>
+<string name="OkButton">Aceptar</string>
+<string name="ClearButton">Limpiar</string>
+<string name="CancelButton">Cancelar</string>
+<string name="AcceptButton">Autorizar</string>
+<string name="RefuseButton">Denegar</string>
+<string name="JabberID">JabberID</string>
+<string name="Password">Contraseña</string>
+<string name="Continue">Continuar</string>
+
+<!-- AccountConfigure class -->
+<string name="AccountConfigureManualConfiguration">Configuración manual</string>
+
+<!-- Beem class -->
+<string name="BeemJabberID">JabberID</string>
+
+<!-- BeemApplication class -->
+<string name="BeemApplicationConnect">Conectando...</string>
+
+<!-- BeemService class -->
+<string name="BeemServiceDescription">Usa el servicio Beem</string>
+<string name="BeemServiceCreated">Servicio Beem creado</string>
+<string name="BeemServiceDestroyed">Servicio Beem suprimido</string>
+
+<!-- ContactDialog class -->
+<string name="CDChat">Chat</string>
+<string name="CDCall">Llamada</string>
+<string name="CDInfos">Gestión de usuario</string>
+
+<!-- AddContact class -->
+<string name="AddCActTitle">Beem - Añadir contacto</string>
+
+<string name="AddCLogin">Usuario</string>
+<string name="AddCAlias">Alias</string>
+<string name="AddCGroup">Grupo</string>
+<string name="AddCOkButton">Añadir</string>
+<string name="AddCContactAdded">Contacto añadido</string>
+<string name="AddCContactAddedError">Error añadiendo contacto</string>
+<string name="AddCContactAddedLoginError">Error en el login</string>
+<string name="AddCBadForm">Formulario incorrecto</string>
+<string name="AddCContactAlready">Contacto ya existe</string>
+
+<!-- ChangeStatus class -->
+<string name="ChangeStatusActTitle">Beem - Cambiar mi estado</string>
+<string name="ChangeStatusType">Mi estado</string>
+<string name="ChangeStatusMessage">Mi mensaje personal</string>
+<string name="OpenContactList">Abrir lista de contactos</string>
+
+<string name="MenuAddContact">Añadir contacto</string>
+<string name="MenuAccountAbout">Proyecto Beem</string>
+<string name="MenuAccountCreate">Crear cuenta</string>
+<string name="MenuConnection">Editar cuenta</string>
+<string name="ChangeStatusOk">Actualizando estado</string>
+<string name="ChangeStatusNoChange">Nada que cambiar</string>
+
+<!-- Settings class -->
+<string name="SettingsText">Editar su usuario</string>
+<string name="SettingsPassword">Editar su contraseña</string>
+<string name="SettingsProxy">Proxy</string>
+<string name="SettingsProxyProxy">Usar un servidor proxy</string>
+<string name="SettingsProxySummary">Iniciar a traves de un servidor proxy</string>
+<string name="SettingsProxyType">Protocolo</string>
+<string name="SettingsProxyTypeSummary">Escoja el tipo de servidor proxy</string>
+<string name="SettingsProxyServer">Editar direccion del servidor proxy</string>
+<string name="SettingsProxyPort">Editar puerto del servidor proxy</string>
+<string name="SettingsProxyUser">Opcional, permitir auto-autentificarse en el server proxy.</string>
+<string name="SettingsProxyPassword">Opcional, permitir auto-autentificarse en el server proxy.</string>
+<string name="SettingsAdvanced">Avanzado</string>
+<string name="SettingsAdvancedOptions">Opciones especificas del server</string>
+<string name="SettingsAdvancedRecoDelay">Modificar retraso de conexion</string>
+<string name="SettingsAdvancedSpecOpt">Marca esta casilla si deseas usar un servidor especifico para esta conexion</string>
+<string name="SettingsAdvancedAddOpt">Editar direccion del server</string>
+<string name="SettingsAdvancedPortOpt">Editar puerto del server</string>
+<string name="SettingsResourceTitle">Recurso</string>
+<string name="SettingsPriorityTitle">Prioridad</string>
+<string name="SettingsResourceSummary">Establecer recursosXMPP</string>
+<string name="SettingsPrioritySummary">Establecer prioridades</string>
+<string name="contact_list_preferences">Lista de Amigos</string>
+<string name="contact_list_preferences_sum">A set of display options for your buddy list
+</string>
+<string name="CLP_hide_groups">Ocultar grupos</string>
+<string name="CLP_hide_groups_sum">Opciones de ocultar grupos</string>
+<string name="CLP_hidden_contact">Ocultar amigos</string>
+<string name="CLP_hidden_contact_sum">Check this option to hide unconnected buddies
+</string>
+<string name="settings_account_username">Nombre de usuario</string>
+<string name="login_username_info_default">beem@beem-project.com</string>
+<string name="settings_account_password">Contraseña</string>
+<string name="settings_account_server">Servidor</string>
+<string name="settings_account_port">Puerto</string>
+<string name="settings_advanced_service_behaviour">Servicio de comportamiento</string>
+<string name="settings_advanced_sum">Opciones de usuarios abanzados</string>
+<string name="settings_xmpp_server">Dirección del servidor XMPP</string>
+<string name="comments_xmpp_server">Comentgarios del servidor XMPP</string>
+<string name="settings_xmpp_port">Puerto XMPP</string>
+<string name="settings_xmpp_use_tls">Establecer SSL/TTL en XMPP</string>
+<string name="settings_reco_delay">Tiempo de reconexión</string>
+<string name="comments_xmpp_port">Puerto por defecto: 5222</string>
+<string name="settings_proxy_sum">Establecer uso de servidor Proxy</string>
+<string name="settings_proxy_use">Conectar mediante servidor proxy</string>
+<string name="settings_proxy_type_prompt">Seleccionar tipo de servidor proxy</string>
+<string name="settings_proxy_server">Servidor proxy</string>
+<string name="settings_proxy_port">Puerto proxy</string>
+<string name="comments_proxy_port">Puerto proxy por defecto 1080</string>
+<string name="settings_proxy_username">Nombre de usuario proxy</string>
+<string name="settings_proxy_password">Contraseña de usuario proxy</string>
+<string name="away_chk_title">Habilitar auto-ausente</string>
+<string name="away_chk_sum">Cambiar estado a ausente cuando la pantalla se apage</string>
+<string name="away_message_title">Mensaje ausente</string>
+<string name="away_message_sum">El mensaje de ausente que sera mostrado</string>
+<string name="away_message_hint">Ausente, my pantalla esta apagada</string>
+<string name="notification_preferences">Configuracion de notificaciones</string>
+<string name="notification_enable_vibrate_title">Habilitar vibracion</string>
+<string name="notification_enable_vibrate_sum">Habilitar vibracion en mensajes entrantes</string>
+<string name="notification_snd_title">Tono de mensaje entrante</string>
+<string name="notification_snd_sum">Configurar tono de mensaje entrante</string>
+
+
+<!-- Subscription class -->
+<string name="SubscriptAccept">Suscripcion aceptada</string>
+<string name="SubscriptError">Error de suscripcion</string>
+<string name="SubscriptRefused">Suscripcion rechazada</string>
+<string name="SubscriptText">%s desea agregarlo a su lista de contactos. Desea autorizarlo/a ?</string>
+<string name="SubscriptTitle">Autorizar contacto ?</string>
+
+<!-- BeemChatManager -->
+<string name="BeemChatManagerNewMessage">Tienes un nuevo mensaje</string>
+
+<!-- BeemBroadcastReceiver class -->
+<string name="BeemBroadcastReceiverDisconnect">BEEM: Ha sido desconectado</string>
+
+<!-- XmppConnectionAdapter class -->
+<string name="AcceptContactRequest">%s le agrego en su lista de contactos.</string>
+<string name="AcceptContactRequestFrom">Autoriza %s para que lo contacte.</string>
+
+<!-- Activities -->
+<string name="login_tag">Beem - Actividad inicio</string>
+<string name="edit_settings_name">Beem - Configuracion</string>
+<string name="edit_settings_tag">Beem - Actividad editar configuracion</string>
+<string name="create_account_name">Beem - Crear una cuenta</string>
+<string name="create_account_tag"></string>
+<string name="contact_list_name">Beem - Contactos</string>
+<string name="contact_list_tag">Beem - Actividad lista contactos</string>
+<string name="user_info_name">Beem - Informacion usuario</string>
+
+<!-- Buttons -->
+<string name="button_create_account">Crear esta cuenta</string>
+<string name="button_create_login_account">Crear y usar esta cuenta</string>
+
+<!-- LogAs Activity -->
+<string name="login_username">Usuario</string>
+<string name="login_password">Contraseña</string>
+<string name="login_error_dialog_title">Inicio sesion - Error</string>
+<string name="login_close_dialog_button">Cerrar</string>
+<string name="login_menu_create_account">Crear una cuenta</string>
+<string name="login_menu_settings">Configuracion</string>
+<string name="login_menu_about">Acerca</string>
+<string name="login_about_title">Beem %s - Acerca</string>
+<string name="login_about_msg">
+Beem is an EPITECH Innovative Project. Visit us at
+http://www.beem-project.com !
+</string>
+<string name="login_about_button">Cerrar</string>
+<string name="login_settings_button">Configuracion</string>
+<string name="login_login_button">Inicio</string>
+<string name="login_login_progress">Conectando. Espere por favor ...</string>
+<string name="login_error_msg">Unfortunately, an error occured.\n\nError
+detail:\n%s</string>
+<string name="login_menu_login">Iniciar sesion</string>
+<string name="login_no_connectivity">No se detecto conexion a internet</string>
+<string name="login_start_msg">Configuracion de parametros en menu</string>
+
+<!-- LoginAnim activity -->
+<string name="loganim_connecting">Conectando ...</string>
+<string name="loganim_authenticating">Autentificando ...</string>
+<string name="loganim_login_success">Inicio correcto</string>
+<string name="loganim_login_failed">Inicio fallido</string>
+
+<!-- EditSettings Activity -->
+<string name="settings_menu_create_account">Crear una cuenta</string>
+<string name="settings_menu_privacy_lists">Administrar mis listas de privacidad</string>
+<string name="settings_saved_ok">Los cambios han sido guardados correctamente.</string>
+
+
+
+<!-- EditSettings Activity Categories -->
+<string name="general_preferences">Preferencias generales</string>
+<string name="user_preferences">Configuracion de usuario (requerido)</string>
+<string name="user_preferences_advanced">Configuracion avanzada de usuario (opcional)</string>
+<string name="network_preferences">Opciones de red</string>
+<string name="proxy_proxy_settings">Configuracion Proxy</string>
+<string name="proxy_user_settings">Configuracion Proxy</string>
+
+<!-- EditSettings Activity Tabs -->
+<string name="settings_tab_tag_account">editar_configuracion_pestaña_cuenta</string>
+<string name="settings_tab_label_account">Cuenta</string>
+<string name="settings_tab_tag_xmpp">editar_configuracion_pestaña_xmpp</string>
+<string name="settings_tab_label_xmpp">XMPP</string>
+<string name="settings_tab_tag_proxy">editar_configuracion_pestaña_proxy</string>
+<string name="settings_tab_label_proxy">Proxy</string>
+
+
+<!-- wizard activities -->
+<string name="account_wizard_text1"><b>Bienvenido a BEEM.</b>\n\nNo ha configurado su cuenta XMPP(Jabber) todavia.\nEscoja una de las siguientes opciones:</string>
+<string name="account_wizard_configure_text"><b>Por favor complete con su cuenta existente</b></string>
+<string name="account_wizard_configure_account">Ya tengo una cuenta y deseo usarla</string>
+<string name="account_wizard_create_account">Deseo crear una nueva cuenta</string>
+
+<!-- Create an account Activity -->
+<string name="create_account_instr_dialog_title">Instrucciones - Crear una cuenta</string>
+<string name="create_account_err_dialog_title">Error - Creando una cuenta</string>
+<string name="create_account_err_dialog_settings_button">Cambiar mi configuracion</string>
+<string name="create_account_close_dialog_button">Cerrar</string>
+<string name="create_account_successfull_after">cuenta %s fue creada correctamente</string>
+<string name="create_account_err_username">Incorrecto JabberID</string>
+<string name="create_account_err_passwords">La clave no coincide</string>
+<string name="create_account_username">Usuario</string>
+<string name="create_account_password">Contraseña</string>
+<string name="create_account_confirm_password">Confirmar Contraseña</string>
+
+<!-- ContactList Activity -->
+<string name="contact_list_menu_add_contact">Añadir a Contacto</string>
+<string name="contact_list_menu_status">Cambiar Estado</string>
+<string name="contact_list_menu_settings">Configuracion</string>
+<string name="contact_list_menu_disconnect">Desconectar</string>
+<string name="contact_list_all_contact">Todos Contactos</string>
+<string name="contact_list_no_group">Sin Grupo</string>
+
+<!-- UserInfo dialog -->
+<string name="userinfo_label_alias">Alias</string>
+<string name="userinfo_label_chg_group">Manten. Grupos</string>
+<string name="userinfo_label_re_subscription">Reenviar Invitacion</string>
+<string name="userinfo_label_block">Bloquear</string>
+<string name="userinfo_label_delete">Borrar</string>
+<string name="userinfo_resend">Reenviar Suscripcion</string>
+<string name="userinfo_sure2delete">Are you sure you want to delete this contact ?
+</string>
+<string name="userinfo_yes">Sí</string>
+<string name="userinfo_no">No</string>
+<string name="userinfo_sureresend">Estas Seguro de Reenviar Invitacion?</string>
+
+<string name="chat_name">Beem - Chat</string>
+<string name="chat_input_default_value">Escribe tu Mensaje</string>
+<string name="chat_self">Yo</string>
+<string name="chat_error">Error</string>
+<string name="chat_send_message">Enviar</string>
+<string name="chat_menu_contacts_list">Lista de Contactos</string>
+<string name="chat_menu_change_chat">Cambiar chat</string>
+<string name="chat_dialog_change_chat_title">Chats abiertos</string>
+<string name="chat_menu_close_chat">Cerrar Chat</string>
+<string name="chat_no_more_chats">No más chats activos</string>
+<string name="chat_state_composing">componiendo un mensaje</string>
+<string name="chat_state_gone">ha dejado la conversación</string>
+<string name="chat_state_active">presta atención a la conversación</string>
+<string name="chat_state_inactive">esta haciendo otra cosa</string>
+
+<string name="contact_status_msg_available">Disponible</string>
+<string name="contact_status_msg_available_chat">Disponible para chatear</string>
+<string name="contact_status_msg_dnd">No interumpir</string>
+<string name="contact_status_msg_away">Fuera</string>
+<string name="contact_status_msg_xa">No Disponibles</string>
+<string name="contact_status_msg_offline">Desconectado</string>
+
+<string name="privacy_list_name">Beem - Manten. mi lista privada</string>
+<string name="privacy_list_no_data">No existe ninguna lista privada registrada</string>
+<string name="privacy_list_menu_create">Crear lista privada</string>
+<string name="privacy_list_create_dialog_title">Crear lista privada</string>
+<string name="privacy_list_create_dialog_list_name_label">Titulo</string>
+<string name="privacy_list_create_dialog_create_button">Crear</string>
+<string name="privacy_list_select_dialog_buddies">Contactos</string>
+<string name="privacy_list_select_dialog_groups">Grupos</string>
+<string name="privacy_list_select_dialog_delete">Borrar</string>
+<string name="privacy_list_delete_dialog_msg">Borrar la lista privada \'%s\' ?</string>
+<string name="privacy_list_delete_dialog_yes">Sí</string>
+<string name="privacy_list_delete_dialog_no">No</string>
+
+<string name="UpdateButton">Actualizar</string>
+
+<!-- Error messages -->
+
+<string name="error_login_authentication">Error Autenticando, mal usuario y contraseña.</string>
+
+<string name="interna_server_error">Error Servidor remoto</string>
+<string name="bad_request">mala pregunta</string>
+<string name="forbidden">prohibido</string>
+<string name="item_not_found">elemento no encontrado</string>
+<string name="conflict">conflicto</string>
+<string name="feature_not_implemented">caracteristica no implementada</string>
+<string name="gone">ir</string>
+<string name="jid_malformed">jid-malformado</string>
+<string name="no_acceptable">no-aceptable</string>
+<string name="not_allowed">no permitido</string>
+<string name="not_authorized">no autorizado</string>
+<string name="payment_required">pago requerido</string>
+<string name="recipient_unavailable">recibidor no disponible</string>
+<string name="redirect">redireccionar</string>
+<string name="registration_required">registro requerido</string>
+<string name="remote_server_not_found">servidor remoto no encontrado</string>
+<string name="remote_server_timeout">Sin respuesta del servidor</string>
+<string name="remote_server_error">Error en servidor remoto</string>
+<string name="resource_constraint">restriccion en recurso</string>
+<string name="service_unavailable">servicio no disponible</string>
+<string name="subscription_required">suscripcion requerida</string>
+<string name="undefined_condition">condicion indefinida</string>
+<string name="unexpected_condition">condicion inesperada</string>
+<string name="request_timeout">tiempo de espera de solicitud </string>
+</resources>
--- a/res/values-fr/arrays.xml Sun Feb 14 17:25:38 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
- <string-array name="proxy_types">
- <item>HTTP</item>
- <item>SOCKS4</item>
- <item>SOCKS5</item>
- </string-array>
- <string-array name="status_types">
- <item name="AvailableForChat">Disponible pour Bavarder</item>
- <item name="Available">Disponible</item>
- <item name="Busy">Occupé(e)</item>
- <item name="Away">Parti(e)</item>
- <item name="Unavailable">Indisponible</item>
- <item name="Disconnected">Déconnecté(e)</item>
- </string-array>
- <string-array name="privacy_list_select_dialog">
- <item name="@string/privacy_list_select_dialog_buddies">Contacts</item>
- <item name="@string/privacy_list_select_dialog_groups">Groupes</item>
- <item name="@string/privacy_list_select_dialog_delete">Supprimer</item>
- </string-array>
- <string-array name="loganim_state">
- <item name="@string/loganim_connecting">Connexion en cours...</item>
- <item name="@string/loganim_authenticating">Authentification...</item>
- <item name="@string/loganim_login_success">Connexion effectuée</item>
- <item name="@string/loganim_login_failed">Echec de la connexion</item>
- </string-array>
-</resources>
--- a/res/values-fr/strings.xml Sun Feb 14 17:25:38 2010 +0100
+++ b/res/values-fr/strings.xml Sat Dec 25 17:01:00 2010 +0100
@@ -1,11 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
+ <!-- Generic terms -->
<string name="app_name">Beem</string>
<string name="OkButton">Valider</string>
<string name="ClearButton">Effacer</string>
<string name="CancelButton">Annuler</string>
<string name="AcceptButton">Autoriser</string>
<string name="RefuseButton">Refuser</string>
+ <string name="JabberID">Jabber ID</string>
+ <string name="Password">Mot de passe</string>
+ <string name="Continue">Suivant</string>
+
+ <!-- AccountConfigure class -->
+ <string name="AccountConfigureManualConfiguration">Configuration manuelle</string>
<!-- Beem class -->
<string name="BeemJabberID">Jabber ID</string>
@@ -18,22 +25,6 @@
<string name="BeemServiceCreated">BeemService Créé</string>
<string name="BeemServiceDestroyed">BeemService détruit</string>
- <!-- Preferences informations -->
- <string name="PreferenceStatus">Status</string>
- <string name="PreferenceStatusText">status_text</string>
- <string name="PreferenceIsConfigured">preference_is_configured
- </string>
-
- <!-- ContactListSettings class -->
- <string name="CLSServerConnection">Connexion au serveur</string>
- <string name="CLSUserid">Id utilisateur:</string>
- <string name="CLSPassword">Mot de passe:</string>
- <string name="CLSService">Service:</string>
- <string name="CLSHostPort">Port:</string>
- <string name="CLSProxyInfo">Informations proxy</string>
- <string name="CLSLogin">Nom d\'utilisateur:</string>
- <string name="CLSOkButton">Ok</string>
-
<!-- ContactDialog class -->
<string name="CDChat">Chat</string>
<string name="CDCall">Appeler</string>
@@ -52,20 +43,6 @@
<string name="AddCBadForm">Mauvais formulaire</string>
<string name="AddCContactAlready">Contact déjà ajouté</string>
- <!-- SendIM class -->
- <string name="SendIMActTitle">Beem - Chat</string>
-
- <string name="SendIMSays"> %s dit :\n%s\n</string>
- <string name="SendIMYouSay">Vous dites :\n%s\n</string>
- <string name="SendIMSameSpeaker">%s\n</string>
- <string name="SendIMToSendHint">Tapez votre texte ici</string>
- <string name="SendIMState">Est : </string>
- <string name="SendIMErrorMsg">Erreur : %s\n</string>
- <string name="SendIMFrom">et est en train de parler depuis : </string>
- <string name="SendIMSmiley">Insérer un sourire</string>
- <string name="SendIMLoginHint">Nom d\'utilisateur</string>
- <string name="SendIMNoStatusSet">Aucun statut défini</string>
-
<!-- ChangeStatus class -->
<string name="ChangeStatusActTitle">Beem - Changer mon statut</string>
<string name="ChangeStatusType">Mon statut</string>
@@ -83,8 +60,6 @@
<!-- Settings class -->
<string name="SettingsText">Saisissez votre identifiant de connexion</string>
<string name="SettingsPassword">Saisissez votre mot de passe</string>
- <string name="SettingsCheckboxText">Utilisation de Gmail</string>
- <string name="SettingsGmail">Cochez cette option si vous souhaitez utiliser votre compte Gmail</string>
<string name="SettingsProxy">Proxy</string>
<string name="SettingsProxyProxy">Utiliser un proxy</string>
<string name="SettingsProxySummary">Connectez vous à travers un serveur proxy</string>
@@ -104,6 +79,44 @@
<string name="SettingsPriorityTitle">Priorité</string>
<string name="SettingsResourceSummary">Saisissez la resource à partir de laquelle vous vous connectez</string>
<string name="SettingsPrioritySummary">Saisissez la priorité de votre client</string>
+ <string name="contact_list_preferences">Liste d\'ami(e)s</string>
+ <string name="contact_list_preferences_sum">Une série d\'options d\'affichage de votre liste
+ d\'ami(e)s</string>
+ <string name="CLP_hide_groups">Cachez les groupes</string>
+ <string name="CLP_hide_groups_sum">Cochez cette option pour cacher les groupes</string>
+ <string name="CLP_hidden_contact">Cachez les contacts</string>
+ <string name="CLP_hidden_contact_sum">Cochez cette option pour cacher les contacts déconnectés</string>
+ <string name="settings_account_username">Nom d\'utilisateur</string>
+ <string name="login_username_info_default">beem@beem-project.com</string>
+ <string name="settings_account_password">Mot de passe</string>
+ <string name="settings_account_server">Serveur</string>
+ <string name="settings_account_port">Port</string>
+ <string name="settings_advanced_service_behaviour">Comportement du service</string>
+ <string name="settings_advanced_sum">Une série d\'options pour les utilisateurs avertis</string>
+ <string name="settings_xmpp_server">Serveur</string>
+ <string name="comments_xmpp_server">example.com</string>
+ <string name="settings_xmpp_port">Port</string>
+ <string name="comments_xmpp_port">Default: 5222</string>
+ <string name="settings_xmpp_use_tls">SSL/TLS obligatoire</string>
+ <string name="settings_reco_delay">Délai de reconnexion</string>
+ <string name="settings_proxy_sum">Paramètrez un serveur proxy</string>
+ <string name="settings_proxy_use">Utiliser un proxy</string>
+ <string name="settings_proxy_type_prompt">Choisir un type de proxy</string>
+ <string name="settings_proxy_server">Serveur</string>
+ <string name="settings_proxy_port">Port</string>
+ <string name="comments_proxy_port">Default: 1080</string>
+ <string name="settings_proxy_username">Nom d\'utilisateur</string>
+ <string name="settings_proxy_password">Mot de passe</string>
+ <string name="away_chk_title">Activer l\'absence automatique</string>
+ <string name="away_chk_sum">Change votre status en Absent automatiquement quand l\'écran du telephone s\'éteint</string>
+ <string name="away_message_title">Message d\'absence</string>
+ <string name="away_message_sum">Votre Message d\'absence</string>
+ <string name="away_message_hint">Je suis absent car mon ecran est éteint</string>
+ <string name="notification_preferences">Paramètres des notifications</string>
+ <string name="notification_enable_vibrate_title">Activer le vibreur</string>
+ <string name="notification_enable_vibrate_sum">Activer le vibreur pour les messages entrants</string>
+ <string name="notification_snd_title">Sonnerie des messages</string>
+ <string name="notification_snd_sum">Configurer la sonnerie des messages entrants</string>
<!-- Subscription class -->
<string name="SubscriptAccept">Inscription acceptée</string>
@@ -112,9 +125,6 @@
<string name="SubscriptText">%s vient de vous ajouter à sa liste de contacts. Souhaitez-vous l\'autoriser ?</string>
<string name="SubscriptTitle">Autoriser ce contact ?</string>
- <!-- ContactList class -->
- <string name="ConListNotConnected">Non connecté(e)</string>
-
<!-- BeemChatManager class -->
<string name="BeemChatManagerNewMessage">Vous avez reçu un nouveau message</string>
@@ -145,9 +155,6 @@
<!--
Buttons
-->
- <string name="button_reset">Réinitialiser</string>
- <string name="button_login">Se connecter</string>
- <string name="button_save">Enregistrer</string>
<string name="button_create_account">Créer ce compte</string>
<string name="button_create_login_account">Créer puis utiliser ce compte</string>
@@ -177,9 +184,13 @@
<string name="login_no_connectivity">Pas de connexion internet disponible</string>
<string name="login_start_msg">Configuration des informations dans le menu</string>
- <!--
- EditSettings Activity
- -->
+ <!-- LoginAnim activity -->
+ <string name="loganim_connecting">Connexion en cours ...</string>
+ <string name="loganim_authenticating">Authentification ...</string>
+ <string name="loganim_login_success">Connexion effectuée</string>
+ <string name="loganim_login_failed">Echec de la connextion</string>
+
+ <!-- EditSettings Activity -->
<string name="settings_menu_create_account">Créer un compte</string>
<string name="settings_menu_privacy_lists">Gérer mes listes privées</string>
<string name="settings_saved_ok">Les paramètres ont été enregistrés avec succès.</string>
@@ -200,43 +211,11 @@
<string name="settings_tab_tag_proxy">edit_settings_tab_proxy</string>
<string name="settings_tab_label_proxy">Proxy</string>
- <!-- EditSettings Activity General Preferences Tabs -->
- <string name="contact_list_preferences">Liste d\'ami(e)s</string>
- <string name="contact_list_preferences_sum">Une série d\'options d\'affichage de votre liste
- d\'ami(e)s</string>
-
- <string name="CLP_hide_groups">Cachez les groupes</string>
- <string name="CLP_hide_groups_sum">Cochez cette option pour cacher les groupes</string>
- <string name="CLP_hidden_contact">Cachez les contacts</string>
- <string name="CLP_hidden_contact_sum">Cochez cette option pour cacher les contacts déconnectés</string>
-
- <!-- EditSettings Activity Account tab -->
- <string name="settings_account_username">Nom d\'utilisateur</string>
- <string name="login_username_info_default">beem@beem-project.com</string>
- <string name="settings_account_password">Mot de passe</string>
- <string name="settings_account_server">Serveur</string>
- <string name="settings_account_port">Port</string>
-
- <!-- EditSettings Activity Advanced Options tab -->
- <string name="settings_advanced_service_behaviour">Comportement du service</string>
- <string name="settings_advanced_sum">Une série d\'options pour les utilisateurs avertis</string>
- <string name="settings_xmpp_server">Serveur</string>
- <string name="comments_xmpp_server">example.com</string>
- <string name="settings_xmpp_port">Port</string>
- <string name="comments_xmpp_port">Default: 5222</string>
- <string name="settings_xmpp_use_tls">SSL/TLS obligatoire</string>
- <string name="settings_reco_delay">Délai de reconnexion</string>
-
-
- <!-- EditSettings Activity Proxy tab -->
- <string name="settings_proxy_sum">Paramètrez un serveur proxy</string>
- <string name="settings_proxy_use">Utiliser un proxy</string>
- <string name="settings_proxy_type_prompt">Choisir un type de proxy</string>
- <string name="settings_proxy_server">Serveur</string>
- <string name="settings_proxy_port">Port</string>
- <string name="comments_proxy_port">Default: 1080</string>
- <string name="settings_proxy_username">Nom d\'utilisateur</string>
- <string name="settings_proxy_password">Mot de passe</string>
+ <!-- wizard activities -->
+ <string name="account_wizard_text1"><b>Bienvenue sur BEEM.</b>\n\nVous n\'avez pas encore configuré de compte XMPP (Jabber).\nChoisissez une des options suivantes :</string>
+ <string name="account_wizard_configure_text"><b>Remplissez les informations pour votre compte</b></string>
+ <string name="account_wizard_configure_account">Je possède déjà un compte que je veux utiliser.</string>
+ <string name="account_wizard_create_account">Je veux créer un nouveau compte</string>
<!--
Create an account Activity
@@ -256,7 +235,9 @@
ContactList Activity
-->
<string name="contact_list_menu_add_contact">Ajouter un contact</string>
+ <string name="contact_list_menu_status">Changer son status</string>
<string name="contact_list_menu_settings">Paramètres</string>
+ <string name="contact_list_menu_disconnect">Se déconnecter</string>
<string name="contact_list_all_contact">Tous les contacts</string>
<string name="contact_list_no_group">Aucun groupe</string>
@@ -285,6 +266,10 @@
<string name="chat_dialog_change_chat_title">Conversations en cours</string>
<string name="chat_menu_close_chat">Fermer cette conversation</string>
<string name="chat_no_more_chats">Aucune conversation en cours</string>
+ <string name="chat_state_composing">est en train d\'écrire un message</string>
+ <string name="chat_state_gone">a quitté la conversation</string>
+ <string name="chat_state_active">prête attention à la conversation</string>
+ <string name="chat_state_inactive">fait quelque chose d\'autre</string>
<string name="contact_status_msg_available">Disponible</string>
<string name="contact_status_msg_available_chat">Disponible pour discuter</string>
@@ -309,9 +294,7 @@
<string name="UpdateButton">Mettre à jour</string>
<!-- Error messages -->
-
<string name="error_login_authentication">Erreur lors de l\'authenfitication, mauvais login ou password</string>
-
<string name="interna_server_error">Erreur survenu sur le serveur</string>
<string name="bad_request">bad-request</string>
<string name="forbidden">forbidden</string>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/values-it/strings.xml Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,310 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Generic terms -->
+ <string name="app_name">Beem</string>
+ <string name="OkButton">Ok</string>
+ <string name="ClearButton">Pulisci</string>
+ <string name="CancelButton">Annulla</string>
+ <string name="AcceptButton">Autorizza</string>
+ <string name="RefuseButton">Proibisci</string>
+ <string name="JabberID">Jabber ID</string>
+ <string name="Password">Password</string>
+ <string name="Continue">Continua</string>
+
+ <!-- AccountConfigure class -->
+ <string name="AccountConfigureManualConfiguration">Configurazione Manuale</string>
+
+ <!-- Beem class -->
+ <string name="BeemJabberID">Jabber ID</string>
+
+ <!-- BeemApplication class -->
+ <string name="BeemApplicationConnect">Connessione...</string>
+
+ <!-- BeemService class -->
+ <string name="BeemServiceDescription">Usa il sservizio Beem</string>
+ <string name="BeemServiceCreated">Create il servizio Bemm</string>
+ <string name="BeemServiceDestroyed">Rimosso il servizio Beem</string>
+
+ <!-- ContactDialog class -->
+ <string name="CDChat">Chat</string>
+ <string name="CDCall">Chiamate</string>
+ <string name="CDInfos">Gestisci Utente</string>
+
+ <!-- AddContact class -->
+ <string name="AddCActTitle">Beem - Aggiungi un contatto</string>
+
+ <string name="AddCLogin">Username</string>
+ <string name="AddCAlias">Alias</string>
+ <string name="AddCGroup">Gruppo</string>
+ <string name="AddCOkButton">Aggiungi</string>
+ <string name="AddCContactAdded">Aggiunto contatto</string>
+ <string name="AddCContactAddedError">Errore Contatto non aggiunto</string>
+ <string name="AddCContactAddedLoginError">Errore di accesso</string>
+ <string name="AddCBadForm">Forma errata</string>
+ <string name="AddCContactAlready">Contatto già esistente</string>
+
+ <!-- ChangeStatus class -->
+ <string name="ChangeStatusActTitle">Beem - Cambia il mio stato</string>
+ <string name="ChangeStatusType">Il mio stato</string>
+ <string name="ChangeStatusMessage">Messaggio personale</string>
+ <string name="OpenContactList">Apri lista contatti</string>
+
+ <string name="MenuAddContact">Aggiungi un nuovo cotatto</string>
+ <string name="MenuAccountAbout">Progetto Beem</string>
+ <string name="MenuAccountCreate">Crea un account</string>
+ <string name="MenuConnection">Modifica account</string>
+ <string name="ChangeStatusOk">Aggiornamento stato</string>
+ <string name="ChangeStatusNoChange">Nessun cambiamento</string>
+
+ <!-- Settings class -->
+ <string name="SettingsText">Modifica il tuo username</string>
+ <string name="SettingsPassword">Modifica la tua password</string>
+ <string name="SettingsProxy">Proxy</string>
+ <string name="SettingsProxyProxy">Usa un server proxy</string>
+ <string name="SettingsProxySummary">Accedi attraverso un server proxy</string>
+ <string name="SettingsProxyType">Protocollo</string>
+ <string name="SettingsProxyTypeSummary">Scegli il tipo del server proxy</string>
+ <string name="SettingsProxyServer">Modifica l\'indirizzo del server proxy</string>
+ <string name="SettingsProxyPort">Modifica la porta del server proxy</string>
+ <string name="SettingsProxyUser">Opzionale, permetti l\'autenticazione di te stesso sul server proxy</string>
+ <string name="SettingsProxyPassword">Opzionale, permetti l\'autenticazione di te stesso sul server proxy</string>
+ <string name="SettingsAdvanced">Avanzate</string>
+ <string name="SettingsAdvancedOptions">Opzioni specifiche del server</string>
+ <string name="SettingsAdvancedRecoDelay">Modifica ritardo di ri-connessione</string>
+ <string name="SettingsAdvancedSpecOpt">Abilita se vuoi usare un server specifico per la tua connessione</string>
+ <string name="SettingsAdvancedAddOpt">Modifica l\'indirizzo del server</string>
+ <string name="SettingsAdvancedPortOpt">Modifica la porta del server</string>
+ <string name="SettingsResourceTitle">Risorsa</string>
+ <string name="SettingsPriorityTitle">Priorità</string>
+ <string name="SettingsResourceSummary">Imposta la risorsa XMPP del tuo client </string>
+ <string name="SettingsPrioritySummary">Imposta la priorità del tuo client</string>
+ <string name="contact_list_preferences">Lista amici</string>
+ <string name="contact_list_preferences_sum">Un insieme di opzioni di visualizzazione per la tua lista amizie
+ </string>
+ <string name="CLP_hide_groups">Nascondi gruppi</string>
+ <string name="CLP_hide_groups_sum">Abilita quest\'opzione per nascondere i gruppi</string>
+ <string name="CLP_hidden_contact">Nascondi le amizie</string>
+ <string name="CLP_hidden_contact_sum">Abilita quest\'opzione per nascondere gli amici non connessi
+ </string>
+ <string name="settings_account_username">Username</string>
+ <string name="login_username_info_default">beem@beem-project.com</string>
+ <string name="settings_account_password">Password</string>
+ <string name="settings_account_server">Server</string>
+ <string name="settings_account_port">Porta</string>
+ <string name="settings_advanced_service_behaviour">Funzionamento del servizio</string>
+ <string name="settings_advanced_sum">Un insieme di opzioni per gli utenti avanzati</string>
+ <string name="settings_xmpp_server">Indirizzo</string>
+ <string name="comments_xmpp_server">example.com</string>
+ <string name="settings_xmpp_port">Porta</string>
+ <string name="settings_xmpp_use_tls">Usa SSL/TLS</string>
+ <string name="settings_reco_delay">Ritardo di ri-connessione</string>
+ <string name="comments_xmpp_port">Predefinita: 5222</string>
+ <string name="settings_proxy_sum">Impostazioni per l\'utilizzo del proxy</string>
+ <string name="settings_proxy_use">Connetti utilizzando un proxy</string>
+ <string name="settings_proxy_type_prompt">Scegli un tipo di proxy</string>
+ <string name="settings_proxy_server">Server</string>
+ <string name="settings_proxy_port">Porta</string>
+ <string name="comments_proxy_port">Predefinita: 1080</string>
+ <string name="settings_proxy_username">Username</string>
+ <string name="settings_proxy_password">Password</string>
+ <string name="away_chk_title">Abilita Auto-away</string>
+ <string name="away_chk_sum">Cambia lo stato ad Away quando lo schermo è spento</string>
+ <string name="away_message_title">Messaggio Away</string>
+ <string name="away_message_sum">Il messaggio Away che verrà mostrato</string>
+ <string name="away_message_hint">Non sono disponibile, il mio schermo è spento</string>
+ <string name="notification_preferences">Impostazioni di notifica</string>
+ <string name="notification_enable_vibrate_title">Abilita vibrazione</string>
+ <string name="notification_enable_vibrate_sum">Abilita vibrazione per i messaggi in arrivo</string>
+ <string name="notification_snd_title">Suoneria messaggi</string>
+ <string name="notification_snd_sum">Imposta la suoneria per i messaggi in arrivo</string>
+
+
+ <!-- Subscription class -->
+ <string name="SubscriptAccept">Sottoscrizione accettata</string>
+ <string name="SubscriptError">Errore nella sottoscrizione</string>
+ <string name="SubscriptRefused">Sottoscrizione refiutata</string>
+ <string name="SubscriptText">%s desidera aggiungerti nella sua lista di amicizie. Vuoi autorizzarlo/a?</string>
+ <string name="SubscriptTitle">Autorizza amicizia ?</string>
+
+ <!-- BeemChatManager -->
+ <string name="BeemChatManagerNewMessage">Hai un nuovo messaggio</string>
+
+ <!-- BeemBroadcastReceiver class -->
+ <string name="BeemBroadcastReceiverDisconnect">BEEM: sei stato disconnesso</string>
+
+ <!-- XmppConnectionAdapter class -->
+ <string name="AcceptContactRequest">%s ti ha appena aggiunto alla sue lista di amicizie.</string>
+ <string name="AcceptContactRequestFrom">Autorizza %s a contattarti.</string>
+
+ <!-- Activities -->
+ <string name="login_tag">Beem - Login Activity</string>
+ <string name="edit_settings_name">Beem - Settings</string>
+ <string name="edit_settings_tag">Beem - EditSettings Activity</string>
+ <string name="create_account_name">Beem - Create an account</string>
+ <string name="create_account_tag">Beem - CreateAccount Activity</string>
+ <string name="contact_list_name">Beem - Contacts</string>
+ <string name="contact_list_tag">Beem - ContactList Activity</string>
+ <string name="user_info_name">Beem - User Info</string>
+
+ <!-- Buttons -->
+ <string name="button_create_account">Crea questo account</string>
+ <string name="button_create_login_account">Crea ed usa questo account</string>
+
+ <!-- LogAs Activity -->
+ <string name="login_username">Username</string>
+ <string name="login_password">Password</string>
+ <string name="login_error_dialog_title">Accesso - Errore</string>
+ <string name="login_close_dialog_button">Chiudi</string>
+ <string name="login_menu_create_account">Crea un account</string>
+ <string name="login_menu_settings">Impostazioni</string>
+ <string name="login_menu_about">Informazioni su</string>
+ <string name="login_about_title">Beem %s - Informazioni</string>
+ <string name="login_about_msg">
+ Beem è un progetto innovativo EPITECH. Visitaci su
+ http://www.beem-project.com !
+ </string>
+ <string name="login_about_button">Chiudi</string>
+ <string name="login_settings_button">Impostazioni</string>
+ <string name="login_login_button">Accedi</string>
+ <string name="login_login_progress">Connessione in corso. Attendere...</string>
+ <string name="login_error_msg">Purtroppo, si è verificato un errore.\n\nDettagli
+ errore:\n%s</string>
+ <string name="login_menu_login">Accedi</string>
+ <string name="login_no_connectivity">Non è stata trovata la connessione internet</string>
+ <string name="login_start_msg">Impostazioni di configurazione nel menuSettings configuration in menu</string>
+
+ <!-- LoginAnim activity -->
+ <string name="loganim_connecting">Connessione in corso ...</string>
+ <string name="loganim_authenticating">Autenticazione ...</string>
+ <string name="loganim_login_success">Accesso riuscito</string>
+ <string name="loganim_login_failed">Accesso fallito</string>
+
+ <!-- EditSettings Activity -->
+ <string name="settings_menu_create_account">Crea un account</string>
+ <string name="settings_menu_privacy_lists">Gestisci le mie liste di privacy</string>
+ <string name="settings_saved_ok">Le impostazioni sono state salvate con successo.</string>
+
+
+
+ <!-- EditSettings Activity Categories -->
+ <string name="general_preferences">Preferenze generali</string>
+ <string name="user_preferences">Impostazioni utente (richiste)</string>
+ <string name="user_preferences_advanced">Impostazioni utente avanzate (opzionali)</string>
+ <string name="network_preferences">Opzioni rete</string>
+ <string name="proxy_proxy_settings">Impostazioni Proxy</string>
+ <string name="proxy_user_settings">Impostazioni Proxy</string>
+
+ <!-- EditSettings Activity Tabs -->
+ <string name="settings_tab_tag_account">edit_settings_tab_account</string>
+ <string name="settings_tab_label_account">Account</string>
+ <string name="settings_tab_tag_xmpp">edit_settings_tab_xmpp</string>
+ <string name="settings_tab_label_xmpp">XMPP</string>
+ <string name="settings_tab_tag_proxy">edit_settings_tab_proxy</string>
+ <string name="settings_tab_label_proxy">Proxy</string>
+
+
+ <!-- wizard activities -->
+ <string name="account_wizard_text1"><b>Benvenuto su BEEM.</b>\n\nNon hai ancora configurato un account XMPP (Jabber).\nScegli una delle seguenti opzioni :</string>
+ <string name="account_wizard_configure_text"><b>Si prega di compilare i dati per il vostro account esistente</b></string>
+ <string name="account_wizard_configure_account">Possiedo già un account che voglio</string>
+ <string name="account_wizard_create_account">Voglio registrare un nuovo account</string>
+
+ <!-- Create an account Activity -->
+ <string name="create_account_instr_dialog_title">Crea un account - Istruzioni</string>
+ <string name="create_account_err_dialog_title">Crea un account - Errore</string>
+ <string name="create_account_err_dialog_settings_button">Cambia le mie impostazioni</string>
+ <string name="create_account_close_dialog_button">Chiudi</string>
+ <string name="create_account_successfull_after">account %s è stato creato con successo</string>
+ <string name="create_account_err_username">Errato JabberID</string>
+ <string name="create_account_err_passwords">Le password non coincidono.</string>
+ <string name="create_account_username">Username</string>
+ <string name="create_account_password">Password</string>
+ <string name="create_account_confirm_password">Conferma password</string>
+
+ <!-- ContactList Activity -->
+ <string name="contact_list_menu_add_contact">Aggiungi un contatto</string>
+ <string name="contact_list_menu_status">Cambia stato</string>
+ <string name="contact_list_menu_settings">Impsotazioni</string>
+ <string name="contact_list_menu_disconnect">Disconnetti</string>
+ <string name="contact_list_all_contact">Tutti i contatti</string>
+ <string name="contact_list_no_group">Nessun gruppo</string>
+
+ <!-- UserInfo dialog -->
+ <string name="userinfo_label_alias">Alias</string>
+ <string name="userinfo_label_chg_group">Gestisci gruppi</string>
+ <string name="userinfo_label_re_subscription">Rimanda invito</string>
+ <string name="userinfo_label_block">Blocco</string>
+ <string name="userinfo_label_delete">Elimina</string>
+ <string name="userinfo_resend">Rimanda sottoscrizione</string>
+ <string name="userinfo_sure2delete">Sei sicuro di voler eliminare questo contatto?
+ </string>
+ <string name="userinfo_yes">Sì</string>
+ <string name="userinfo_no">No</string>
+ <string name="userinfo_sureresend">Sei sicuro di voler rispedire l\'invito ?</string>
+
+ <string name="chat_name">Beem - Chat</string>
+ <string name="chat_input_default_value">Scrivi il tuo messaggio</string>
+ <string name="chat_self">Io</string>
+ <string name="chat_error">Errore</string>
+ <string name="chat_send_message">Invia</string>
+ <string name="chat_menu_contacts_list">Lista contatti</string>
+ <string name="chat_menu_change_chat">Cambia conversazione</string>
+ <string name="chat_dialog_change_chat_title">Conversazioni aperte</string>
+ <string name="chat_menu_close_chat">Chiudi questa conversazione</string>
+ <string name="chat_no_more_chats">nessuna conversazione attiva</string>
+ <string name="chat_state_composing">sta componendo un messaggio</string>
+ <string name="chat_state_gone">ha abbandonato la conversazione</string>
+ <string name="chat_state_active">presta attenzione alla conversazione</string>
+ <string name="chat_state_inactive">sta facendo qualcos\'altro</string>
+
+ <string name="contact_status_msg_available">Disponibile</string>
+ <string name="contact_status_msg_available_chat">Disponibile a conversare</string>
+ <string name="contact_status_msg_dnd">Non disturbare</string>
+ <string name="contact_status_msg_away">Away</string>
+ <string name="contact_status_msg_xa">Non disponibile</string>
+ <string name="contact_status_msg_offline">Disconnesso</string>
+
+ <string name="privacy_list_name">Beem - Gestisci le mie liste di privacy</string>
+ <string name="privacy_list_no_data">Non c\'è alcuna lista di provacy registrata.</string>
+ <string name="privacy_list_menu_create">Crea una lista di privacy</string>
+ <string name="privacy_list_create_dialog_title">Crea una lista di privacy</string>
+ <string name="privacy_list_create_dialog_list_name_label">Titolo</string>
+ <string name="privacy_list_create_dialog_create_button">Creare</string>
+ <string name="privacy_list_select_dialog_buddies">Amicizie</string>
+ <string name="privacy_list_select_dialog_groups">Gruppi</string>
+ <string name="privacy_list_select_dialog_delete">Elimina</string>
+ <string name="privacy_list_delete_dialog_msg">Sei sicuro di voler eliminare la lista di privacy intitolata \'%s\' ?</string>
+ <string name="privacy_list_delete_dialog_yes">Sì</string>
+ <string name="privacy_list_delete_dialog_no">No</string>
+
+ <string name="UpdateButton">Aggiorna</string>
+
+ <!-- Error messages -->
+
+ <string name="error_login_authentication">Errore durante l\'autenticazione, login o password errati.</string>
+
+ <string name="interna_server_error">Errore del server remoto</string>
+ <string name="bad_request">bad-request</string>
+ <string name="forbidden">forbidden</string>
+ <string name="item_not_found">item-not-found</string>
+ <string name="conflict">conflict</string>
+ <string name="feature_not_implemented">feature-not-implemented</string>
+ <string name="gone">gone</string>
+ <string name="jid_malformed">jid-malformed</string>
+ <string name="no_acceptable">no-acceptable</string>
+ <string name="not_allowed">not-allowed</string>
+ <string name="not_authorized">not-authorized</string>
+ <string name="payment_required">payment-required</string>
+ <string name="recipient_unavailable">recipient-unavailable</string>
+ <string name="redirect">redirect</string>
+ <string name="registration_required">registration-required</string>
+ <string name="remote_server_not_found">Remote server not found</string>
+ <string name="remote_server_timeout">No server response</string>
+ <string name="remote_server_error">Remote server error</string>
+ <string name="resource_constraint">resource-constraint</string>
+ <string name="service_unavailable">service-unavailable</string>
+ <string name="subscription_required">subscription-required</string>
+ <string name="undefined_condition">undefined-condition</string>
+ <string name="unexpected_condition">unexpected-condition</string>
+ <string name="request_timeout">request-timeout</string>
+</resources>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/values-ru/strings.xml Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,226 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+<!-- Generic terms -->
+<string name="app_name">Beem</string>
+<string name="OkButton">ОК</string>
+<string name="ClearButton">Очистить</string>
+<string name="CancelButton">Отмена</string>
+<string name="AcceptButton">Разрешить</string>
+<string name="RefuseButton">Отказать</string>
+<string name="JabberID">JID</string>
+<string name="Password">Пароль</string>
+
+<!-- Beem class -->
+<string name="BeemJabberID">JID</string>
+
+<!-- BeemApplication class -->
+<string name="BeemApplicationConnect">Соединяемся...</string>
+
+<!-- BeemService class -->
+<string name="BeemServiceDescription">Использовать сервис Beem</string>
+
+<!-- ContactDialog class -->
+<string name="CDChat">Написать</string>
+<string name="CDCall">Повонить</string>
+<string name="CDInfos">Настройки</string>
+
+<!-- AddContact class -->
+<string name="AddCActTitle">Добавление контакта</string>
+
+<string name="AddCLogin">Имя пользователя</string>
+<string name="AddCAlias">Псевдоним</string>
+<string name="AddCGroup">Группа</string>
+<string name="AddCOkButton">Добавить</string>
+<string name="AddCContactAdded">Контакт добавлен</string>
+<string name="AddCContactAddedError">При добавлении контакта возникла ошибка</string>
+<string name="AddCContactAddedLoginError">При выполнении входа возникла ошибка</string>
+<string name="AddCContactAlready">Контакт уже добавлен</string>
+
+<!-- ChangeStatus class -->
+<string name="ChangeStatusActTitle">Изменение статуса</string>
+<string name="ChangeStatusType">Мой статус</string>
+<string name="ChangeStatusMessage">Персональное сообщение</string>
+<string name="OpenContactList">Открыть список контактов</string>
+
+<string name="MenuAddContact">Добавить новый контакт</string>
+<string name="MenuAccountAbout">О проекте Beem</string>
+<string name="MenuAccountCreate">Создать аккаунт</string>
+<string name="MenuConnection">Изменить аккаунт</string>
+<string name="ChangeStatusOk">Обновляем статус...</string>
+<string name="ChangeStatusNoChange">Ничего не поменялось</string>
+
+<!-- Settings class -->
+<string name="SettingsText">Имя пользователя</string>
+<string name="SettingsPassword">Пароль</string>
+<string name="SettingsProxy">Прокси</string>
+<string name="SettingsProxyProxy">Использовать прокси</string>
+<string name="SettingsProxyType">Протокол</string>
+<string name="SettingsProxyTypeSummary">Выберите тип прокси</string>
+<string name="SettingsProxyServer">Сервер</string>
+<string name="SettingsProxyPort">Порт</string>
+<string name="SettingsAdvanced">Дополнительно</string>
+<string name="SettingsAdvancedOptions">Дополнительные настройки сервера</string>
+<string name="SettingsAdvancedRecoDelay">Изменить задержку повторного соединения</string>
+<string name="SettingsAdvancedAddOpt">Сервер</string>
+<string name="SettingsAdvancedPortOpt">Порт</string>
+<string name="SettingsResourceTitle">Ресурс</string>
+<string name="SettingsPriorityTitle">Приоритет</string>
+<string name="contact_list_preferences">Список контактов</string>
+<string name="contact_list_preferences_sum">A set of display options for your buddy list
+</string>
+<string name="CLP_hide_groups">Скрывать группы</string>
+<string name="CLP_hidden_contact">Скрывать оффлайн-контакты</string>
+<string name="CLP_hidden_contact_sum">Check this option to hide unconnected buddies
+</string>
+<string name="settings_account_username">Имя польозвателя</string>
+<string name="settings_account_password">Пароль</string>
+<string name="settings_account_server">Сервер</string>
+<string name="settings_account_port">Порт</string>
+<string name="settings_xmpp_server">Сервер</string>
+<string name="settings_xmpp_port">Порт</string>
+<string name="settings_xmpp_use_tls">Требовать SSL/TLS</string>
+<string name="comments_xmpp_port">По умолчанию 5222</string>
+<string name="settings_proxy_use">Соединяться через прокси</string>
+<string name="settings_proxy_type_prompt">Выберите тип проси</string>
+<string name="settings_proxy_server">Сервер</string>
+<string name="settings_proxy_port">Порт</string>
+<string name="comments_proxy_port">По умолчанию 1080</string>
+<string name="settings_proxy_username">Имя пользователя</string>
+<string name="settings_proxy_password">Пароль</string>
+<string name="notification_preferences">Настройка оповещений</string>
+<string name="notification_enable_vibrate_title">Вибрация</string>
+<string name="notification_enable_vibrate_sum">Активировать вибрировать на входящие сообщения</string>
+<string name="notification_snd_title">Сигнал сообщений</string>
+
+
+<!-- Subscription class -->
+
+<!-- BeemChatManager -->
+<string name="BeemChatManagerNewMessage">Пришло новое сообщение</string>
+
+<!-- BeemBroadcastReceiver class -->
+
+<!-- XmppConnectionAdapter class -->
+
+<!-- Activities -->
+<string name="edit_settings_name">Настройки</string>
+<string name="create_account_name">Создать аккаунт</string>
+<string name="contact_list_name">Контакты</string>
+<string name="user_info_name">Информация о пользователе</string>
+
+<!-- Buttons -->
+
+<!-- LogAs Activity -->
+<string name="login_username">Имя пользователя</string>
+<string name="login_password">Пароль</string>
+<string name="login_error_dialog_title">Ошибка входа</string>
+<string name="login_close_dialog_button">Закрыть</string>
+<string name="login_menu_create_account">Создать аккаунт</string>
+<string name="login_menu_settings">Настройки</string>
+<string name="login_menu_about">О программе</string>
+<string name="login_about_msg">
+Beem is an EPITECH Innovative Project. Visit us at
+http://www.beem-project.com !
+</string>
+<string name="login_about_button">Закрыть</string>
+<string name="login_settings_button">Настройки</string>
+<string name="login_login_button">Войти</string>
+<string name="login_login_progress">Соединяемся, подождите немного...</string>
+<string name="login_error_msg">Unfortunately, an error occured.\n\nError
+detail:\n%s</string>
+<string name="login_menu_login">Войти</string>
+
+<!-- LoginAnim activity -->
+<string name="loganim_connecting">Соединение ...</string>
+<string name="loganim_authenticating">Аутентификация ...</string>
+<string name="loganim_login_success">Логин успешной</string>
+<string name="loganim_login_failed">Не удалось войти в сеть</string>
+
+<!-- EditSettings Activity -->
+<string name="settings_menu_create_account">Создать аккаунт</string>
+<string name="settings_menu_privacy_lists">Настроить списки приватности</string>
+
+
+
+<!-- EditSettings Activity Categories -->
+<string name="network_preferences">Настройки сети</string>
+<string name="proxy_proxy_settings">Настройки прокси</string>
+<string name="proxy_user_settings">Настройки прокси</string>
+
+<!-- EditSettings Activity Tabs -->
+<string name="settings_tab_label_account">Аккаунт</string>
+<string name="settings_tab_label_xmpp">XMPP</string>
+<string name="settings_tab_label_proxy">Прокси</string>
+
+
+<!-- wizard activities -->
+<string name="account_wizard_configure_account">Использовать существующий аккаунт</string>
+<string name="account_wizard_create_account">Создать новый аккаунт</string>
+
+<!-- Create an account Activity -->
+<string name="create_account_err_dialog_settings_button">Изменить настройки</string>
+<string name="create_account_close_dialog_button">Закрыть</string>
+<string name="create_account_successfull_after">Аккаунт %s успешно создан</string>
+<string name="create_account_err_username">Неправильный JID</string>
+<string name="create_account_err_passwords">Пароли не совпадают</string>
+<string name="create_account_username">Имя пользователя</string>
+<string name="create_account_password">Пароль</string>
+<string name="create_account_confirm_password">Ещё раз</string>
+
+<!-- ContactList Activity -->
+<string name="contact_list_menu_add_contact">Добавить контакт</string>
+<string name="contact_list_menu_settings">Настройки</string>
+<string name="contact_list_all_contact">Все контакты</string>
+
+<!-- UserInfo dialog -->
+<string name="userinfo_label_alias">Псевдоним</string>
+<string name="userinfo_label_chg_group">Управление группами</string>
+<string name="userinfo_label_re_subscription">Выслать приглашение ещё раз</string>
+<string name="userinfo_label_block">Заблокировать</string>
+<string name="userinfo_label_delete">Удалить</string>
+<string name="userinfo_sure2delete">Are you sure you want to delete this contact ?
+</string>
+<string name="userinfo_yes">Да</string>
+<string name="userinfo_no">Нет</string>
+
+<string name="chat_name">Чат</string>
+<string name="chat_self">Я</string>
+<string name="chat_error">Ошибка</string>
+<string name="chat_send_message">Отправить</string>
+<string name="chat_menu_contacts_list">Список контактов</string>
+<string name="chat_dialog_change_chat_title">Открытые чаты</string>
+<string name="chat_menu_close_chat">Закрыть этот чат</string>
+<string name="chat_state_composing">набирает текст</string>
+<string name="chat_state_gone">покинул чат</string>
+<string name="chat_state_active">вникает в текст</string>
+<string name="chat_state_inactive">занимается чем-то другим</string>
+
+<string name="contact_status_msg_available">Онлайн</string>
+<string name="contact_status_msg_dnd">Занят</string>
+<string name="contact_status_msg_away">Отошёл</string>
+<string name="contact_status_msg_xa">Недоступен</string>
+<string name="contact_status_msg_offline">Оффлайн</string>
+
+<string name="privacy_list_name">Настройки приватности</string>
+<string name="privacy_list_no_data">Нет списков приватности</string>
+<string name="privacy_list_menu_create">Создать список приватности</string>
+<string name="privacy_list_create_dialog_title">Создать список приватности</string>
+<string name="privacy_list_create_dialog_list_name_label">Название</string>
+<string name="privacy_list_create_dialog_create_button">Создать</string>
+<string name="privacy_list_select_dialog_buddies">Контакты</string>
+<string name="privacy_list_select_dialog_groups">Группы</string>
+<string name="privacy_list_select_dialog_delete">Удалить</string>
+<string name="privacy_list_delete_dialog_yes">Да</string>
+<string name="privacy_list_delete_dialog_no">Нет</string>
+
+<string name="UpdateButton">Обновить</string>
+
+<!-- Error messages -->
+
+<string name="error_login_authentication">Ошибка: неверно указан логин или пароль</string>
+
+<string name="interna_server_error">Ошибка сервера</string>
+<string name="remote_server_not_found">Сервер не найден</string>
+<string name="remote_server_timeout">Сервер не отвечает</string>
+<string name="remote_server_error">Ошибка сервера</string>
+</resources>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/values-sv/strings.xml Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,310 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+<!-- Generic terms -->
+<string name="app_name">Beem</string>
+<string name="OkButton">Ok</string>
+<string name="ClearButton">Töm</string>
+<string name="CancelButton">Avbryt</string>
+<string name="AcceptButton">Godkänn</string>
+<string name="RefuseButton">Neka</string>
+<string name="JabberID">Jabber-ID</string>
+<string name="Password">Lösenord</string>
+<string name="Continue">Fortsätt</string>
+
+<!-- AccountConfigure class -->
+<string name="AccountConfigureManualConfiguration">Manuell inställning</string>
+
+<!-- Beem class -->
+<string name="BeemJabberID">Jabber-ID</string>
+
+<!-- BeemApplication class -->
+<string name="BeemApplicationConnect">Ansluter...</string>
+
+<!-- BeemService class -->
+<string name="BeemServiceDescription">Använda tjänsten Beem</string>
+<string name="BeemServiceCreated">Beemtjänst skapad</string>
+<string name="BeemServiceDestroyed">Beemtjänst avslutad</string>
+
+<!-- ContactDialog class -->
+<string name="CDChat">Chatta</string>
+<string name="CDCall">Ring</string>
+<string name="CDInfos">Hantera kontakt</string>
+
+<!-- AddContact class -->
+<string name="AddCActTitle">Beem - Lägg till kontakt</string>
+
+<string name="AddCLogin">Användarnamn</string>
+<string name="AddCAlias">Alias</string>
+<string name="AddCGroup">Grupp</string>
+<string name="AddCOkButton">Lägg till</string>
+<string name="AddCContactAdded">Kontakt tillagd</string>
+<string name="AddCContactAddedError">Fel, kontakt inte tillagd</string>
+<string name="AddCContactAddedLoginError">Fel vid inloggning</string>
+<string name="AddCBadForm">Fel ifyllt</string>
+<string name="AddCContactAlready">Kontakten finns redan</string>
+
+<!-- ChangeStatus class -->
+<string name="ChangeStatusActTitle">Beem - Ändra status</string>
+<string name="ChangeStatusType">Min status</string>
+<string name="ChangeStatusMessage">Mitt personliga meddelande</string>
+<string name="OpenContactList">Öppna kontaktlista</string>
+
+<string name="MenuAddContact">Lägg till ny kontakt</string>
+<string name="MenuAccountAbout">Beemprojektet</string>
+<string name="MenuAccountCreate">Skapa konto</string>
+<string name="MenuConnection">Ändra konto</string>
+<string name="ChangeStatusOk">Uppdaterar status</string>
+<string name="ChangeStatusNoChange">Inget att ändra</string>
+
+<!-- Settings class -->
+<string name="SettingsText">Ändra ditt användarnamn</string>
+<string name="SettingsPassword">Ändra ditt lösenord</string>
+<string name="SettingsProxy">Proxy</string>
+<string name="SettingsProxyProxy">Använd proxyserver</string>
+<string name="SettingsProxySummary">Logga in via proxyserver</string>
+<string name="SettingsProxyType">Protokoll</string>
+<string name="SettingsProxyTypeSummary">Välj typ av proxyserver</string>
+<string name="SettingsProxyServer">Ändra proxyserveradress</string>
+<string name="SettingsProxyPort">Ändra proxyserverport</string>
+<string name="SettingsProxyUser">Valfritt, möjliggör autentisering på proxyservern</string>
+<string name="SettingsProxyPassword">Valfritt, möjliggör autentisering på proxyservern</string>
+<string name="SettingsAdvanced">Avancerat</string>
+<string name="SettingsAdvancedOptions">Specifika serverinställningar</string>
+<string name="SettingsAdvancedRecoDelay">Ändra tid mellan anslutningsförsök</string>
+<string name="SettingsAdvancedSpecOpt">Markera om du vill använda någon specifik server för anslutningen</string>
+<string name="SettingsAdvancedAddOpt">Ändra serveradress</string>
+<string name="SettingsAdvancedPortOpt">Ändra serverport</string>
+<string name="SettingsResourceTitle">Instans</string>
+<string name="SettingsPriorityTitle">Prioritet</string>
+<string name="SettingsResourceSummary">Ange XMPP-instans för denna klient</string>
+<string name="SettingsPrioritySummary">Ange prioritet för denna klient</string>
+<string name="contact_list_preferences">Kontaktlista</string>
+<string name="contact_list_preferences_sum">A set of display options for your buddy list
+</string>
+<string name="CLP_hide_groups">Dölj grupper</string>
+<string name="CLP_hide_groups_sum">Markera för att dölja grupper</string>
+<string name="CLP_hidden_contact">Dölj kontakter</string>
+<string name="CLP_hidden_contact_sum">Check this option to hide unconnected buddies
+</string>
+<string name="settings_account_username">Användarnamn</string>
+<string name="login_username_info_default">beem@beem-project.com</string>
+<string name="settings_account_password">Lösenord</string>
+<string name="settings_account_server">Server</string>
+<string name="settings_account_port">Port</string>
+<string name="settings_advanced_service_behaviour">Tjänstebeskrivning</string>
+<string name="settings_advanced_sum">Ett antal inställningar för avancerade användare</string>
+<string name="settings_xmpp_server">Adress</string>
+<string name="comments_xmpp_server">example.com</string>
+<string name="settings_xmpp_port">Port</string>
+<string name="settings_xmpp_use_tls">Kräv SSL/TLS</string>
+<string name="settings_reco_delay">Tid mellan anslutningsförsök</string>
+<string name="comments_xmpp_port">Förvalt: 5222</string>
+<string name="settings_proxy_sum">Inställningar för användning av proxy</string>
+<string name="settings_proxy_use">Anslut via proxy</string>
+<string name="settings_proxy_type_prompt">Välj typ av proxy</string>
+<string name="settings_proxy_server">Server</string>
+<string name="settings_proxy_port">Port</string>
+<string name="comments_proxy_port">Förvalt: 1080</string>
+<string name="settings_proxy_username">Användarnamn</string>
+<string name="settings_proxy_password">Lösenord</string>
+<string name="away_chk_title">Aktivera automatisk frånvaro</string>
+<string name="away_chk_sum">Ändra status till frånvarande när skärmen släcks</string>
+<string name="away_message_title">Frånvaromeddelande</string>
+<string name="away_message_sum">Frånvaromeddelandet som kommer att visas</string>
+<string name="away_message_hint">Jag är frånvarande, telefonens skärm är släckt</string>
+<string name="notification_preferences">Aviseringsinställningar</string>
+<string name="notification_enable_vibrate_title">Aktivera vibration</string>
+<string name="notification_enable_vibrate_sum">Aktivera vibration vid inkommande meddelande</string>
+<string name="notification_snd_title">Meddelandesignal</string>
+<string name="notification_snd_sum">Ange signal för inkommande meddelanden</string>
+
+
+<!-- Subscription class -->
+<string name="SubscriptAccept">Prenumeration godkänd</string>
+<string name="SubscriptError">Fel vid prenumeration</string>
+<string name="SubscriptRefused">Prenumeration nekad</string>
+<string name="SubscriptText">%s vill lägga till dig i sin kontaktlista. Godkänner du det?</string>
+<string name="SubscriptTitle">Godkänn kontakt?</string>
+
+<!-- BeemChatManager -->
+<string name="BeemChatManagerNewMessage">Du har ett nytt meddelande</string>
+
+<!-- BeemBroadcastReceiver class -->
+<string name="BeemBroadcastReceiverDisconnect">BEEM: Du är frånkopplad</string>
+
+<!-- XmppConnectionAdapter class -->
+<string name="AcceptContactRequest">%s har lagt till dig till sin kontaktlista.</string>
+<string name="AcceptContactRequestFrom">Godkänn att %s kontaktar dig.</string>
+
+<!-- Activities -->
+<string name="login_tag">Beem - Aktivitet inloggningar</string>
+<string name="edit_settings_name">Beem - Inställningar</string>
+<string name="edit_settings_tag">Beem - Aktivitet inställningar</string>
+<string name="create_account_name">Beem - Skapa konto</string>
+<string name="create_account_tag">Beem - Aktivitet skapa konto</string>
+<string name="contact_list_name">Beem - Kontakter</string>
+<string name="contact_list_tag">Beem - Aktivitet kontaktlista</string>
+<string name="user_info_name">Beem - Användarinfo</string>
+
+<!-- Buttons -->
+<string name="button_create_account">Skapa kontot</string>
+<string name="button_create_login_account">Skapa och använd kontot</string>
+
+<!-- LogAs Activity -->
+<string name="login_username">Användarnamn</string>
+<string name="login_password">Lösenord</string>
+<string name="login_error_dialog_title">Fel vid inloggning</string>
+<string name="login_close_dialog_button">Stäng</string>
+<string name="login_menu_create_account">Skapa konto</string>
+<string name="login_menu_settings">Inställningar</string>
+<string name="login_menu_about">Om</string>
+<string name="login_about_title">Beem %s - Om</string>
+<string name="login_about_msg">
+Beem is an EPITECH Innovative Project. Visit us at
+http://www.beem-project.com !
+</string>
+<string name="login_about_button">Stäng</string>
+<string name="login_settings_button">Inställningar</string>
+<string name="login_login_button">Logga in</string>
+<string name="login_login_progress">Ansluter. Vänta...</string>
+<string name="login_error_msg">Unfortunately, an error occured.\n\nError
+detail:\n%s</string>
+<string name="login_menu_login">Logga in</string>
+<string name="login_no_connectivity">Ingen internetanslutning hittades</string>
+<string name="login_start_msg">Inställningar i menyn</string>
+
+<!-- LoginAnim activity -->
+<string name="loganim_connecting">Ansluter...</string>
+<string name="loganim_authenticating">Verifierar...</string>
+<string name="loganim_login_success">Inloggningen lyckades</string>
+<string name="loganim_login_failed">Inloggningen misslyckades</string>
+
+<!-- EditSettings Activity -->
+<string name="settings_menu_create_account">Skapa konto</string>
+<string name="settings_menu_privacy_lists">Hantera spärrlistor</string>
+<string name="settings_saved_ok">Inställningarna har sparats.</string>
+
+
+
+<!-- EditSettings Activity Categories -->
+<string name="general_preferences">Allmänna inställningar</string>
+<string name="user_preferences">Användarinställningar (krävs)</string>
+<string name="user_preferences_advanced">Avancerade användarinställningar (valfritt)</string>
+<string name="network_preferences">Nätverksinställningar</string>
+<string name="proxy_proxy_settings">Proxyinställningar</string>
+<string name="proxy_user_settings">Proxyinställningar</string>
+
+<!-- EditSettings Activity Tabs -->
+<string name="settings_tab_tag_account">edit_settings_tab_account</string>
+<string name="settings_tab_label_account">Konto</string>
+<string name="settings_tab_tag_xmpp">edit_settings_tab_xmpp</string>
+<string name="settings_tab_label_xmpp">XMPP</string>
+<string name="settings_tab_tag_proxy">edit_settings_tab_proxy</string>
+<string name="settings_tab_label_proxy">Proxy</string>
+
+
+<!-- wizard activities -->
+<string name="account_wizard_text1"><b>Välkommen till BEEM.</b>\n\nDu har inte konfigurerat något XMPP (Jabber)-konto än.\nVälj ett av följande alternativ:</string>
+<string name="account_wizard_configure_text"><b>Fyll i uppgifterna för ditt befintliga konto</b></string>
+<string name="account_wizard_configure_account">Jag har redan ett konto som jag vill använda</string>
+<string name="account_wizard_create_account">Jag vill registrera ett nytt konto</string>
+
+<!-- Create an account Activity -->
+<string name="create_account_instr_dialog_title">Skapa konto - Instruktioner</string>
+<string name="create_account_err_dialog_title">Skapa konto - Fel</string>
+<string name="create_account_err_dialog_settings_button">Ändra inställningar</string>
+<string name="create_account_close_dialog_button">Stäng</string>
+<string name="create_account_successfull_after">kontot %s har skapats</string>
+<string name="create_account_err_username">Felaktigt Jabber-ID</string>
+<string name="create_account_err_passwords">Lösenorden är inte lika</string>
+<string name="create_account_username">Användarnamn</string>
+<string name="create_account_password">Lösenord</string>
+<string name="create_account_confirm_password">Bekräfta lösenordet</string>
+
+<!-- ContactList Activity -->
+<string name="contact_list_menu_add_contact">Lägg till kontakt</string>
+<string name="contact_list_menu_status">Ändra status</string>
+<string name="contact_list_menu_settings">Inställningar</string>
+<string name="contact_list_menu_disconnect">Koppla från</string>
+<string name="contact_list_all_contact">Alla kontakter</string>
+<string name="contact_list_no_group">Ingen grupp</string>
+
+<!-- UserInfo dialog -->
+<string name="userinfo_label_alias">Alias</string>
+<string name="userinfo_label_chg_group">Hantera grupper</string>
+<string name="userinfo_label_re_subscription">Skicka inbjudan igen</string>
+<string name="userinfo_label_block">Spärra</string>
+<string name="userinfo_label_delete">Ta bort</string>
+<string name="userinfo_resend">Skicka prenumeration igen</string>
+<string name="userinfo_sure2delete">Are you sure you want to delete this contact ?
+</string>
+<string name="userinfo_yes">Ja</string>
+<string name="userinfo_no">Nej</string>
+<string name="userinfo_sureresend">Är du säker på att du vill skicka prenumerationen igen?</string>
+
+<string name="chat_name">Beem - Chatt</string>
+<string name="chat_input_default_value">Skriv meddelande</string>
+<string name="chat_self">Jag</string>
+<string name="chat_error">Fel</string>
+<string name="chat_send_message">Skicka</string>
+<string name="chat_menu_contacts_list">Kontaktlista</string>
+<string name="chat_menu_change_chat">Byt chatt</string>
+<string name="chat_dialog_change_chat_title">Öppna chattar</string>
+<string name="chat_menu_close_chat">Stäng den här chatten</string>
+<string name="chat_no_more_chats">Inga fler aktiva chattar</string>
+<string name="chat_state_composing">skriver ett meddelande</string>
+<string name="chat_state_gone">har lämnat samtalet</string>
+<string name="chat_state_active">iakttar samtalet</string>
+<string name="chat_state_inactive">gör något annat</string>
+
+<string name="contact_status_msg_available">Tillgänglig</string>
+<string name="contact_status_msg_available_chat">Tillgänglig för chatt</string>
+<string name="contact_status_msg_dnd">Stör ej</string>
+<string name="contact_status_msg_away">Frånvarande</string>
+<string name="contact_status_msg_xa">Inte tillgänglig</string>
+<string name="contact_status_msg_offline">Frånkopplad</string>
+
+<string name="privacy_list_name">Beem - Hantera spärrlistor</string>
+<string name="privacy_list_no_data">Det finns inga spärrlistor.</string>
+<string name="privacy_list_menu_create">Skapa spärrlista</string>
+<string name="privacy_list_create_dialog_title">Skapa spärrlista</string>
+<string name="privacy_list_create_dialog_list_name_label">Titel</string>
+<string name="privacy_list_create_dialog_create_button">Skapa</string>
+<string name="privacy_list_select_dialog_buddies">Kontakter</string>
+<string name="privacy_list_select_dialog_groups">Grupper</string>
+<string name="privacy_list_select_dialog_delete">Ta bort</string>
+<string name="privacy_list_delete_dialog_msg">Vill du verkligen ta bort spärrlistan \'%s\'?</string>
+<string name="privacy_list_delete_dialog_yes">Ja</string>
+<string name="privacy_list_delete_dialog_no">Nej</string>
+
+<string name="UpdateButton">Uppdatera</string>
+
+<!-- Error messages -->
+
+<string name="error_login_authentication">Fel vid inloggning, fel ID eller lösenord</string>
+
+<string name="interna_server_error">Serverfel</string>
+<string name="bad_request">felaktig begäran</string>
+<string name="forbidden">otillåten</string>
+<string name="item_not_found">hittades inte</string>
+<string name="conflict">konflikt</string>
+<string name="feature_not_implemented">funktionen finns inte</string>
+<string name="gone">borta</string>
+<string name="jid_malformed">felaktigt JID</string>
+<string name="no_acceptable">accepteras inte</string>
+<string name="not_allowed">tillåts inte</string>
+<string name="not_authorized">inte godkänd</string>
+<string name="payment_required">betalning krävs</string>
+<string name="recipient_unavailable">mottagaren ej tillgänglig</string>
+<string name="redirect">vidarebefordra</string>
+<string name="registration_required">registrering krävs</string>
+<string name="remote_server_not_found">Servern hittades inte</string>
+<string name="remote_server_timeout">Servern svarar inte</string>
+<string name="remote_server_error">Serverfel</string>
+<string name="resource_constraint">begränsad instans</string>
+<string name="service_unavailable">tjänsten ej tillgänglig</string>
+<string name="subscription_required">prenumeration krävs</string>
+<string name="undefined_condition">odefinierat tillstånd</string>
+<string name="unexpected_condition">oväntat tillstånd</string>
+<string name="request_timeout">Timeoutbegäran</string>
+</resources>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/values-zh-rCN/strings.xml Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,306 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Generic terms -->
+ <string name="app_name">Beem</string>
+ <string name="OkButton">确定</string>
+ <string name="ClearButton">清除</string>
+ <string name="CancelButton">取消</string>
+ <string name="AcceptButton">认证</string>
+ <string name="RefuseButton">拒绝</string>
+ <string name="JabberID">Jabber账号 </string>
+ <string name="Password">密码</string>
+
+ <!-- Beem class -->
+ <string name="BeemJabberID">Jabber账号 </string>
+
+ <!-- BeemApplication class -->
+ <string name="BeemApplicationConnect">连接中...</string>
+
+ <!-- BeemService class -->
+ <string name="BeemServiceDescription">使用Beem服务</string>
+ <string name="BeemServiceCreated">Beem服务已创建</string>
+ <string name="BeemServiceDestroyed">Beem服务已取消</string>
+
+ <!-- ContactDialog class -->
+ <string name="CDChat">聊天</string>
+ <string name="CDCall">呼叫</string>
+ <string name="CDInfos">用户管理</string>
+
+ <!-- AddContact class -->
+ <string name="AddCActTitle">Beem - 添加连接</string>
+
+ <string name="AddCLogin">用户名</string>
+ <string name="AddCAlias">别名</string>
+ <string name="AddCGroup">组</string>
+ <string name="AddCOkButton">添加</string>
+ <string name="AddCContactAdded">联系人已成功添加</string>
+ <string name="AddCContactAddedError">联系人添加错误</string>
+ <string name="AddCContactAddedLoginError">登录错误</string>
+ <string name="AddCBadForm">格式错误</string>
+ <string name="AddCContactAlready">联系人已存在</string>
+
+ <!-- ChangeStatus class -->
+ <string name="ChangeStatusActTitle">Beem - 改变我的状态</string>
+ <string name="ChangeStatusType">我的状态</string>
+ <string name="ChangeStatusMessage">我的个人消息</string>
+ <string name="OpenContactList">打开联系人列表</string>
+
+ <string name="MenuAddContact">添加心联系人</string>
+ <string name="MenuAccountAbout">Beem项目</string>
+ <string name="MenuAccountCreate">创建账号</string>
+ <string name="MenuConnection">编辑账号</string>
+ <string name="ChangeStatusOk">更新状态</string>
+ <string name="ChangeStatusNoChange">没有东西需要改变</string>
+
+ <!-- Settings class -->
+ <string name="SettingsText">修改用户名</string>
+ <string name="SettingsPassword">修改密码</string>
+ <string name="SettingsProxy">代理</string>
+ <string name="SettingsProxyProxy">使用代理服务器</string>
+ <string name="SettingsProxySummary">通过代理服务器登录</string>
+ <string name="SettingsProxyType">协议</string>
+ <string name="SettingsProxyTypeSummary">选择代理类型</string>
+ <string name="SettingsProxyServer">修改代理服务器地址</string>
+ <string name="SettingsProxyPort">修改地理服务器端口</string>
+ <string name="SettingsProxyUser">可选,允许在代理服务器上注册</string>
+ <string name="SettingsProxyPassword">可选,允许在代理服务器上注册</string>
+ <string name="SettingsAdvanced">高级</string>
+ <string name="SettingsAdvancedOptions">特定服务器选项</string>
+ <string name="SettingsAdvancedRecoDelay">修改重连延时</string>
+ <string name="SettingsAdvancedSpecOpt">勾选此选项以连接到特定的服务器.</string>
+ <string name="SettingsAdvancedAddOpt">编辑服务器地址</string>
+ <string name="SettingsAdvancedPortOpt">编辑服务器端口</string>
+ <string name="SettingsResourceTitle">资源</string>
+ <string name="SettingsPriorityTitle">优先级</string>
+ <string name="SettingsResourceSummary">设定客户端XMPP资源</string>
+ <string name="SettingsPrioritySummary">设定客户端优先级</string>
+ <string name="contact_list_preferences">好友列表</string>
+ <string name="contact_list_preferences_sum">好友列表显示选项
+ </string>
+ <string name="CLP_hide_groups">隐藏组</string>
+ <string name="CLP_hide_groups_sum">勾选此选项隐藏组</string>
+ <string name="CLP_hidden_contact">隐藏好友</string>
+ <string name="CLP_hidden_contact_sum">勾选此选项隐藏未登录好友
+ </string>
+ <string name="settings_account_username">用户名</string>
+ <string name="login_username_info_default">beem@beem-project.com</string>
+ <string name="settings_account_password">密码</string>
+ <string name="settings_account_server">服务器</string>
+ <string name="settings_account_port">端口</string>
+ <string name="settings_advanced_service_behaviour">服务器行为</string>
+ <string name="settings_advanced_sum">高级用户设置</string>
+ <string name="settings_xmpp_server">地址</string>
+ <string name="comments_xmpp_server">example.com</string>
+ <string name="settings_xmpp_port">端口</string>
+ <string name="settings_xmpp_use_tls">使用SSL/TLS</string>
+ <string name="settings_reco_delay">重连延时</string>
+ <string name="comments_xmpp_port">默认端口:5222</string>
+ <string name="settings_proxy_sum">代理设置</string>
+ <string name="settings_proxy_use">使用代理连接</string>
+ <string name="settings_proxy_type_prompt">选择代理类型</string>
+ <string name="settings_proxy_server">服务器</string>
+ <string name="settings_proxy_port">端口</string>
+ <string name="comments_proxy_port">默认端口:1080</string>
+ <string name="settings_proxy_username">用户名</string>
+ <string name="settings_proxy_password">密码</string>
+ <string name="away_chk_title">启用自动离开</string>
+ <string name="away_chk_sum">当屏幕关闭是将状态改为离开</string>
+ <string name="away_message_title">离开留言</string>
+ <string name="away_message_sum">将会显示的离开留言</string>
+ <string name="away_message_hint">我现在不在,我的手机屏幕关闭了</string>
+ <string name="notification_preferences">通知设置</string>
+ <string name="notification_enable_vibrate_title">开启震动</string>
+ <string name="notification_enable_vibrate_sum">开启来信时的震动提示</string>
+ <string name="notification_snd_title">消息提示音</string>
+ <string name="notification_snd_sum">设定消息提示音</string>
+
+
+ <!-- Subscription class -->
+ <string name="SubscriptAccept">订阅已经接受</string>
+ <string name="SubscriptError">订阅错误</string>
+ <string name="SubscriptRefused">订阅被拒绝</string>
+ <string name="SubscriptText">%s 想要添加你到他/她的好友列表.批准他/她的请求吗?</string>
+ <string name="SubscriptTitle">批准好友请求?</string>
+
+ <!-- BeemChatManager -->
+ <string name="BeemChatManagerNewMessage">你有一个新消息</string>
+
+ <!-- BeemBroadcastReceiver class -->
+ <string name="BeemBroadcastReceiverDisconnect">BEEM:你的连接已断开</string>
+
+ <!-- XmppConnectionAdapter class -->
+ <string name="AcceptContactRequest">%s刚将你添加到他/她的好友列表.</string>
+ <string name="AcceptContactRequestFrom">批准%s联系你</string>
+
+ <!-- Activities -->
+ <string name="login_tag">Beem - 登录中</string>
+ <string name="edit_settings_name">Beem - 设置</string>
+ <string name="edit_settings_tag">Beem - 编制设置</string>
+ <string name="create_account_name">Beem - 创建新账号 </string>
+ <string name="create_account_tag">Beem - 创建新账号中</string>
+ <string name="contact_list_name">Beem - 联系人</string>
+ <string name="contact_list_tag">Beem - 联系人列表</string>
+ <string name="user_info_name">Beem - 用户信息</string>
+
+ <!-- Buttons -->
+ <string name="button_create_account">创建这个账户</string>
+ <string name="button_create_login_account">创建并使用这个账户</string>
+
+ <!-- LogAs Activity -->
+ <string name="login_username">用户名</string>
+ <string name="login_password">密码</string>
+ <string name="login_error_dialog_title">登录 - 错误</string>
+ <string name="login_close_dialog_button">关闭</string>
+ <string name="login_menu_create_account">创建一个账号</string>
+ <string name="login_menu_settings">设置</string>
+ <string name="login_menu_about">关于</string>
+ <string name="login_about_title">Beem %s - 关于</string>
+ <string name="login_about_msg">
+ Beem是一个欧洲理工学院的创新项目.访问我们的网站
+ http://www.beem-project.com !
+ </string>
+ <string name="login_about_button">关闭</string>
+ <string name="login_settings_button">设置</string>
+ <string name="login_login_button">登录</string>
+ <string name="login_login_progress">连接中,请等待...</string>
+ <string name="login_error_msg">很遗憾,发生一个错误.\n\nE错误
+ 详情:\n%s</string>
+ <string name="login_menu_login">登陆</string>
+ <string name="login_no_connectivity">没有可用连接</string>
+ <string name="login_start_msg">菜单设置配置</string>
+
+ <!-- LoginAnim activity -->
+ <string name="loganim_connecting">正在连接 ...</string>
+ <string name="loganim_authenticating">正在验证 ...</string>
+ <string name="loganim_login_success">登陆成功</string>
+ <string name="loganim_login_failed">登陆失败</string>
+
+ <!-- EditSettings Activity -->
+ <string name="settings_menu_create_account">创建一个账号</string>
+ <string name="settings_menu_privacy_lists">管理隐私列表</string>
+ <string name="settings_saved_ok">设置已成功保存</string>
+
+
+
+ <!-- EditSettings Activity Categories -->
+ <string name="general_preferences">通用选项</string>
+ <string name="user_preferences">用户设置 (必须)</string>
+ <string name="user_preferences_advanced">高级用户设置(可选)</string>
+ <string name="network_preferences">网络选项</string>
+ <string name="proxy_proxy_settings">代理选项</string>
+ <string name="proxy_user_settings">代理选项</string>
+
+ <!-- EditSettings Activity Tabs -->
+ <string name="settings_tab_tag_account">edit_settings_tab_account</string>
+ <string name="settings_tab_label_account">帐户</string>
+ <string name="settings_tab_tag_xmpp">edit_settings_tab_xmpp</string>
+ <string name="settings_tab_label_xmpp">XMPP</string>
+ <string name="settings_tab_tag_proxy">edit_settings_tab_proxy</string>
+ <string name="settings_tab_label_proxy">代理</string>
+
+
+ <!-- wizard activities -->
+ <string name="account_wizard_text1"><b>欢迎使用BEEM.</b>\n\n您还没有设定XMPP (Jabber)账户.请选择下面的选项。\n请选择下面的选项:</string>
+ <string name="account_wizard_configure_text"><b>请输入您已有账号的信息</b></string>
+ <string name="account_wizard_configure_account">我想使用我已有的账号</string>
+ <string name="account_wizard_create_account">我想创建一个新账号</string>
+
+ <!-- Create an account Activity -->
+ <string name="create_account_instr_dialog_title">创建新账号 - 向导</string>
+ <string name="create_account_err_dialog_title">创建新账号 - 错误</string>
+ <string name="create_account_err_dialog_settings_button">修改设置</string>
+ <string name="create_account_close_dialog_button">关闭</string>
+ <string name="create_account_successfull_after">账号%s已成功创建</string>
+ <string name="create_account_err_username">错误的Jabber ID</string>
+ <string name="create_account_err_passwords">密码不匹配。</string>
+ <string name="create_account_username">用户名</string>
+ <string name="create_account_password">密码</string>
+ <string name="create_account_confirm_password">确认密码</string>
+
+ <!-- ContactList Activity -->
+ <string name="contact_list_menu_add_contact">添加联系人</string>
+ <string name="contact_list_menu_status">更改状态</string>
+ <string name="contact_list_menu_settings">设置</string>
+ <string name="contact_list_menu_disconnect">断开连接</string>
+ <string name="contact_list_all_contact">所有联系人</string>
+ <string name="contact_list_no_group">没有组</string>
+
+ <!-- UserInfo dialog -->
+ <string name="userinfo_label_alias">别名</string>
+ <string name="userinfo_label_chg_group">管理组</string>
+ <string name="userinfo_label_re_subscription">重新发送邀请</string>
+ <string name="userinfo_label_block">阻止</string>
+ <string name="userinfo_label_delete">删除</string>
+ <string name="userinfo_resend">重新发送订阅</string>
+ <string name="userinfo_sure2delete">确定删除该联系人?
+ </string>
+ <string name="userinfo_yes">是</string>
+ <string name="userinfo_no">否</string>
+ <string name="userinfo_sureresend">确定要重新发送邀请吗?</string>
+
+ <string name="chat_name">Beem - 聊天</string>
+ <string name="chat_input_default_value">输入信息</string>
+ <string name="chat_self">我</string>
+ <string name="chat_error">错误</string>
+ <string name="chat_send_message">发送</string>
+ <string name="chat_menu_contacts_list">联系人列表</string>
+ <string name="chat_menu_change_chat">切换聊天窗口</string>
+ <string name="chat_dialog_change_chat_title">打开聊天窗口</string>
+ <string name="chat_menu_close_chat">关闭聊天窗口</string>
+ <string name="chat_no_more_chats">没有活动的聊天窗口</string>
+ <string name="chat_state_composing">正在输入信息</string>
+ <string name="chat_state_gone">已经离开了会话</string>
+ <string name="chat_state_active">关注会话</string>
+ <string name="chat_state_inactive">正在做其他事情</string>
+
+ <string name="contact_status_msg_available">我有空</string>
+ <string name="contact_status_msg_available_chat">我有空聊天</string>
+ <string name="contact_status_msg_dnd">请勿打扰</string>
+ <string name="contact_status_msg_away">离开</string>
+ <string name="contact_status_msg_xa">没有空</string>
+ <string name="contact_status_msg_offline">连接已断开</string>
+
+ <string name="privacy_list_name">Beem - 管理我的隐私列表</string>
+ <string name="privacy_list_no_data">没有隐私列表</string>
+ <string name="privacy_list_menu_create">创建隐私列表</string>
+ <string name="privacy_list_create_dialog_title">创建隐私列表</string>
+ <string name="privacy_list_create_dialog_list_name_label">标题</string>
+ <string name="privacy_list_create_dialog_create_button">创建</string>
+ <string name="privacy_list_select_dialog_buddies">好友</string>
+ <string name="privacy_list_select_dialog_groups">组</string>
+ <string name="privacy_list_select_dialog_delete">删除</string>
+ <string name="privacy_list_delete_dialog_msg">确定要删除 \'%s\'隐私列表吗 ?</string>
+ <string name="privacy_list_delete_dialog_yes">是</string>
+ <string name="privacy_list_delete_dialog_no">否</string>
+
+ <string name="UpdateButton">更新</string>
+
+ <!-- Error messages -->
+
+ <string name="error_login_authentication">验证时发生错误,用户名或者密码错误.</string>
+
+ <string name="interna_server_error">远程服务器错误</string>
+ <string name="bad_request">bad-request</string>
+ <string name="forbidden">被拒绝</string>
+ <string name="item_not_found">item-not-found</string>
+ <string name="conflict">冲突</string>
+ <string name="feature_not_implemented">feature-not-implemented</string>
+ <string name="gone">离开</string>
+ <string name="jid_malformed">jid-malformed</string>
+ <string name="no_acceptable">no-acceptable</string>
+ <string name="not_allowed">not-allowed</string>
+ <string name="not_authorized">not-authorized</string>
+ <string name="payment_required">payment-required</string>
+ <string name="recipient_unavailable">recipient-unavailable</string>
+ <string name="redirect">redirect</string>
+ <string name="registration_required">registration-required</string>
+ <string name="remote_server_not_found">未发现远程服务器</string>
+ <string name="remote_server_timeout">远程服务器未响应</string>
+ <string name="remote_server_error">远程服务器错误</string>
+ <string name="resource_constraint">resource-constraint</string>
+ <string name="service_unavailable">service-unavailable</string>
+ <string name="subscription_required">subscription-required</string>
+ <string name="undefined_condition">undefined-condition</string>
+ <string name="unexpected_condition">unexpected-condition</string>
+ <string name="request_timeout">request-timeout</string>
+</resources>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/values-zh-rTW/strings.xml Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,306 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Generic terms -->
+ <string name="app_name">Beem</string>
+ <string name="OkButton">確定</string>
+ <string name="ClearButton">清除</string>
+ <string name="CancelButton">取消</string>
+ <string name="AcceptButton">認證</string>
+ <string name="RefuseButton">拒絕</string>
+ <string name="JabberID">Jabber賬號 </string>
+ <string name="Password">密碼</string>
+
+ <!-- Beem class -->
+ <string name="BeemJabberID">Jabber賬號 </string>
+
+ <!-- BeemApplication class -->
+ <string name="BeemApplicationConnect">連接中...</string>
+
+ <!-- BeemService class -->
+ <string name="BeemServiceDescription">使用Beem服務</string>
+ <string name="BeemServiceCreated">Beem服務已建立</string>
+ <string name="BeemServiceDestroyed">Beem服務已取消</string>
+
+ <!-- ContactDialog class -->
+ <string name="CDChat">聊天</string>
+ <string name="CDCall">呼叫</string>
+ <string name="CDInfos">使用者管理</string>
+
+ <!-- AddContact class -->
+ <string name="AddCActTitle">Beem - 新增連接</string>
+
+ <string name="AddCLogin">使用者名</string>
+ <string name="AddCAlias">別名</string>
+ <string name="AddCGroup">組</string>
+ <string name="AddCOkButton">新增</string>
+ <string name="AddCContactAdded">聯繫人已成功新增</string>
+ <string name="AddCContactAddedError">聯繫人新增錯誤</string>
+ <string name="AddCContactAddedLoginError">登入錯誤</string>
+ <string name="AddCBadForm">格式錯誤</string>
+ <string name="AddCContactAlready">聯繫人已存在</string>
+
+ <!-- ChangeStatus class -->
+ <string name="ChangeStatusActTitle">Beem - 改變我的狀態</string>
+ <string name="ChangeStatusType">我的狀態</string>
+ <string name="ChangeStatusMessage">我的個人訊息</string>
+ <string name="OpenContactList">開啟聯繫人清單</string>
+
+ <string name="MenuAddContact">新增心聯繫人</string>
+ <string name="MenuAccountAbout">Beem項目</string>
+ <string name="MenuAccountCreate">建立賬號</string>
+ <string name="MenuConnection">編輯賬號</string>
+ <string name="ChangeStatusOk">更新狀態</string>
+ <string name="ChangeStatusNoChange">沒有東西需要改變</string>
+
+ <!-- Settings class -->
+ <string name="SettingsText">修改使用者名</string>
+ <string name="SettingsPassword">修改密碼</string>
+ <string name="SettingsProxy">代理</string>
+ <string name="SettingsProxyProxy">使用代理伺服器</string>
+ <string name="SettingsProxySummary">通過代理伺服器登入</string>
+ <string name="SettingsProxyType">協議</string>
+ <string name="SettingsProxyTypeSummary">選取代理類型</string>
+ <string name="SettingsProxyServer">修改代理伺服器位址</string>
+ <string name="SettingsProxyPort">修改地理伺服器通訊埠</string>
+ <string name="SettingsProxyUser">可選,允許在代理伺服器上註冊</string>
+ <string name="SettingsProxyPassword">可選,允許在代理伺服器上註冊</string>
+ <string name="SettingsAdvanced">進階</string>
+ <string name="SettingsAdvancedOptions">特定伺服器選項</string>
+ <string name="SettingsAdvancedRecoDelay">修改重連延時</string>
+ <string name="SettingsAdvancedSpecOpt">勾選此選項以連接到特定的伺服器.</string>
+ <string name="SettingsAdvancedAddOpt">編輯伺服器位址</string>
+ <string name="SettingsAdvancedPortOpt">編輯伺服器通訊埠</string>
+ <string name="SettingsResourceTitle">資源</string>
+ <string name="SettingsPriorityTitle">優先級</string>
+ <string name="SettingsResourceSummary">設定用戶端XMPP資源</string>
+ <string name="SettingsPrioritySummary">設定用戶端優先級</string>
+ <string name="contact_list_preferences">好友清單</string>
+ <string name="contact_list_preferences_sum">好友清單顯示選項
+ </string>
+ <string name="CLP_hide_groups">隱藏組</string>
+ <string name="CLP_hide_groups_sum">勾選此選項隱藏組</string>
+ <string name="CLP_hidden_contact">隱藏好友</string>
+ <string name="CLP_hidden_contact_sum">勾選此選項隱藏未登入好友
+ </string>
+ <string name="settings_account_username">使用者名</string>
+ <string name="login_username_info_default">beem@beem-project.com</string>
+ <string name="settings_account_password">密碼</string>
+ <string name="settings_account_server">伺服器</string>
+ <string name="settings_account_port">通訊埠</string>
+ <string name="settings_advanced_service_behaviour">伺服器行為</string>
+ <string name="settings_advanced_sum">進階使用者設定</string>
+ <string name="settings_xmpp_server">位址</string>
+ <string name="comments_xmpp_server">example.com</string>
+ <string name="settings_xmpp_port">通訊埠</string>
+ <string name="settings_xmpp_use_tls">使用SSL/TLS</string>
+ <string name="settings_reco_delay">重連延時</string>
+ <string name="comments_xmpp_port">預設通訊埠:5222</string>
+ <string name="settings_proxy_sum">代理設定</string>
+ <string name="settings_proxy_use">使用代理連接</string>
+ <string name="settings_proxy_type_prompt">選取代理類型</string>
+ <string name="settings_proxy_server">伺服器</string>
+ <string name="settings_proxy_port">通訊埠</string>
+ <string name="comments_proxy_port">預設通訊埠:1080</string>
+ <string name="settings_proxy_username">使用者名</string>
+ <string name="settings_proxy_password">密碼</string>
+ <string name="away_chk_title">啟用自動離開</string>
+ <string name="away_chk_sum">當屏幕關閉是將狀態改為離開</string>
+ <string name="away_message_title">離開留言</string>
+ <string name="away_message_sum">將會顯示的離開留言</string>
+ <string name="away_message_hint">我現在不在,我的手機屏幕關閉了</string>
+ <string name="notification_preferences">通知設定</string>
+ <string name="notification_enable_vibrate_title">開啟震動</string>
+ <string name="notification_enable_vibrate_sum">開啟來信時的震動提示</string>
+ <string name="notification_snd_title">訊息提示音</string>
+ <string name="notification_snd_sum">設定訊息提示音</string>
+
+
+ <!-- Subscription class -->
+ <string name="SubscriptAccept">訂閱已經接受</string>
+ <string name="SubscriptError">訂閱錯誤</string>
+ <string name="SubscriptRefused">訂閱被拒絕</string>
+ <string name="SubscriptText">%s 想要新增你到他/她的好友清單.批准他/她的要求嗎?</string>
+ <string name="SubscriptTitle">批准好友要求?</string>
+
+ <!-- BeemChatManager -->
+ <string name="BeemChatManagerNewMessage">你有一個新訊息</string>
+
+ <!-- BeemBroadcastReceiver class -->
+ <string name="BeemBroadcastReceiverDisconnect">BEEM:你的連接已中斷</string>
+
+ <!-- XmppConnectionAdapter class -->
+ <string name="AcceptContactRequest">%s剛將你新增到他/她的好友清單.</string>
+ <string name="AcceptContactRequestFrom">批准%s聯繫你</string>
+
+ <!-- Activities -->
+ <string name="login_tag">Beem - 登入中</string>
+ <string name="edit_settings_name">Beem - 設定</string>
+ <string name="edit_settings_tag">Beem - 編製設定</string>
+ <string name="create_account_name">Beem - 建立新賬號 </string>
+ <string name="create_account_tag">Beem - 建立新賬號中</string>
+ <string name="contact_list_name">Beem - 聯繫人</string>
+ <string name="contact_list_tag">Beem - 聯繫人清單</string>
+ <string name="user_info_name">Beem - 使用者訊息</string>
+
+ <!-- Buttons -->
+ <string name="button_create_account">建立這個賬戶</string>
+ <string name="button_create_login_account">建立並使用這個賬戶</string>
+
+ <!-- LogAs Activity -->
+ <string name="login_username">使用者名</string>
+ <string name="login_password">密碼</string>
+ <string name="login_error_dialog_title">登入 - 錯誤</string>
+ <string name="login_close_dialog_button">關閉</string>
+ <string name="login_menu_create_account">建立一個賬號</string>
+ <string name="login_menu_settings">設定</string>
+ <string name="login_menu_about">關於</string>
+ <string name="login_about_title">Beem %s - 關於</string>
+ <string name="login_about_msg">
+ Beem是一個歐洲理工學院的創新項目.存取我們的網站
+ http://www.beem-project.com !
+ </string>
+ <string name="login_about_button">關閉</string>
+ <string name="login_settings_button">設定</string>
+ <string name="login_login_button">登入</string>
+ <string name="login_login_progress">連接中,請等待...</string>
+ <string name="login_error_msg">很遺憾,發生一個錯誤.\n\nE錯誤
+ 詳情:\n%s</string>
+ <string name="login_menu_login">登陸</string>
+ <string name="login_no_connectivity">沒有可用連接</string>
+ <string name="login_start_msg">選單設定設定</string>
+
+ <!-- LoginAnim activity -->
+ <string name="loganim_connecting">正在連接 ...</string>
+ <string name="loganim_authenticating">正在驗證 ...</string>
+ <string name="loganim_login_success">登陸成功</string>
+ <string name="loganim_login_failed">登陸失敗</string>
+
+ <!-- EditSettings Activity -->
+ <string name="settings_menu_create_account">建立一個賬號</string>
+ <string name="settings_menu_privacy_lists">管理隱私清單</string>
+ <string name="settings_saved_ok">設定已成功儲存</string>
+
+
+
+ <!-- EditSettings Activity Categories -->
+ <string name="general_preferences">通用選項</string>
+ <string name="user_preferences">使用者設定 (必須)</string>
+ <string name="user_preferences_advanced">進階使用者設定(可選)</string>
+ <string name="network_preferences">網路選項</string>
+ <string name="proxy_proxy_settings">代理選項</string>
+ <string name="proxy_user_settings">代理選項</string>
+
+ <!-- EditSettings Activity Tabs -->
+ <string name="settings_tab_tag_account">edit_settings_tab_account</string>
+ <string name="settings_tab_label_account">帳戶</string>
+ <string name="settings_tab_tag_xmpp">edit_settings_tab_xmpp</string>
+ <string name="settings_tab_label_xmpp">XMPP</string>
+ <string name="settings_tab_tag_proxy">edit_settings_tab_proxy</string>
+ <string name="settings_tab_label_proxy">代理</string>
+
+
+ <!-- wizard activities -->
+ <string name="account_wizard_text1"><b>歡迎使用BEEM.</b>\n\n您還沒有設定XMPP (Jabber)賬戶.請選取下面的選項。\n請選取下面的選項:</string>
+ <string name="account_wizard_configure_text"><b>請輸入您已有賬號的訊息</b></string>
+ <string name="account_wizard_configure_account">我想使用我已有的賬號</string>
+ <string name="account_wizard_create_account">我想建立一個新賬號</string>
+
+ <!-- Create an account Activity -->
+ <string name="create_account_instr_dialog_title">建立新賬號 - 嚮導</string>
+ <string name="create_account_err_dialog_title">建立新賬號 - 錯誤</string>
+ <string name="create_account_err_dialog_settings_button">修改設定</string>
+ <string name="create_account_close_dialog_button">關閉</string>
+ <string name="create_account_successfull_after">賬號%s已成功建立</string>
+ <string name="create_account_err_username">錯誤的Jabber ID</string>
+ <string name="create_account_err_passwords">密碼不符合。</string>
+ <string name="create_account_username">使用者名</string>
+ <string name="create_account_password">密碼</string>
+ <string name="create_account_confirm_password">確認密碼</string>
+
+ <!-- ContactList Activity -->
+ <string name="contact_list_menu_add_contact">新增聯繫人</string>
+ <string name="contact_list_menu_status">變更狀態</string>
+ <string name="contact_list_menu_settings">設定</string>
+ <string name="contact_list_menu_disconnect">中斷連接</string>
+ <string name="contact_list_all_contact">所有聯繫人</string>
+ <string name="contact_list_no_group">沒有組</string>
+
+ <!-- UserInfo dialog -->
+ <string name="userinfo_label_alias">別名</string>
+ <string name="userinfo_label_chg_group">管理組</string>
+ <string name="userinfo_label_re_subscription">重新傳送邀請</string>
+ <string name="userinfo_label_block">阻止</string>
+ <string name="userinfo_label_delete">刪除</string>
+ <string name="userinfo_resend">重新傳送訂閱</string>
+ <string name="userinfo_sure2delete">確定刪除該聯繫人?
+ </string>
+ <string name="userinfo_yes">是</string>
+ <string name="userinfo_no">否</string>
+ <string name="userinfo_sureresend">確定要重新傳送邀請嗎?</string>
+
+ <string name="chat_name">Beem - 聊天</string>
+ <string name="chat_input_default_value">輸入訊息</string>
+ <string name="chat_self">我</string>
+ <string name="chat_error">錯誤</string>
+ <string name="chat_send_message">傳送</string>
+ <string name="chat_menu_contacts_list">聯繫人清單</string>
+ <string name="chat_menu_change_chat">切換聊天視窗</string>
+ <string name="chat_dialog_change_chat_title">開啟聊天視窗</string>
+ <string name="chat_menu_close_chat">關閉聊天視窗</string>
+ <string name="chat_no_more_chats">沒有活動的聊天視窗</string>
+ <string name="chat_state_composing">正在輸入訊息</string>
+ <string name="chat_state_gone">已經離開了會話</string>
+ <string name="chat_state_active">關注會話</string>
+ <string name="chat_state_inactive">正在做其他事情</string>
+
+ <string name="contact_status_msg_available">我有空</string>
+ <string name="contact_status_msg_available_chat">我有空聊天</string>
+ <string name="contact_status_msg_dnd">請勿打擾</string>
+ <string name="contact_status_msg_away">離開</string>
+ <string name="contact_status_msg_xa">沒有空</string>
+ <string name="contact_status_msg_offline">連接已中斷</string>
+
+ <string name="privacy_list_name">Beem - 管理我的隱私清單</string>
+ <string name="privacy_list_no_data">沒有隱私清單</string>
+ <string name="privacy_list_menu_create">建立隱私清單</string>
+ <string name="privacy_list_create_dialog_title">建立隱私清單</string>
+ <string name="privacy_list_create_dialog_list_name_label">標題</string>
+ <string name="privacy_list_create_dialog_create_button">建立</string>
+ <string name="privacy_list_select_dialog_buddies">好友</string>
+ <string name="privacy_list_select_dialog_groups">組</string>
+ <string name="privacy_list_select_dialog_delete">刪除</string>
+ <string name="privacy_list_delete_dialog_msg">確定要刪除 \'%s\'隱私清單嗎 ?</string>
+ <string name="privacy_list_delete_dialog_yes">是</string>
+ <string name="privacy_list_delete_dialog_no">否</string>
+
+ <string name="UpdateButton">更新</string>
+
+ <!-- Error messages -->
+
+ <string name="error_login_authentication">驗證時發生錯誤,使用者名或者密碼錯誤.</string>
+
+ <string name="interna_server_error">遠端伺服器錯誤</string>
+ <string name="bad_request">bad-request</string>
+ <string name="forbidden">被拒絕</string>
+ <string name="item_not_found">item-not-found</string>
+ <string name="conflict">衝突</string>
+ <string name="feature_not_implemented">feature-not-implemented</string>
+ <string name="gone">離開</string>
+ <string name="jid_malformed">jid-malformed</string>
+ <string name="no_acceptable">no-acceptable</string>
+ <string name="not_allowed">not-allowed</string>
+ <string name="not_authorized">not-authorized</string>
+ <string name="payment_required">payment-required</string>
+ <string name="recipient_unavailable">recipient-unavailable</string>
+ <string name="redirect">redirect</string>
+ <string name="registration_required">registration-required</string>
+ <string name="remote_server_not_found">未發現遠端伺服器</string>
+ <string name="remote_server_timeout">遠端伺服器未響應</string>
+ <string name="remote_server_error">遠端伺服器錯誤</string>
+ <string name="resource_constraint">resource-constraint</string>
+ <string name="service_unavailable">service-unavailable</string>
+ <string name="subscription_required">subscription-required</string>
+ <string name="undefined_condition">undefined-condition</string>
+ <string name="unexpected_condition">unexpected-condition</string>
+ <string name="request_timeout">request-timeout</string>
+</resources>
--- a/res/values/arrays.xml Sun Feb 14 17:25:38 2010 +0100
+++ b/res/values/arrays.xml Sat Dec 25 17:01:00 2010 +0100
@@ -6,12 +6,12 @@
<item>SOCKS5</item>
</string-array>
<string-array name="status_types">
- <item name="AvailableForChat">Available to chat</item>
- <item name="Available">Available</item>
- <item name="Busy">Busy</item>
- <item name="Away">Away</item>
- <item name="Unavailable">Unavailable</item>
- <item name="Disconnected">Disconnected</item>
+ <item name="AvailableForChat">@string/contact_status_msg_available_chat</item>
+ <item name="Available">@string/contact_status_msg_available</item>
+ <item name="Busy">@string/contact_status_msg_dnd</item>
+ <item name="Away">@string/contact_status_msg_away</item>
+ <item name="Unavailable">@string/contact_status_msg_xa</item>
+ <item name="Disconnected">@string/contact_status_msg_offline</item>
</string-array>
<string-array name="privacy_list_select_dialog">
<item name="@string/privacy_list_select_dialog_buddies">Buddies</item>
@@ -19,9 +19,9 @@
<item name="@string/privacy_list_select_dialog_delete">Delete</item>
</string-array>
<string-array name="loganim_state">
- <item name="@string/loganim_connecting">Connecting...</item>
- <item name="@string/loganim_authenticating">Authenticating...</item>
- <item name="@string/loganim_login_success">Login success</item>
- <item name="@string/loganim_login_failed">Login failed</item>
+ <item>@string/loganim_connecting</item>
+ <item>@string/loganim_authenticating</item>
+ <item>@string/loganim_login_success</item>
+ <item>@string/loganim_login_failed</item>
</string-array>
</resources>
--- a/res/values/strings.xml Sun Feb 14 17:25:38 2010 +0100
+++ b/res/values/strings.xml Sat Dec 25 17:01:00 2010 +0100
@@ -1,11 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
+ <!-- Generic terms -->
<string name="app_name">Beem</string>
<string name="OkButton">Ok</string>
<string name="ClearButton">Clear</string>
<string name="CancelButton">Cancel</string>
<string name="AcceptButton">Authorize</string>
<string name="RefuseButton">Deny</string>
+ <string name="JabberID">Jabber ID</string>
+ <string name="Password">Password</string>
+ <string name="Continue">Continue</string>
+
+ <!-- AccountConfigure class -->
+ <string name="AccountConfigureManualConfiguration">Manual Configuration</string>
<!-- Beem class -->
<string name="BeemJabberID">Jabber ID</string>
@@ -18,22 +25,6 @@
<string name="BeemServiceCreated">Beem Service Created</string>
<string name="BeemServiceDestroyed">Beem Service Destroyed</string>
- <!-- Preferences informations -->
- <string name="PreferenceStatus">Status</string>
- <string name="PreferenceStatusText">status_text</string>
- <string name="PreferenceIsConfigured">preference_is_configured
- </string>
-
- <!-- ContactListSettings class -->
- <string name="CLSServerConnection">Server connection</string>
- <string name="CLSUserid">User id:</string>
- <string name="CLSPassword">Password:</string>
- <string name="CLSService">Service:</string>
- <string name="CLSHostPort">Port:</string>
- <string name="CLSProxyInfo">Proxy informations</string>
- <string name="CLSLogin">Login:</string>
- <string name="CLSOkButton">Ok</string>
-
<!-- ContactDialog class -->
<string name="CDChat">Chat</string>
<string name="CDCall">Call</string>
@@ -52,26 +43,11 @@
<string name="AddCBadForm">Bad form</string>
<string name="AddCContactAlready">Contact already exist</string>
- <!-- SendIM class -->
- <string name="SendIMActTitle">Beem - Chat</string>
-
- <string name="SendIMSays"> %s says :\n%s\n</string>
- <string name="SendIMYouSay">You say :\n%s\n</string>
- <string name="SendIMSameSpeaker">%s\n</string>
- <string name="SendIMToSendHint">Tip text here</string>
- <string name="SendIMState">Is : </string>
- <string name="SendIMErrorMsg">Error : %s\n</string>
- <string name="SendIMFrom">and is speaking from : </string>
- <string name="SendIMSmiley">Insert a smiley</string>
- <string name="SendIMLoginHint">login</string>
- <string name="SendIMNoStatusSet">No status set</string>
-
<!-- ChangeStatus class -->
<string name="ChangeStatusActTitle">Beem - Change my status</string>
<string name="ChangeStatusType">My status</string>
<string name="ChangeStatusMessage">My personal message</string>
<string name="OpenContactList">Open contact list</string>
-
<string name="MenuAddContact">Add new contact</string>
<string name="MenuAccountAbout">Beem Project</string>
@@ -83,8 +59,6 @@
<!-- Settings class -->
<string name="SettingsText">Edit your username</string>
<string name="SettingsPassword">Edit your password</string>
- <string name="SettingsCheckboxText">Using Gmail</string>
- <string name="SettingsGmail">Use my Gmail account</string>
<string name="SettingsProxy">Proxy</string>
<string name="SettingsProxyProxy">Use a proxy server</string>
<string name="SettingsProxySummary">Login through a proxy server</string>
@@ -104,6 +78,46 @@
<string name="SettingsPriorityTitle">Priority</string>
<string name="SettingsResourceSummary">Set the XMPP resource of your client </string>
<string name="SettingsPrioritySummary">Set the priority of your client</string>
+ <string name="contact_list_preferences">Buddy list</string>
+ <string name="contact_list_preferences_sum">A set of display options for your buddy list
+ </string>
+ <string name="CLP_hide_groups">Hide groups</string>
+ <string name="CLP_hide_groups_sum">Check this option to hide groups</string>
+ <string name="CLP_hidden_contact">Hide buddies</string>
+ <string name="CLP_hidden_contact_sum">Check this option to hide unconnected buddies
+ </string>
+ <string name="settings_account_username">Username</string>
+ <string name="login_username_info_default">beem@beem-project.com</string>
+ <string name="settings_account_password">Password</string>
+ <string name="settings_account_server">Server</string>
+ <string name="settings_account_port">Port</string>
+ <string name="settings_advanced_service_behaviour">Service behaviour</string>
+ <string name="settings_advanced_sum">A set of options for advanced users</string>
+ <string name="settings_xmpp_server">Address</string>
+ <string name="comments_xmpp_server">example.com</string>
+ <string name="settings_xmpp_port">Port</string>
+ <string name="settings_xmpp_use_tls">Require SSL/TLS</string>
+ <string name="settings_reco_delay">Reconnection delay</string>
+ <string name="comments_xmpp_port">Default: 5222</string>
+ <string name="settings_proxy_sum">Settings for proxy usage</string>
+ <string name="settings_proxy_use">Connect using a proxy</string>
+ <string name="settings_proxy_type_prompt">Choose a type of proxy</string>
+ <string name="settings_proxy_server">Server</string>
+ <string name="settings_proxy_port">Port</string>
+ <string name="comments_proxy_port">Default: 1080</string>
+ <string name="settings_proxy_username">Username</string>
+ <string name="settings_proxy_password">Password</string>
+ <string name="away_chk_title">Enable Auto-away</string>
+ <string name="away_chk_sum">Change status to Away when the screen is turned off</string>
+ <string name="away_message_title">Away message</string>
+ <string name="away_message_sum">The away message that will be displayed</string>
+ <string name="away_message_hint">I\'m away, my cellphone screen is off</string>
+ <string name="notification_preferences">Notification settings</string>
+ <string name="notification_enable_vibrate_title">Enable vibrate</string>
+ <string name="notification_enable_vibrate_sum">Enable vibrate on incoming messages</string>
+ <string name="notification_snd_title">Message ringtone</string>
+ <string name="notification_snd_sum">Set your incoming message ringtone</string>
+
<!-- Subscription class -->
<string name="SubscriptAccept">Subscription accepted</string>
@@ -112,9 +126,6 @@
<string name="SubscriptText">%s wants to add you to his/her buddy list. Do you want to authorize him/her ?</string>
<string name="SubscriptTitle">Authorize buddy ?</string>
- <!-- ContactList class -->
- <string name="ConListNotConnected">Not connected</string>
-
<!-- BeemChatManager -->
<string name="BeemChatManagerNewMessage">You\'ve a new message</string>
@@ -137,9 +148,6 @@
<string name="call_screen">Beem - Call Screen</string>
<!-- Buttons -->
- <string name="button_reset">Reset</string>
- <string name="button_login">Login</string>
- <string name="button_save">Save</string>
<string name="button_create_account">Create this account</string>
<string name="button_create_login_account">Create and use this account</string>
@@ -160,13 +168,18 @@
<string name="login_settings_button">Settings</string>
<string name="login_login_button">Log in</string>
<string name="login_login_progress">Connecting. Please wait...</string>
- <string name="login_max_retry">Max retry</string>
<string name="login_error_msg">Unfortunately, an error occured.\n\nError
detail:\n%s</string>
<string name="login_menu_login">Login</string>
<string name="login_no_connectivity">No internet connection found</string>
<string name="login_start_msg">Settings configuration in menu</string>
+ <!-- LoginAnim activity -->
+ <string name="loganim_connecting">Connecting ...</string>
+ <string name="loganim_authenticating">Authenticating ...</string>
+ <string name="loganim_login_success">Login success</string>
+ <string name="loganim_login_failed">Login failed</string>
+
<!-- EditSettings Activity -->
<string name="settings_menu_create_account">Create an account</string>
<string name="settings_menu_privacy_lists">Manage my privacy lists</string>
@@ -190,43 +203,12 @@
<string name="settings_tab_tag_proxy">edit_settings_tab_proxy</string>
<string name="settings_tab_label_proxy">Proxy</string>
- <!-- EditSettings Activity General Preferences Tabs -->
- <string name="contact_list_preferences">Buddy list</string>
- <string name="contact_list_preferences_sum">A set of display options for your buddy list
- </string>
-
- <string name="CLP_hide_groups">Hide groups</string>
- <string name="CLP_hide_groups_sum">Check this option to hide groups</string>
- <string name="CLP_hidden_contact">Hide buddies</string>
- <string name="CLP_hidden_contact_sum">Check this option to hide unconnected buddies
- </string>
- <!-- EditSettings Activity Account tab -->
- <string name="settings_account_username">Username</string>
- <string name="login_username_info_default">beem@beem-project.com</string>
- <string name="settings_account_password">Password</string>
- <string name="settings_account_server">Server</string>
- <string name="settings_account_port">Port</string>
-
- <!-- EditSettings Activity Advanced Options tab -->
- <string name="settings_advanced_service_behaviour">Service behaviour</string>
- <string name="settings_advanced_sum">A set of options for advanced users</string>
- <string name="settings_xmpp_server">Address</string>
- <string name="comments_xmpp_server">example.com</string>
- <string name="settings_xmpp_port">Port</string>
- <string name="settings_xmpp_use_tls">Require SSL/TLS</string>
- <string name="settings_reco_delay">Reconnection delay</string>
- <string name="comments_xmpp_port">Default: 5222</string>
-
- <!-- EditSettings Activity Proxy tab -->
- <string name="settings_proxy_sum">Settings for proxy usage</string>
- <string name="settings_proxy_use">Connect using a proxy</string>
- <string name="settings_proxy_type_prompt">Choose a type of proxy</string>
- <string name="settings_proxy_server">Server</string>
- <string name="settings_proxy_port">Port</string>
- <string name="comments_proxy_port">Default: 1080</string>
- <string name="settings_proxy_username">Username</string>
- <string name="settings_proxy_password">Password</string>
+ <!-- wizard activities -->
+ <string name="account_wizard_text1"><b>Welcome on BEEM.</b>\n\nYou have not configured an XMPP (Jabber) account yet.\nChoose one of the following options :</string>
+ <string name="account_wizard_configure_text"><b>Please fill in the data for your existing account</b></string>
+ <string name="account_wizard_configure_account">I already have an account I want to use</string>
+ <string name="account_wizard_create_account">I want to register for a new account</string>
<!-- Create an account Activity -->
<string name="create_account_instr_dialog_title">Create an account - Instructions</string>
@@ -242,7 +224,9 @@
<!-- ContactList Activity -->
<string name="contact_list_menu_add_contact">Add a contact</string>
+ <string name="contact_list_menu_status">Change status</string>
<string name="contact_list_menu_settings">Settings</string>
+ <string name="contact_list_menu_disconnect">Disconnect</string>
<string name="contact_list_all_contact">All contacts</string>
<string name="contact_list_no_group">No group</string>
@@ -269,6 +253,10 @@
<string name="chat_dialog_change_chat_title">Opened chats</string>
<string name="chat_menu_close_chat">Close this chat</string>
<string name="chat_no_more_chats">No more active chats</string>
+ <string name="chat_state_composing">is composing a message</string>
+ <string name="chat_state_gone">has left the conversation</string>
+ <string name="chat_state_active">pays attention to the conversation</string>
+ <string name="chat_state_inactive">is doing another thing</string>
<string name="contact_status_msg_available">Available</string>
<string name="contact_status_msg_available_chat">Available to chat</string>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/BeemApplication.java Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,161 @@
+/*
+ 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 android.app.Application;
+import android.content.SharedPreferences;
+import android.preference.PreferenceManager;
+
+/**
+ * This class contains informations that needs to be global in the application.
+ * Theses informations must be necessary for the activities and the service.
+ * @author Da Risk <darisk972@gmail.com>
+ */
+public class BeemApplication extends Application {
+
+ /* Constants for PREFERENCE_KEY
+ * The format of the Preference key is :
+ * $name_KEY = "$name"
+ */
+ /** Preference key for account username. */
+ public static final String ACCOUNT_USERNAME_KEY = "account_username";
+ /** Preference key for account password. */
+ public static final String ACCOUNT_PASSWORD_KEY = "account_password";
+ /** Preference key for status (available, busy, away, ...). */
+ public static final String STATUS_KEY = "status";
+ /** Preference key for status message. */
+ public static final String STATUS_TEXT_KEY = "status_text";
+ /** Preference key for the use of a proxy. */
+ public static final String PROXY_USE_KEY = "proxy_use";
+ /** Preference key for the type of proxy. */
+ public static final String PROXY_TYPE_KEY = "proxy_type";
+ /** Preference key for the proxy server. */
+ public static final String PROXY_SERVER_KEY = "proxy_server";
+ /** Preference key for the proxy port. */
+ public static final String PROXY_PORT_KEY = "proxy_port";
+ /** Preference key for the proxy username. */
+ public static final String PROXY_USERNAME_KEY = "proxy_username";
+ /** Preference key for the proxy password. */
+ public static final String PROXY_PASSWORD_KEY = "proxy_password";
+ /** Preference key for vibrate on notification. */
+ public static final String NOTIFICATION_VIBRATE_KEY = "notification_vibrate";
+ /** Preference key for notification sound. */
+ public static final String NOTIFICATION_SOUND_KEY = "notification_sound";
+
+ //TODO add the other one
+
+ private boolean mIsConnected;
+ private boolean mIsAccountConfigured;
+ private SharedPreferences mSettings;
+ private final PreferenceListener mPreferenceListener = new PreferenceListener();
+
+ /**
+ * Constructor.
+ */
+ public BeemApplication() {
+ }
+
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ mSettings = PreferenceManager.getDefaultSharedPreferences(this);
+ String login = mSettings.getString(BeemApplication.ACCOUNT_USERNAME_KEY, "");
+ String password = mSettings.getString(BeemApplication.ACCOUNT_PASSWORD_KEY, "");
+ mIsAccountConfigured = !("".equals(login) || "".equals(password));
+ mSettings.registerOnSharedPreferenceChangeListener(mPreferenceListener);
+ }
+
+ @Override
+ public void onTerminate() {
+ super.onTerminate();
+ mSettings.unregisterOnSharedPreferenceChangeListener(mPreferenceListener);
+
+ }
+
+ /**
+ * Tell if Beem is connected to a XMPP server.
+ * @return false if not connected.
+ */
+ public boolean isConnected() {
+ return mIsConnected;
+ }
+
+ /**
+ * Set the status of the connection to a XMPP server of BEEM.
+ * @param isConnected set for the state of the connection.
+ */
+ public void setConnected(boolean isConnected) {
+ mIsConnected = isConnected;
+ }
+
+ /**
+ * Tell if a XMPP account is configured.
+ * @return false if there is no account configured.
+ */
+ public boolean isAccountConfigured() {
+ return mIsAccountConfigured;
+ }
+
+ /**
+ * A listener for all the change in the preference file. It is used to maintain the global state of the application.
+ */
+ private class PreferenceListener implements SharedPreferences.OnSharedPreferenceChangeListener {
+
+ /**
+ * Constructor.
+ */
+ public PreferenceListener() {
+ }
+
+ @Override
+ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
+ if (BeemApplication.ACCOUNT_USERNAME_KEY.equals(key) || BeemApplication.ACCOUNT_PASSWORD_KEY.equals(key)) {
+ String login = mSettings.getString(BeemApplication.ACCOUNT_USERNAME_KEY, "");
+ String password = mSettings.getString(BeemApplication.ACCOUNT_PASSWORD_KEY, "");
+ mIsAccountConfigured = !("".equals(login) || "".equals(password));
+ }
+ }
+ }
+}
--- a/src/com/beem/project/beem/BeemService.java Sun Feb 14 17:25:38 2010 +0100
+++ b/src/com/beem/project/beem/BeemService.java Sat Dec 25 17:01:00 2010 +0100
@@ -50,18 +50,29 @@
import org.jivesoftware.smack.Roster.SubscriptionMode;
import org.jivesoftware.smack.provider.PrivacyProvider;
import org.jivesoftware.smack.provider.ProviderManager;
+import org.jivesoftware.smackx.provider.DelayInfoProvider;
+import org.jivesoftware.smackx.provider.DiscoverInfoProvider;
+import org.jivesoftware.smackx.provider.DiscoverItemsProvider;
+import org.jivesoftware.smackx.packet.ChatStateExtension;
import org.jivesoftware.smack.proxy.ProxyInfo;
import org.jivesoftware.smack.proxy.ProxyInfo.ProxyType;
import org.jivesoftware.smack.util.StringUtils;
+import org.jivesoftware.smackx.pubsub.provider.PubSubProvider;
+import org.jivesoftware.smackx.pubsub.provider.ItemsProvider;
+import org.jivesoftware.smackx.pubsub.provider.ItemProvider;
+import org.jivesoftware.smackx.pubsub.provider.EventProvider;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.Service;
+import android.content.BroadcastReceiver;
+import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.net.ConnectivityManager;
+import android.net.Uri;
import android.os.IBinder;
import android.os.RemoteException;
import android.preference.PreferenceManager;
@@ -73,9 +84,15 @@
import com.beem.project.beem.service.aidl.IXmppFacade;
import com.beem.project.beem.utils.BeemBroadcastReceiver;
import com.beem.project.beem.utils.BeemConnectivity;
+import com.beem.project.beem.utils.Status;
+import com.beem.project.beem.smack.avatar.AvatarMetadataProvider;
+import com.beem.project.beem.smack.avatar.AvatarProvider;
+import com.beem.project.beem.smack.caps.CapsProvider;
/**
- * This class is for the Beem service. The connection to the xmpp server will be made asynchronously when the service
+ * This class is for the Beem service.
+ * It must contains every global informations needed to maintain the background service.
+ * The connection to the xmpp server will be made asynchronously when the service
* will start.
* @author darisk
*/
@@ -86,7 +103,7 @@
private static final String TAG = "BeemService";
private static final int DEFAULT_XMPP_PORT = 5222;
- private static final String COMMAND_NAMESPACE = "http://jabber.org/protocol/commands";
+ //private static final String COMMAND_NAMESPACE = "http://jabber.org/protocol/commands";
private NotificationManager mNotificationManager;
private XmppConnectionAdapter mConnection;
@@ -103,6 +120,10 @@
private IXmppFacade.Stub mBind;
private BeemBroadcastReceiver mReceiver = new BeemBroadcastReceiver();
+ private BeemServiceBroadcastReceiver mOnOffReceiver = new BeemServiceBroadcastReceiver();
+ private BeemServicePreferenceListener mPreferenceListener = new BeemServicePreferenceListener();
+
+ private boolean mOnOffReceiverIsRegistered;
/**
* Constructor.
@@ -111,17 +132,16 @@
}
/**
- * Initialise la configuration de la connexion.
+ * Initialize the connection.
*/
private void initConnectionConfig() {
- //java.security.Security.addProvider(new com.sun.security.sasl.Provider());
- mUseProxy = mSettings.getBoolean("settings_key_proxy_use", false);
+ mUseProxy = mSettings.getBoolean(BeemApplication.PROXY_USE_KEY, false);
if (mUseProxy) {
- String stype = mSettings.getString("settings_key_proxy_type", "HTTP");
- String phost = mSettings.getString("settings_key_proxy_server", "");
- String puser = mSettings.getString("settings_key_proxy_username", "");
- String ppass = mSettings.getString("settings_key_proxy_password", "");
- int pport = Integer.parseInt(mSettings.getString("settings_key_proxy_port", "1080"));
+ String stype = mSettings.getString(BeemApplication.PROXY_TYPE_KEY, "HTTP");
+ String phost = mSettings.getString(BeemApplication.PROXY_SERVER_KEY, "");
+ String puser = mSettings.getString(BeemApplication.PROXY_USERNAME_KEY, "");
+ String ppass = mSettings.getString(BeemApplication.PROXY_PASSWORD_KEY, "");
+ int pport = Integer.parseInt(mSettings.getString(BeemApplication.PROXY_PORT_KEY, "1080"));
ProxyInfo.ProxyType type = ProxyType.valueOf(stype);
mProxyInfo = new ProxyInfo(type, phost, pport, puser, ppass);
} else {
@@ -138,6 +158,9 @@
}
mConnectionConfiguration.setDebuggerEnabled(false);
mConnectionConfiguration.setSendPresence(true);
+ // maybe not the universal path, but it works on most devices (Samsung Galaxy, Google Nexus One)
+ mConnectionConfiguration.setTruststoreType("BKS");
+ mConnectionConfiguration.setTruststorePath("/system/etc/security/cacerts.bks");
}
/**
@@ -149,19 +172,16 @@
return mBind;
}
- /* (non-Javadoc)
- * @see android.app.Service#onUnbind(android.content.Intent)
- */
@Override
public boolean onUnbind(Intent intent) {
Log.d(TAG, "ONUNBIND()");
if (!mConnection.getAdaptee().isConnected()) {
- Log.d(TAG, "DESTROYED");
this.stopSelf();
}
return true;
}
+
/**
* {@inheritDoc}
*/
@@ -170,19 +190,25 @@
super.onCreate();
registerReceiver(mReceiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
mSettings = PreferenceManager.getDefaultSharedPreferences(this);
- String tmpJid = mSettings.getString("settings_key_account_username", "");
+ mSettings.registerOnSharedPreferenceChangeListener(mPreferenceListener);
+ if (mSettings.getBoolean("settings_away_chk", false)) {
+ mOnOffReceiverIsRegistered = true;
+ registerReceiver(mOnOffReceiver, new IntentFilter(Intent.ACTION_SCREEN_OFF));
+ registerReceiver(mOnOffReceiver, new IntentFilter(Intent.ACTION_SCREEN_ON));
+ }
+ String tmpJid = mSettings.getString(BeemApplication.ACCOUNT_USERNAME_KEY, "");
mLogin = StringUtils.parseName(tmpJid);
- mPassword = mSettings.getString("settings_key_account_password", "");
+ mPassword = mSettings.getString(BeemApplication.ACCOUNT_PASSWORD_KEY, "");
mPort = DEFAULT_XMPP_PORT;
mService = StringUtils.parseServer(tmpJid);
- mHost = StringUtils.parseServer(tmpJid);
+ mHost = mService;
if (mSettings.getBoolean("settings_key_specific_server", false)) {
mHost = mSettings.getString("settings_key_xmpp_server", "");
if ("".equals(mHost))
mHost = StringUtils.parseServer(tmpJid);
String tmpPort = mSettings.getString("settings_key_xmpp_port", "5222");
- mPort = ("".equals(tmpPort)) ? DEFAULT_XMPP_PORT : Integer.parseInt(tmpPort) ;
+ mPort = ("".equals(tmpPort)) ? DEFAULT_XMPP_PORT : Integer.parseInt(tmpPort);
}
if ("gmail.com".equals(mService) || "googlemail.com".equals(mService)) {
mLogin = tmpJid;
@@ -206,9 +232,12 @@
@Override
public void onDestroy() {
super.onDestroy();
- Log.d("Service", "onDestroy");
+ resetStatus();
mNotificationManager.cancelAll();
unregisterReceiver(mReceiver);
+ mSettings.unregisterOnSharedPreferenceChangeListener(mPreferenceListener);
+ if (mOnOffReceiverIsRegistered)
+ unregisterReceiver(mOnOffReceiver);
if (mConnection.isAuthentificated() && BeemConnectivity.isConnected(this))
mConnection.disconnect();
Log.d(TAG, "ONDESTROY");
@@ -229,11 +258,16 @@
}
/**
- * Show a notification.
+ * Show a notification using the preference of the user.
* @param id the id of the notification.
* @param notif the notification to show
*/
public void sendNotification(int id, Notification notif) {
+ if (mSettings.getBoolean(BeemApplication.NOTIFICATION_VIBRATE_KEY, true))
+ notif.defaults |= Notification.DEFAULT_VIBRATE;
+ notif.defaults |= Notification.DEFAULT_LIGHTS;
+ String ringtoneStr = mSettings.getString(BeemApplication.NOTIFICATION_SOUND_KEY, "");
+ notif.sound = Uri.parse(ringtoneStr);
mNotificationManager.notify(id, notif);
}
@@ -246,11 +280,11 @@
}
/**
- * Reset the status to online after a deconnection.
+ * Reset the status to online after a disconnect.
*/
public void resetStatus() {
Editor edit = mSettings.edit();
- edit.putInt("PreferenceStatus", 1);
+ edit.putInt(BeemApplication.STATUS_KEY, 1);
edit.commit();
}
@@ -279,13 +313,66 @@
}
/**
+ * Get the notification manager system service.
+ *
+ * @return the notification manager service.
+ */
+ public NotificationManager getNotificationManager() {
+ return mNotificationManager;
+ }
+
+ /**
* A sort of patch from this thread: http://www.igniterealtime.org/community/thread/31118. Avoid ClassCastException
* by bypassing the classloading shit of Smack.
* @param pm The ProviderManager.
*/
private void configure(ProviderManager pm) {
+ Log.d(TAG, "configure");
+ // Service Discovery # Items
+ pm.addIQProvider("query", "http://jabber.org/protocol/disco#items", new DiscoverItemsProvider());
+ // Service Discovery # Info
+ pm.addIQProvider("query", "http://jabber.org/protocol/disco#info", new DiscoverInfoProvider());
+
// Privacy
pm.addIQProvider("query", "jabber:iq:privacy", new PrivacyProvider());
+ // Delayed Delivery only the new version
+ pm.addExtensionProvider("delay", "urn:xmpp:delay", new DelayInfoProvider());
+
+ // Service Discovery # Items
+ pm.addIQProvider("query", "http://jabber.org/protocol/disco#items", new DiscoverItemsProvider());
+ // Service Discovery # Info
+ pm.addIQProvider("query", "http://jabber.org/protocol/disco#info", new DiscoverInfoProvider());
+
+ // Chat State
+ ChatStateExtension.Provider chatState = new ChatStateExtension.Provider();
+ pm.addExtensionProvider("active", "http://jabber.org/protocol/chatstates", chatState);
+ pm.addExtensionProvider("composing", "http://jabber.org/protocol/chatstates",
+ chatState);
+ pm.addExtensionProvider("paused", "http://jabber.org/protocol/chatstates", chatState);
+ pm.addExtensionProvider("inactive", "http://jabber.org/protocol/chatstates", chatState);
+ pm.addExtensionProvider("gone", "http://jabber.org/protocol/chatstates", chatState);
+ // capabilities
+ pm.addExtensionProvider("c", "http://jabber.org/protocol/caps", new CapsProvider());
+ //Pubsub
+ pm.addIQProvider("pubsub", "http://jabber.org/protocol/pubsub", new PubSubProvider());
+ pm.addExtensionProvider("items", "http://jabber.org/protocol/pubsub", new ItemsProvider());
+ pm.addExtensionProvider("items", "http://jabber.org/protocol/pubsub", new ItemsProvider());
+ pm.addExtensionProvider("item", "http://jabber.org/protocol/pubsub", new ItemProvider());
+
+ pm.addExtensionProvider("items", "http://jabber.org/protocol/pubsub#event", new ItemsProvider());
+ pm.addExtensionProvider("item", "http://jabber.org/protocol/pubsub#event", new ItemProvider());
+ pm.addExtensionProvider("event", "http://jabber.org/protocol/pubsub#event", new EventProvider());
+ //TODO rajouter les manquants pour du full pubsub
+
+
+ //PEP avatar
+ pm.addExtensionProvider("metadata", "urn:xmpp:avatar:metadata", new AvatarMetadataProvider());
+ pm.addExtensionProvider("data", "urn:xmpp:avatar:data", new AvatarProvider());
+
+// PEPProvider pep = new PEPProvider();
+// AvatarMetadataProvider avaMeta = new AvatarMetadataProvider();
+// pep.registerPEPParserExtension("urn:xmpp:avatar:metadata", avaMeta);
+// pm.addExtensionProvider("event", "http://jabber.org/protocol/pubsub#event", pep);
/*
// Private Data Storage
@@ -300,22 +387,10 @@
pm.addExtensionProvider("x", "jabber:x:roster", new RosterExchangeProvider());
// Message Events
pm.addExtensionProvider("x", "jabber:x:event", new MessageEventProvider());
- // Chat State
- pm.addExtensionProvider("active", "http://jabber.org/protocol/chatstates", new ChatStateExtension.Provider());
- pm
- .addExtensionProvider("composing", "http://jabber.org/protocol/chatstates",
- new ChatStateExtension.Provider());
- pm.addExtensionProvider("paused", "http://jabber.org/protocol/chatstates", new ChatStateExtension.Provider());
- pm.addExtensionProvider("inactive", "http://jabber.org/protocol/chatstates", new ChatStateExtension.Provider());
- pm.addExtensionProvider("gone", "http://jabber.org/protocol/chatstates", new ChatStateExtension.Provider());
// XHTML
pm.addExtensionProvider("html", "http://jabber.org/protocol/xhtml-im", new XHTMLExtensionProvider());
// Group Chat Invitations
pm.addExtensionProvider("x", "jabber:x:conference", new GroupChatInvitation.Provider());
- // Service Discovery # Items
- pm.addIQProvider("query", "http://jabber.org/protocol/disco#items", new DiscoverItemsProvider());
- // Service Discovery # Info
- pm.addIQProvider("query", "http://jabber.org/protocol/disco#info", new DiscoverInfoProvider());
// Data Forms
pm.addExtensionProvider("x", "jabber:x:data", new DataFormProvider());
// MUC User
@@ -324,8 +399,6 @@
pm.addIQProvider("query", "http://jabber.org/protocol/muc#admin", new MUCAdminProvider());
// MUC Owner
pm.addIQProvider("query", "http://jabber.org/protocol/muc#owner", new MUCOwnerProvider());
- // Delayed Delivery
- pm.addExtensionProvider("x", "jabber:x:delay", new DelayInformationProvider());
// Version
try {
pm.addIQProvider("query", "jabber:iq:version", Class.forName("org.jivesoftware.smackx.packet.Version"));
@@ -368,5 +441,61 @@
new AdHocCommandDataProvider.SessionExpiredError());
*/
}
+
+ /**
+ * Listen on preference changes.
+ */
+ private class BeemServicePreferenceListener implements SharedPreferences.OnSharedPreferenceChangeListener {
+
+ /**
+ * ctor.
+ */
+ public BeemServicePreferenceListener() {
+ }
+
+ @Override
+ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
+ if ("settings_away_chk".equals(key)) {
+ if (sharedPreferences.getBoolean("settings_away_chk", false)) {
+ mOnOffReceiverIsRegistered = true;
+ registerReceiver(mOnOffReceiver, new IntentFilter(Intent.ACTION_SCREEN_OFF));
+ registerReceiver(mOnOffReceiver, new IntentFilter(Intent.ACTION_SCREEN_ON));
+ } else {
+ mOnOffReceiverIsRegistered = false;
+ unregisterReceiver(mOnOffReceiver);
+ }
+ }
+ }
+ }
+
+ /**
+ * Listen on some Intent broadcast, ScreenOn and ScreenOff.
+ */
+ private class BeemServiceBroadcastReceiver extends BroadcastReceiver {
+
+ private String mOldStatus;
+ private int mOldMode;
+
+ /**
+ * Constructor.
+ */
+ public BeemServiceBroadcastReceiver() {
+ }
+
+ @Override
+ public void onReceive(final Context context, final Intent intent) {
+ String intentAction = intent.getAction();
+ if (intentAction.equals(Intent.ACTION_SCREEN_OFF)) {
+ mOldMode = mConnection.getPreviousMode();
+ mOldStatus = mConnection.getPreviousStatus();
+ if (mConnection.isAuthentificated())
+ mConnection.changeStatus(Status.CONTACT_STATUS_AWAY,
+ mSettings.getString("settings_away_message", "Away"));
+ } else if (intentAction.equals(Intent.ACTION_SCREEN_ON)) {
+ if (mConnection.isAuthentificated())
+ mConnection.changeStatus(mOldMode, mOldStatus);
+ }
+ }
+ }
}
--- a/src/com/beem/project/beem/jingle/package-info.java Sun Feb 14 17:25:38 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- 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.jingle;
-
--- a/src/com/beem/project/beem/package-info.java Sun Feb 14 17:25:38 2010 +0100
+++ b/src/com/beem/project/beem/package-info.java Sat Dec 25 17:01:00 2010 +0100
@@ -41,5 +41,9 @@
Head of the EIP Laboratory.
*/
+
+/**
+ * This package contains BEEM's entry points.
+ */
package com.beem.project.beem;
--- a/src/com/beem/project/beem/provider/Beem.java Sun Feb 14 17:25:38 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,204 +0,0 @@
-/*
- 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.provider;
-
-import android.net.Uri;
-import android.provider.BaseColumns;
-
-// TODO: Auto-generated Javadoc
-/**
- * Convenience definitions for BEEM's providers.
- */
-public final class Beem {
-
- /**
- * Contacts table.
- */
- public static final class Contacts implements BaseColumns {
-
- /** The query used to create the table. */
- public static final String QUERY_CREATE = "CREATE TABLE " + Beem.CONTACTS_TABLE_NAME + " (" + BaseColumns._ID
- + " INTEGER PRIMARY KEY AUTOINCREMENT," + Contacts.UID + " INTEGER, " + Contacts.JID + " INTEGER,"
- + Contacts.NICKNAME + " TEXT," + Contacts.ALIAS + " TEXT," + Contacts.DATE_CREATED + " INTEGER,"
- + Contacts.DATE_MODIFIED + " INTEGER" + ");";
-
- /** The content:// style URL for Contacts table. */
- public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/contacts");
-
- /** The MIME type of {@link #CONTENT_URI} providing a directory of contacts. */
- public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.beem.project.contact";
-
- /** The MIME type of a {@link #CONTENT_URI} sub-directory of a single contact. */
- public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.beem.project.contact";
-
- /** The default sort order for this table. */
- public static final String DEFAULT_SORT_ORDER = "nickname ASC";
-
- /**
- * The user id having the contact
- * <P>
- * Type: INTEGER
- * </P>
- * .
- */
- public static final String UID = "uid";
-
- /**
- * The JabberID of the contact
- * <P>
- * Type: INTEGER
- * </P>
- * .
- */
- public static final String JID = "jid";
-
- /**
- * The nickname of the contact
- * <P>
- * Type: TEXT
- * </P>
- * .
- */
- public static final String NICKNAME = "nickname";
-
- /**
- * The alias of the contact
- * <P>
- * Type: TEXT
- * </P>
- * .
- */
- public static final String ALIAS = "alias";
-
- /**
- * The timestamp for when the contact was created
- * <P>
- * Type: INTEGER (long from System.curentTimeMillis())
- * </P>
- * .
- */
- public static final String DATE_CREATED = "created";
-
- /**
- * The timestamp for when the contact was last modified
- * <P>
- * Type: INTEGER (long from System.curentTimeMillis())
- * </P>
- * .
- */
- public static final String DATE_MODIFIED = "modified";
-
- }
-
- /**
- * Users table.
- */
- public static final class Users implements BaseColumns {
-
- /** The query used to create the table. */
- public static final String QUERY_CREATE = "CREATE TABLE " + Beem.USERS_TABLE_NAME + " (" + BaseColumns._ID
- + " INTEGER PRIMARY KEY AUTOINCREMENT," + Users.JUSERNAME + " TEXT," + Users.DATE_CREATED + " INTEGER,"
- + Users.DATE_MODIFIED + " INTEGER" + ");";
-
- /** The content:// style URL for Contacts table. */
- public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/users");
-
- /** The MIME type of {@link #CONTENT_URI} providing a directory of users. */
- public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.beem.project.user";
-
- /** The MIME type of a {@link #CONTENT_URI} sub-directory of a single user. */
- public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.beem.project.user";
-
- /** The default sort order for this table. */
- public static final String DEFAULT_SORT_ORDER = "_id ASC";
-
- /**
- * The Jabber username of the user
- * <P>
- * Type: TEXT
- * </P>
- * .
- */
- public static final String JUSERNAME = "username";
-
- /**
- * The timestamp for when the user was created
- * <P>
- * Type: INTEGER (long from System.curentTimeMillis())
- * </P>
- * .
- */
- public static final String DATE_CREATED = "created";
-
- /**
- * The timestamp for when the user was last modified
- * <P>
- * Type: INTEGER (long from System.curentTimeMillis())
- * </P>
- * .
- */
- public static final String DATE_MODIFIED = "modified";
- }
-
- /** AUTHORITY. */
- public static final String AUTHORITY = "com.beem.project.provider";
-
- /** DB Name. */
- public static final String DB_NAME = "beem.db";
-
- /** DB Version. */
- public static final int DB_VERSION = 2;
-
- /** Name of the users table. */
- public static final String USERS_TABLE_NAME = "users";
-
- /** Name of the contacts table. */
- public static final String CONTACTS_TABLE_NAME = "contacts";
-
- /**
- * Constructor.
- */
- private Beem() {
- }
-}
--- a/src/com/beem/project/beem/provider/BeemDatabaseHelper.java Sun Feb 14 17:25:38 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
- 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.provider;
-
-import android.content.Context;
-import android.database.sqlite.SQLiteDatabase;
-import android.database.sqlite.SQLiteOpenHelper;
-import android.util.Log;
-
-// TODO: Auto-generated Javadoc
-/**
- * BeemDatabaseHelper class.
- * @author Jamu
- */
-public class BeemDatabaseHelper extends SQLiteOpenHelper {
-
- private final String mTag;
- private final String mTableName;
- private final String mCreationQuery;
-
- /**
- * BeemDatabaseHelper class.
- * @param context the context.
- * @param tag the tag.
- * @param tableName the tableName.
- * @param creationQuery the creation query.
- */
- public BeemDatabaseHelper(final Context context, final String tag, final String tableName,
- final String creationQuery) {
- super(context, Beem.DB_NAME, null, Beem.DB_VERSION);
-
- this.mTag = tag;
- this.mTableName = tableName;
- this.mCreationQuery = creationQuery;
- }
-
- /* (non-Javadoc)
- * @see android.database.sqlite.SQLiteOpenHelper#onCreate(android.database.sqlite.SQLiteDatabase)
- */
- @Override
- public void onCreate(SQLiteDatabase db) {
- db.execSQL(this.mCreationQuery);
- }
-
- /* (non-Javadoc)
- * @see android.database.sqlite.SQLiteOpenHelper#onUpgrade(android.database.sqlite.SQLiteDatabase, int, int)
- */
- @Override
- public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
- Log.w(this.mTag, "Upgrading database from version " + oldVersion + " to " + newVersion
- + ", which will destroy all old data");
- db.execSQL("DROP TABLE IF EXISTS " + this.mTableName + ";");
- onCreate(db);
- }
-}
--- a/src/com/beem/project/beem/provider/ContactProvider.java Sun Feb 14 17:25:38 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,268 +0,0 @@
-/*
- 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.provider;
-
-import java.util.HashMap;
-
-import android.content.ContentProvider;
-import android.content.ContentUris;
-import android.content.ContentValues;
-import android.content.UriMatcher;
-import android.database.Cursor;
-import android.database.SQLException;
-import android.database.sqlite.SQLiteDatabase;
-import android.database.sqlite.SQLiteQueryBuilder;
-import android.net.Uri;
-import android.provider.BaseColumns;
-import android.text.TextUtils;
-
-// TODO: Auto-generated Javadoc
-/**
- * ContactProvider class.
- * @author dasilvj
- */
-public class ContactProvider extends ContentProvider {
-
- private static final String TAG = "ContactProvider";
-
- private static HashMap<String, String> sContactsProjectionMap;
-
- private static final int CONTACTS = 1;
- private static final int CONTACT_ID = 2;
-
- private static final UriMatcher S_URI_MATCHER;
- static {
- S_URI_MATCHER = new UriMatcher(UriMatcher.NO_MATCH);
- S_URI_MATCHER.addURI(Beem.AUTHORITY, "contacts", CONTACTS);
- S_URI_MATCHER.addURI(Beem.AUTHORITY, "contacts/#", CONTACT_ID);
-
- sContactsProjectionMap = new HashMap<String, String>();
- sContactsProjectionMap.put(BaseColumns._ID, BaseColumns._ID);
- sContactsProjectionMap.put(Beem.Contacts.UID, Beem.Contacts.UID);
- sContactsProjectionMap.put(Beem.Contacts.JID, Beem.Contacts.JID);
- sContactsProjectionMap.put(Beem.Contacts.NICKNAME, Beem.Contacts.NICKNAME);
- sContactsProjectionMap.put(Beem.Contacts.ALIAS, Beem.Contacts.ALIAS);
- sContactsProjectionMap.put(Beem.Contacts.DATE_CREATED, Beem.Contacts.DATE_CREATED);
- sContactsProjectionMap.put(Beem.Contacts.DATE_MODIFIED, Beem.Contacts.DATE_MODIFIED);
- }
-
- private BeemDatabaseHelper mOpenHelper;
-
- /* (non-Javadoc)
- * @see android.content.ContentProvider#delete(android.net.Uri, java.lang.String, java.lang.String[])
- */
- @Override
- public int delete(Uri uri, String selection, String[] selectionArgs) {
- SQLiteDatabase db = mOpenHelper.getWritableDatabase();
- int count;
-
- switch (S_URI_MATCHER.match(uri)) {
- case CONTACTS:
- count = db.delete(Beem.CONTACTS_TABLE_NAME, selection, selectionArgs);
- break;
-
- case CONTACT_ID:
- String contactId = uri.getPathSegments().get(1);
- count = db.delete(Beem.CONTACTS_TABLE_NAME, BaseColumns._ID + "=" + contactId
- + (!TextUtils.isEmpty(selection) ? " AND (" + selection + ')' : ""), selectionArgs);
- break;
-
- default:
- throw new IllegalArgumentException("Unknown URI " + uri);
- }
-
- getContext().getContentResolver().notifyChange(uri, null);
- return count;
- }
-
- /* (non-Javadoc)
- * @see android.content.ContentProvider#getType(android.net.Uri)
- */
- @Override
- public String getType(Uri uri) {
- switch (S_URI_MATCHER.match(uri)) {
- case CONTACTS:
- return Beem.Contacts.CONTENT_TYPE;
-
- case CONTACT_ID:
- return Beem.Contacts.CONTENT_ITEM_TYPE;
-
- default:
- throw new IllegalArgumentException("Unknown URI " + uri);
- }
- }
-
- /* (non-Javadoc)
- * @see android.content.ContentProvider#insert(android.net.Uri, android.content.ContentValues)
- */
- @Override
- public Uri insert(Uri uri, ContentValues initialValues) {
- // Validate the requested uri
- if (S_URI_MATCHER.match(uri) != CONTACTS) {
- throw new IllegalArgumentException("Unknown URI " + uri);
- }
-
- ContentValues values;
- if (initialValues != null) {
- values = new ContentValues(initialValues);
- } else {
- values = new ContentValues();
- }
-
- Long now = Long.valueOf(System.currentTimeMillis());
-
- // Make sure that the fields are all set
- if (!values.containsKey(Beem.Contacts.UID)) {
- // TODO :: Must check that the UID exists using UserProvider
- throw new SQLException("No UID specified. Failed to insert row into " + uri);
- }
-
- if (!values.containsKey(Beem.Contacts.JID)) {
- values.put(Beem.Contacts.JID, "");
- }
-
- if (!values.containsKey(Beem.Contacts.NICKNAME)) {
- values.put(Beem.Contacts.JID, "");
- }
-
- if (!values.containsKey(Beem.Contacts.ALIAS)) {
- values.put(Beem.Contacts.JID, "");
- }
-
- if (!values.containsKey(Beem.Contacts.DATE_CREATED)) {
- values.put(Beem.Contacts.DATE_CREATED, now);
- }
-
- if (!values.containsKey(Beem.Contacts.DATE_MODIFIED)) {
- values.put(Beem.Contacts.DATE_MODIFIED, now);
- }
-
- SQLiteDatabase db = mOpenHelper.getWritableDatabase();
- long rowId = db.insert(Beem.CONTACTS_TABLE_NAME, BaseColumns._ID, values);
- if (rowId > 0) {
- Uri contactUri = ContentUris.withAppendedId(Beem.Contacts.CONTENT_URI, rowId);
- getContext().getContentResolver().notifyChange(contactUri, null);
- return contactUri;
- }
-
- throw new SQLException("Failed to insert row into " + uri);
- }
-
- /* (non-Javadoc)
- * @see android.content.ContentProvider#onCreate()
- */
- @Override
- public boolean onCreate() {
- mOpenHelper = new BeemDatabaseHelper(getContext(), TAG, Beem.CONTACTS_TABLE_NAME, Beem.Contacts.QUERY_CREATE);
- return true;
- }
-
- /* (non-Javadoc)
- * @see android.content.ContentProvider#query(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String)
- */
- @Override
- public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
- SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
-
- switch (S_URI_MATCHER.match(uri)) {
- case CONTACTS:
- qb.setTables(Beem.CONTACTS_TABLE_NAME);
- qb.setProjectionMap(sContactsProjectionMap);
- break;
-
- case CONTACT_ID:
- qb.setTables(Beem.USERS_TABLE_NAME);
- qb.setProjectionMap(sContactsProjectionMap);
- qb.appendWhere(BaseColumns._ID + "=" + uri.getPathSegments().get(1));
- break;
-
- default:
- throw new IllegalArgumentException("Unknown URI " + uri);
- }
-
- // If no sort order is specified use the default
- String orderBy;
- if (TextUtils.isEmpty(sortOrder)) {
- orderBy = Beem.Contacts.DEFAULT_SORT_ORDER;
- } else {
- orderBy = sortOrder;
- }
-
- // Get the database and run the query
- SQLiteDatabase db = mOpenHelper.getReadableDatabase();
- Cursor c = qb.query(db, projection, selection, selectionArgs, null, null, orderBy);
-
- // Tell the cursor what uri to watch, so it knows when its source data
- // changes
- c.setNotificationUri(getContext().getContentResolver(), uri);
- return c;
- }
-
- /* (non-Javadoc)
- * @see android.content.ContentProvider#update(android.net.Uri, android.content.ContentValues, java.lang.String, java.lang.String[])
- */
- @Override
- public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
- SQLiteDatabase db = mOpenHelper.getWritableDatabase();
- int count;
-
- switch (S_URI_MATCHER.match(uri)) {
- case CONTACTS:
- count = db.update(Beem.CONTACTS_TABLE_NAME, values, selection, selectionArgs);
- break;
-
- case CONTACT_ID:
- String contactId = uri.getPathSegments().get(1);
- count = db.update(Beem.CONTACTS_TABLE_NAME, values, BaseColumns._ID + "=" + contactId
- + (!TextUtils.isEmpty(selection) ? " AND (" + selection + ')' : ""), selectionArgs);
- break;
-
- default:
- throw new IllegalArgumentException("Unknown URI " + uri);
- }
-
- getContext().getContentResolver().notifyChange(uri, null);
- return count;
- }
-}
--- a/src/com/beem/project/beem/provider/UserProvider.java Sun Feb 14 17:25:38 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,252 +0,0 @@
-/*
- 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.provider;
-
-import java.util.HashMap;
-
-import android.content.ContentProvider;
-import android.content.ContentUris;
-import android.content.ContentValues;
-import android.content.UriMatcher;
-import android.database.Cursor;
-import android.database.SQLException;
-import android.database.sqlite.SQLiteDatabase;
-import android.database.sqlite.SQLiteQueryBuilder;
-import android.net.Uri;
-import android.provider.BaseColumns;
-import android.text.TextUtils;
-
-// TODO: Auto-generated Javadoc
-/**
- * UserProvider class.
- * @author Jamu
- */
-public class UserProvider extends ContentProvider {
-
- private static final String TAG = "UserProvider";
-
- private static HashMap<String, String> sUsersProjectionMap;
-
- private static final int USERS = 1;
- private static final int USER_ID = 2;
-
- private static final UriMatcher S_URI_MATCHER;
- static {
- S_URI_MATCHER = new UriMatcher(UriMatcher.NO_MATCH);
- S_URI_MATCHER.addURI(Beem.AUTHORITY, "users", USERS);
- S_URI_MATCHER.addURI(Beem.AUTHORITY, "users/#", USER_ID);
-
- sUsersProjectionMap = new HashMap<String, String>();
- sUsersProjectionMap.put(BaseColumns._ID, BaseColumns._ID);
- sUsersProjectionMap.put(Beem.Users.JUSERNAME, Beem.Users.JUSERNAME);
- sUsersProjectionMap.put(Beem.Users.DATE_CREATED, Beem.Users.DATE_CREATED);
- sUsersProjectionMap.put(Beem.Users.DATE_MODIFIED, Beem.Users.DATE_MODIFIED);
- }
-
- private BeemDatabaseHelper mOpenHelper;
-
- /* (non-Javadoc)
- * @see android.content.ContentProvider#delete(android.net.Uri, java.lang.String, java.lang.String[])
- */
- @Override
- public int delete(Uri uri, String selection, String[] selectionArgs) {
- SQLiteDatabase db = mOpenHelper.getWritableDatabase();
- int count;
-
- switch (S_URI_MATCHER.match(uri)) {
- case USERS:
- count = db.delete(Beem.USERS_TABLE_NAME, selection, selectionArgs);
- break;
-
- case USER_ID:
- String userID = uri.getPathSegments().get(1);
- count = db.delete(Beem.USERS_TABLE_NAME, BaseColumns._ID + "=" + userID
- + (!TextUtils.isEmpty(selection) ? " AND (" + selection + ')' : ""), selectionArgs);
- break;
-
- default:
- throw new IllegalArgumentException("Unknown URI " + uri);
- }
-
- getContext().getContentResolver().notifyChange(uri, null);
- return count;
- }
-
- /* (non-Javadoc)
- * @see android.content.ContentProvider#getType(android.net.Uri)
- */
- @Override
- public String getType(Uri uri) {
- switch (S_URI_MATCHER.match(uri)) {
- case USERS:
- return Beem.Users.CONTENT_TYPE;
-
- case USER_ID:
- return Beem.Users.CONTENT_ITEM_TYPE;
-
- default:
- throw new IllegalArgumentException("Unknown URI " + uri);
- }
- }
-
- /* (non-Javadoc)
- * @see android.content.ContentProvider#insert(android.net.Uri, android.content.ContentValues)
- */
- @Override
- public Uri insert(Uri uri, ContentValues initialValues) {
- // Validate the requested uri
- if (S_URI_MATCHER.match(uri) != USERS) {
- throw new IllegalArgumentException("Unknown URI " + uri);
- }
-
- ContentValues values;
- if (initialValues != null) {
- values = new ContentValues(initialValues);
- } else {
- values = new ContentValues();
- }
-
- Long now = Long.valueOf(System.currentTimeMillis());
-
- // Make sure that the fields are all set
- if (!values.containsKey(Beem.Users.JUSERNAME)) {
- throw new SQLException("No JUSERNAME specified. Failed to insert row into " + uri);
- }
-
- if (!values.containsKey(Beem.Users.DATE_CREATED)) {
- values.put(Beem.Users.DATE_CREATED, now);
- }
-
- if (!values.containsKey(Beem.Users.DATE_MODIFIED)) {
- values.put(Beem.Users.DATE_MODIFIED, now);
- }
-
- SQLiteDatabase db = mOpenHelper.getWritableDatabase();
- long rowId = db.insert(Beem.USERS_TABLE_NAME, BaseColumns._ID, values);
- if (rowId > 0) {
- Uri userUri = ContentUris.withAppendedId(Beem.Users.CONTENT_URI, rowId);
- getContext().getContentResolver().notifyChange(userUri, null);
- return userUri;
- }
-
- throw new SQLException("Failed to insert row into " + uri);
- }
-
- /* (non-Javadoc)
- * @see android.content.ContentProvider#onCreate()
- */
- @Override
- public boolean onCreate() {
- mOpenHelper = new BeemDatabaseHelper(getContext(), TAG, Beem.USERS_TABLE_NAME, Beem.Users.QUERY_CREATE);
- return true;
- }
-
- /* (non-Javadoc)
- * @see android.content.ContentProvider#query(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String)
- */
- @Override
- public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
- SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
-
- switch (S_URI_MATCHER.match(uri)) {
- case USERS:
- qb.setTables(Beem.USERS_TABLE_NAME);
- qb.setProjectionMap(sUsersProjectionMap);
- break;
-
- case USER_ID:
- qb.setTables(Beem.USERS_TABLE_NAME);
- qb.setProjectionMap(sUsersProjectionMap);
- qb.appendWhere(BaseColumns._ID + "=" + uri.getPathSegments().get(1));
- break;
-
- default:
- throw new IllegalArgumentException("Unknown URI " + uri);
- }
-
- // If no sort order is specified use the default
- String orderBy;
- if (TextUtils.isEmpty(sortOrder)) {
- orderBy = Beem.Users.DEFAULT_SORT_ORDER;
- } else {
- orderBy = sortOrder;
- }
-
- // Get the database and run the query
- SQLiteDatabase db = mOpenHelper.getReadableDatabase();
- Cursor c = qb.query(db, projection, selection, selectionArgs, null, null, orderBy);
-
- // Tell the cursor what uri to watch, so it knows when its source data
- // changes
- c.setNotificationUri(getContext().getContentResolver(), uri);
- return c;
- }
-
- /* (non-Javadoc)
- * @see android.content.ContentProvider#update(android.net.Uri, android.content.ContentValues, java.lang.String, java.lang.String[])
- */
- @Override
- public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
- SQLiteDatabase db = mOpenHelper.getWritableDatabase();
- int count;
-
- switch (S_URI_MATCHER.match(uri)) {
- case USERS:
- count = db.update(Beem.USERS_TABLE_NAME, values, selection, selectionArgs);
- break;
-
- case USER_ID:
- String userId = uri.getPathSegments().get(1);
- count = db.update(Beem.USERS_TABLE_NAME, values, BaseColumns._ID + "=" + userId
- + (!TextUtils.isEmpty(selection) ? " AND (" + selection + ')' : ""), selectionArgs);
- break;
-
- default:
- throw new IllegalArgumentException("Unknown URI " + uri);
- }
-
- getContext().getContentResolver().notifyChange(uri, null);
- return count;
- }
-}
--- a/src/com/beem/project/beem/provider/package-info.java Sun Feb 14 17:25:38 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- 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.provider;
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/service/BeemCapsManager.java Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,162 @@
+/*
+ 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.service;
+
+import org.jivesoftware.smack.Connection;
+import org.jivesoftware.smackx.packet.DiscoverInfo;
+import org.jivesoftware.smackx.ServiceDiscoveryManager;
+import org.jivesoftware.smack.util.PacketParserUtils;
+import org.xmlpull.v1.XmlPullParserFactory;
+import org.xmlpull.v1.XmlPullParserException;
+import org.xmlpull.v1.XmlPullParser;
+
+import android.util.Log;
+import java.io.FileReader;
+import java.io.Reader;
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.FileWriter;
+import java.io.Writer;
+
+import java.io.File;
+import java.io.IOException;
+
+import android.content.Context;
+
+import com.beem.project.beem.smack.caps.CapsManager;
+
+/**
+ * An implementation of CapsManager which keeps DiscoverInfo on the Cache directory of the android application.
+ */
+public class BeemCapsManager extends CapsManager {
+
+ private static final String TAG = "BeemCapsManager";
+
+ private Context mContext;
+ private File mCacheDir;
+ private XmlPullParser mParser;
+
+ /**
+ * Create a BeemCapsManager.
+ *
+ * @param sdm the ServiceDiscoveryManager to use
+ * @param conn the connection to use
+ * @param context the Android context to use to store data
+ */
+ public BeemCapsManager(final ServiceDiscoveryManager sdm, final Connection conn, final Context context) {
+ super(sdm, conn);
+ mContext = context;
+ initCacheDirectory();
+ }
+
+
+ @Override
+ protected DiscoverInfo load(String ver) {
+ File fver = new File(mCacheDir, ver);
+ try {
+ Reader fr = new BufferedReader(new FileReader(fver));
+ try {
+ if (mParser == null)
+ mParser = makeParser();
+ mParser.setInput(fr);
+ return (DiscoverInfo) PacketParserUtils.parsePacketExtension("query",
+ "http://jabber.org/protocol/disco#info", mParser);
+
+ } finally {
+ fr.close();
+ }
+ } catch (Exception e) {
+ // The parsePacketExtension throw Exception on error
+ Log.d(TAG, "Error while loading Capabilities " + ver, e);
+ }
+ return null;
+ }
+
+ @Override
+ protected void store(String ver, DiscoverInfo info) {
+ File fver = new File(mCacheDir, ver);
+ try {
+ Writer fw = new BufferedWriter(new FileWriter(fver));
+ try {
+ String data = info.toXML();
+ fw.write(data, 0, data.length());
+ } finally {
+ fw.close();
+ }
+ } catch (IOException e) {
+ Log.d(TAG, "Error while saving Capabilities " + ver, e);
+ }
+ }
+
+ @Override
+ protected boolean isInCache(String ver) {
+ boolean result = super.isInCache(ver);
+ if (!result) {
+ File fver = new File(mCacheDir, ver);
+ result = fver.exists();
+ }
+ return result;
+ }
+
+ /**
+ * Init the cache directory.
+ */
+ private void initCacheDirectory() {
+ File dir = mContext.getCacheDir();
+ mCacheDir = new File(dir, "capabilities");
+ mCacheDir.mkdir();
+ }
+
+ /**
+ * Make an Xml parser.
+ *
+ * @return the created xml parser.
+ * @throws XmlPullParserException if an error occurs while creating the parser.
+ */
+ private XmlPullParser makeParser() throws XmlPullParserException {
+ XmlPullParserFactory fact = XmlPullParserFactory.newInstance();
+ fact.setNamespaceAware(true);
+ return fact.newPullParser();
+ }
+}
--- a/src/com/beem/project/beem/service/BeemChatManager.java Sun Feb 14 17:25:38 2010 +0100
+++ b/src/com/beem/project/beem/service/BeemChatManager.java Sat Dec 25 17:01:00 2010 +0100
@@ -51,13 +51,14 @@
import org.jivesoftware.smack.Chat;
import org.jivesoftware.smack.ChatManager;
import org.jivesoftware.smack.ChatManagerListener;
-import org.jivesoftware.smack.util.StringUtils;
import android.app.Notification;
import android.app.PendingIntent;
import android.content.Intent;
+import android.content.SharedPreferences;
import android.os.RemoteCallbackList;
import android.os.RemoteException;
+import android.preference.PreferenceManager;
import android.util.Log;
import com.beem.project.beem.BeemService;
@@ -74,104 +75,12 @@
*/
public class BeemChatManager extends IChatManager.Stub {
- /**
- * A listener for all the chat creation event that happens on the connection.
- * @author darisk
- */
- private class ChatListener extends IMessageListener.Stub implements ChatManagerListener {
-
- /**
- * Constructor.
- */
- public ChatListener() {
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void chatCreated(Chat chat, boolean locally) {
- IChat newchat = getChat(chat);
- try {
- newchat.addMessageListener(mChatListener);
- final int n = mRemoteChatCreationListeners.beginBroadcast();
-
- for (int i = 0; i < n; i++) {
- IChatManagerListener listener = mRemoteChatCreationListeners.getBroadcastItem(i);
- listener.chatCreated(newchat, locally);
- }
- mRemoteChatCreationListeners.finishBroadcast();
- } catch (RemoteException e) {
- // The RemoteCallbackList will take care of removing the
- // dead listeners.
- Log.w(TAG, " Error while triggering remote connection listeners in chat creation", e);
- }
- }
-
- /**
- * Create the PendingIntent to launch our activity if the user select this chat notification.
- * @param chat A ChatAdapter instance
- * @return A Chat activity PendingIntent
- */
- private PendingIntent makeChatIntent(IChat chat) {
- Intent chatIntent = new Intent(mService, com.beem.project.beem.ui.Chat.class);
- chatIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_SINGLE_TOP);
- try {
- chatIntent.setData(chat.getParticipant().toUri());
- } catch (RemoteException e) {
- Log.e(TAG, e.getMessage());
- }
- PendingIntent contentIntent = PendingIntent.getActivity(mService, 0, chatIntent,
- PendingIntent.FLAG_UPDATE_CURRENT);
- return contentIntent;
- }
-
- /**
- * Set a notification of a new chat.
- * @param chat The chat to access by the notification
- */
- private void notifyNewChat(IChat chat) {
- try {
- CharSequence tickerText = mService.getBind().getRoster().getContact(chat.getParticipant().getJID())
- .getName();
- Notification notification = new Notification(android.R.drawable.stat_notify_chat, tickerText, System
- .currentTimeMillis());
- notification.defaults = Notification.DEFAULT_ALL;
- notification.flags = Notification.FLAG_AUTO_CANCEL;
- notification.setLatestEventInfo(mService, tickerText, mService
- .getString(R.string.BeemChatManagerNewMessage), makeChatIntent(chat));
- mService.sendNotification(chat.getParticipant().getJID().hashCode(), notification);
- } catch (RemoteException e) {
- Log.e(TAG, e.getMessage());
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void processMessage(IChat chat, Message message) {
- try {
- if (!chat.isOpen() && message.getBody() != null) {
- if (chat instanceof ChatAdapter)
- mChats.put(chat.getParticipant().getJID(), (ChatAdapter) chat);
- notifyNewChat(chat);
- }
- } catch (RemoteException e) {
- Log.w(TAG, e.getMessage());
- }
- }
-
- @Override
- public void stateChanged(IChat chat) { }
- }
-
- /** Tag to use with log methods. */
- public static final String TAG = "BeemChatManager";
+ private static final String TAG = "BeemChatManager";
private final ChatManager mAdaptee;
private final Map<String, ChatAdapter> mChats = new HashMap<String, ChatAdapter>();
private final ChatListener mChatListener = new ChatListener();
- private final RemoteCallbackList<IChatManagerListener> mRemoteChatCreationListeners = new RemoteCallbackList<IChatManagerListener>();
+ private final RemoteCallbackList<IChatManagerListener> mRemoteChatCreationListeners =
+ new RemoteCallbackList<IChatManagerListener>();
private final BeemService mService;
/**
@@ -185,9 +94,6 @@
mAdaptee.addChatListener(mChatListener);
}
- /**
- * {@inheritDoc}
- */
@Override
public void addChatCreationListener(IChatManagerListener listener) throws RemoteException {
if (listener != null)
@@ -202,7 +108,9 @@
*/
@Override
public IChat createChat(Contact contact, IMessageListener listener) {
- String jid = contact.getJID();
+ String jid = contact.getJIDWithRes();
+ Log.d(TAG, "Get chat key1 = ");
+
return createChat(jid, listener);
}
@@ -213,9 +121,9 @@
* @return the chat session
*/
public IChat createChat(String jid, IMessageListener listener) {
- String key = StringUtils.parseBareAddress(jid);
+ String key = jid;
ChatAdapter result;
- Log.d(TAG, "Get chat key = " + key);
+ Log.d(TAG, "Get chat key2 = ");
if (mChats.containsKey(key)) {
result = mChats.get(key);
result.addMessageListener(listener);
@@ -236,6 +144,8 @@
public void destroyChat(IChat chat) throws RemoteException {
// Can't remove it. otherwise we will lose all futur message in this chat
// chat.removeMessageListener(mChatListener);
+ if (chat == null)
+ return;
deleteChatNotification(chat);
mChats.remove(chat.getParticipant().getJID());
}
@@ -258,15 +168,22 @@
* @return a chat adapter register in the manager
*/
private ChatAdapter getChat(Chat chat) {
- String key = StringUtils.parseBareAddress(chat.getParticipant());
+ String key = chat.getParticipant();
if (mChats.containsKey(key)) {
return mChats.get(key);
}
ChatAdapter res = new ChatAdapter(chat);
+ Log.d(TAG, "getChat put " + key);
mChats.put(key, res);
return res;
}
+ @Override
+ public ChatAdapter getChat(Contact contact) {
+ String key = contact.getJIDWithRes();
+ return mChats.get(key);
+ }
+
/**
* This methods permits to retrieve the list of contacts who have an opened chat session with us.
* @return An List containing Contact instances.
@@ -296,4 +213,98 @@
mRemoteChatCreationListeners.unregister(listener);
}
+ /**
+ * A listener for all the chat creation event that happens on the connection.
+ * @author darisk
+ */
+ private class ChatListener extends IMessageListener.Stub implements ChatManagerListener {
+
+ /**
+ * Constructor.
+ */
+ public ChatListener() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void chatCreated(Chat chat, boolean locally) {
+ IChat newchat = getChat(chat);
+ Log.d(TAG, "Chat" + chat.toString() + " created locally " + locally + "with " + chat.getParticipant());
+ try {
+ newchat.addMessageListener(mChatListener);
+ final int n = mRemoteChatCreationListeners.beginBroadcast();
+
+ for (int i = 0; i < n; i++) {
+ IChatManagerListener listener = mRemoteChatCreationListeners.getBroadcastItem(i);
+ listener.chatCreated(newchat, locally);
+ }
+ mRemoteChatCreationListeners.finishBroadcast();
+ } catch (RemoteException e) {
+ // The RemoteCallbackList will take care of removing the
+ // dead listeners.
+ Log.w(TAG, " Error while triggering remote connection listeners in chat creation", e);
+ }
+ }
+
+ /**
+ * Create the PendingIntent to launch our activity if the user select this chat notification.
+ * @param chat A ChatAdapter instance
+ * @return A Chat activity PendingIntent
+ */
+ private PendingIntent makeChatIntent(IChat chat) {
+ Intent chatIntent = new Intent(mService, com.beem.project.beem.ui.Chat.class);
+ chatIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_SINGLE_TOP
+ | Intent.FLAG_ACTIVITY_NEW_TASK);
+ try {
+ chatIntent.setData(chat.getParticipant().toUri());
+ } catch (RemoteException e) {
+ Log.e(TAG, e.getMessage());
+ }
+ PendingIntent contentIntent = PendingIntent.getActivity(mService, 0, chatIntent,
+ PendingIntent.FLAG_UPDATE_CURRENT);
+ return contentIntent;
+ }
+
+ /**
+ * Set a notification of a new chat.
+ * @param chat The chat to access by the notification
+ */
+ private void notifyNewChat(IChat chat) {
+ SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(mService);
+ try {
+ CharSequence tickerText = mService.getBind().getRoster().getContact(chat.getParticipant().getJID())
+ .getName();
+ Notification notification = new Notification(android.R.drawable.stat_notify_chat, tickerText, System
+ .currentTimeMillis());
+ notification.flags = Notification.FLAG_AUTO_CANCEL;
+ notification.setLatestEventInfo(mService, tickerText, mService
+ .getString(R.string.BeemChatManagerNewMessage), makeChatIntent(chat));
+ mService.sendNotification(chat.getParticipant().getJID().hashCode(), notification);
+ } catch (RemoteException e) {
+ Log.e(TAG, e.getMessage());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void processMessage(final IChat chat, Message message) {
+ try {
+ if (!chat.isOpen() && message.getBody() != null) {
+ if (chat instanceof ChatAdapter) {
+ mChats.put(chat.getParticipant().getJID(), (ChatAdapter) chat);
+ }
+ notifyNewChat(chat);
+ }
+ } catch (RemoteException e) {
+ Log.e(TAG, e.getMessage());
+ }
+ }
+
+ @Override
+ public void stateChanged(final IChat chat) { }
+ }
}
--- a/src/com/beem/project/beem/service/ChatAdapter.java Sun Feb 14 17:25:38 2010 +0100
+++ b/src/com/beem/project/beem/service/ChatAdapter.java Sat Dec 25 17:01:00 2010 +0100
@@ -49,7 +49,6 @@
import org.jivesoftware.smack.Chat;
import org.jivesoftware.smack.XMPPException;
-import org.jivesoftware.smack.MessageListener;
import org.jivesoftware.smackx.ChatStateListener;
import org.jivesoftware.smackx.ChatState;
@@ -102,6 +101,7 @@
public void sendMessage(com.beem.project.beem.service.Message message) throws RemoteException {
org.jivesoftware.smack.packet.Message send = new org.jivesoftware.smack.packet.Message();
send.setTo(message.getTo());
+ Log.w(TAG, "message to " + message.getTo());
send.setBody(message.getBody());
send.setThread(message.getThread());
send.setSubject(message.getSubject());
@@ -197,7 +197,7 @@
/**
* Listener.
*/
- private class MsgListener implements MessageListener, ChatStateListener {
+ private class MsgListener implements ChatStateListener {
/**
* Constructor.
*/
--- a/src/com/beem/project/beem/service/Contact.java Sun Feb 14 17:25:38 2010 +0100
+++ b/src/com/beem/project/beem/service/Contact.java Sat Dec 25 17:01:00 2010 +0100
@@ -79,17 +79,13 @@
private int mID;
private int mStatus;
- private String mJID;
+ private final String mJID;
+ private String mSelectedRes;
private String mMsgState;
private List<String> mRes;
- private List<String> mGroups;
+ private final List<String> mGroups = new ArrayList<String>();
private String mName;
-
- /**
- * Constructor.
- */
- public Contact() {
- }
+ private String mAvatarId;
/**
* Construct a contact from a parcel.
@@ -99,10 +95,11 @@
mID = in.readInt();
mStatus = in.readInt();
mJID = in.readString();
+ mSelectedRes = in.readString();
mName = in.readString();
mMsgState = in.readString();
+ mAvatarId = in.readString();
mRes = new ArrayList<String>();
- mGroups = new ArrayList<String>();
in.readStringList(mRes);
in.readStringList(mGroups);
}
@@ -118,9 +115,9 @@
mMsgState = null;
mRes = new ArrayList<String>();
String res = StringUtils.parseResource(jid);
+ mSelectedRes = res;
if (!"".equals(res))
mRes.add(res);
- mGroups = new ArrayList<String>();
}
/**
@@ -137,8 +134,9 @@
mStatus = Status.CONTACT_STATUS_DISCONNECT;
mMsgState = null;
mRes = new ArrayList<String>();
- mRes.add(StringUtils.parseResource(enduri));
- mGroups = new ArrayList<String>();
+ String res = StringUtils.parseResource(enduri);
+ mSelectedRes = res;
+ mRes.add(res);
}
/**
@@ -149,8 +147,10 @@
dest.writeInt(mID);
dest.writeInt(mStatus);
dest.writeString(mJID);
+ dest.writeString(mSelectedRes);
dest.writeString(mName);
dest.writeString(mMsgState);
+ dest.writeString(mAvatarId);
dest.writeStringList(getMRes());
dest.writeStringList(getGroups());
}
@@ -222,6 +222,14 @@
}
/**
+ * Get selected resource.
+ * @return the selected resource.
+ */
+ public String getSelectedRes() {
+ return mSelectedRes;
+ }
+
+ /**
* Get the list of resource for the contact.
* @return the mRes
*/
@@ -254,6 +262,15 @@
}
/**
+ * Get the avatar id of the contact.
+ *
+ * @return the avatar id or null if there is not
+ */
+ public String getAvatarId() {
+ return mAvatarId;
+ }
+
+ /**
* Set the groups the contact is in.
* @param groups list of groups
*/
@@ -269,7 +286,8 @@
* @param groups the mGroups to set
*/
public void setGroups(List<String> groups) {
- this.mGroups = groups;
+ mGroups.clear();
+ mGroups.addAll(groups);
}
/**
@@ -281,11 +299,20 @@
}
/**
- * Set the Jabber ID of the contact.
- * @param jid the jabber ID to set
+ * Set the avatar id of the contact.
+ *
+ * @param avatarId the avatar id
*/
- public void setJID(String jid) {
- mJID = jid;
+ public void setAvatarId(String avatarId) {
+ mAvatarId = avatarId;
+ }
+
+ /**
+ * Set the resource of the contact.
+ * @param resource to set.
+ */
+ public void setSelectedRes(String resource) {
+ mSelectedRes = resource;
}
/**
@@ -343,7 +370,6 @@
public void setStatus(PresenceAdapter presence) {
mStatus = presence.getStatus();
mMsgState = presence.getStatusText();
-
}
/**
@@ -352,7 +378,7 @@
@Override
public String toString() {
if (mJID != null)
- return mJID;
+ return mJID + "/[" + mRes + "]";
return super.toString();
}
@@ -390,4 +416,31 @@
Uri u = Uri.parse(build.toString());
return u;
}
+
+ /**
+ * Get a JID to access the specific contact on this resource.
+ * @return the JID.
+ */
+ public String getJIDWithRes() {
+ StringBuilder build = new StringBuilder(mJID);
+ if (!"".equals(mSelectedRes))
+ build.append('/').append(mSelectedRes);
+ return build.toString();
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (!(other instanceof Contact))
+ return false;
+ if (other == this)
+ return true;
+ Contact c = (Contact) other;
+ return c.getJID().equals(getJID());
+ }
+
+ @Override
+ public int hashCode() {
+ return mJID.hashCode();
+ }
+
}
--- a/src/com/beem/project/beem/service/Message.java Sun Feb 14 17:25:38 2010 +0100
+++ b/src/com/beem/project/beem/service/Message.java Sat Dec 25 17:01:00 2010 +0100
@@ -44,9 +44,12 @@
package com.beem.project.beem.service;
import org.jivesoftware.smack.packet.XMPPError;
+import org.jivesoftware.smackx.packet.DelayInformation;
+import org.jivesoftware.smack.packet.PacketExtension;
import android.os.Parcel;
import android.os.Parcelable;
+import java.util.Date;
/**
* This class represents a instant message.
@@ -86,6 +89,7 @@
private String mTo;
private String mFrom;
private String mThread;
+ private Date mTimestamp;
// TODO ajouter l'erreur
@@ -101,6 +105,7 @@
mSubject = "";
mThread = "";
mFrom = null;
+ mTimestamp = new Date();
}
/**
@@ -151,6 +156,12 @@
mSubject = smackMsg.getSubject();
mThread = smackMsg.getThread();
}
+ PacketExtension pTime = smackMsg.getExtension("delay", "urn:xmpp:delay");
+ if (pTime instanceof DelayInformation) {
+ mTimestamp = ((DelayInformation) pTime).getStamp();
+ } else {
+ mTimestamp = new Date();
+ }
}
/**
@@ -164,6 +175,7 @@
mSubject = in.readString();
mThread = in.readString();
mFrom = in.readString();
+ mTimestamp = new Date(in.readLong());
}
/**
@@ -178,6 +190,7 @@
dest.writeString(mSubject);
dest.writeString(mThread);
dest.writeString(mFrom);
+ dest.writeLong(mTimestamp.getTime());
}
/**
@@ -277,6 +290,24 @@
}
/**
+ * Set the Date of the message.
+ *
+ * @param date date of the message.
+ */
+ public void setTimestamp(Date date) {
+ mTimestamp = date;
+ }
+
+ /**
+ * Get the Date of the message.
+ *
+ * @return if it is a delayed message get the date the message was sended.
+ */
+ public Date getTimestamp() {
+ return mTimestamp;
+ }
+
+ /**
* {@inheritDoc}
*/
@Override
--- a/src/com/beem/project/beem/service/PrivacyListManagerAdapter.java Sun Feb 14 17:25:38 2010 +0100
+++ b/src/com/beem/project/beem/service/PrivacyListManagerAdapter.java Sat Dec 25 17:01:00 2010 +0100
@@ -71,7 +71,8 @@
private final PrivacyListManager mPrivacyListManager;
- private final RemoteCallbackList<IPrivacyListListener> mPrivacyListListeners = new RemoteCallbackList<IPrivacyListListener>();
+ private final RemoteCallbackList<IPrivacyListListener> mPrivacyListListeners =
+ new RemoteCallbackList<IPrivacyListListener>();
private final PrivacyListListenerAdapter mPrivacyListListener = new PrivacyListListenerAdapter();
/**
--- a/src/com/beem/project/beem/service/RosterAdapter.java Sun Feb 14 17:25:38 2010 +0100
+++ b/src/com/beem/project/beem/service/RosterAdapter.java Sat Dec 25 17:01:00 2010 +0100
@@ -46,6 +46,7 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -55,6 +56,7 @@
import org.jivesoftware.smack.RosterListener;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.packet.Presence;
+import org.jivesoftware.smack.util.StringUtils;
import android.content.Context;
import android.os.RemoteCallbackList;
@@ -64,7 +66,9 @@
import com.beem.project.beem.R;
import com.beem.project.beem.service.aidl.IBeemRosterListener;
import com.beem.project.beem.utils.Status;
-import com.beem.project.beem.service.aidl.IRoster;
+import com.beem.project.beem.smack.avatar.AvatarMetadataExtension.Info;
+import com.beem.project.beem.smack.avatar.AvatarManager;
+import com.beem.project.beem.smack.avatar.AvatarListener;
/**
* This class implement a Roster adapter for BEEM.
@@ -73,9 +77,12 @@
private static final String TAG = "RosterAdapter";
private final Roster mAdaptee;
- private final RemoteCallbackList<IBeemRosterListener> mRemoteRosListeners = new RemoteCallbackList<IBeemRosterListener>();
+ private final RemoteCallbackList<IBeemRosterListener> mRemoteRosListeners =
+ new RemoteCallbackList<IBeemRosterListener>();
private final Map<Integer, String> mDefaultStatusMessages;
private final RosterListenerAdapter mRosterListener = new RosterListenerAdapter();
+ private Map<String, String> mAvatarIdmap = new HashMap<String, String>();
+ private AvatarManager mAvatarManager;
/**
* Constructor.
@@ -89,6 +96,22 @@
}
/**
+ * Constructor.
+ * @param roster The roster to adapt.
+ * @param context The context of the RosterAdapter.
+ * @param avatarMgr The AvatarManager of the connection
+ */
+ public RosterAdapter(final Roster roster, final Context context, final AvatarManager avatarMgr) {
+ mAdaptee = roster;
+ roster.addRosterListener(mRosterListener);
+ mDefaultStatusMessages = createDefaultStatusMessagesMap(context);
+ mAvatarManager = avatarMgr;
+ if (mAvatarManager != null)
+ mAvatarManager.addAvatarListener(new AvatarEventListener());
+ }
+
+
+ /**
* {@inheritDoc}
*/
@Override
@@ -110,20 +133,6 @@
Log.e(TAG, "Error while adding new contact", e);
return null;
}
- if (groups != null) {
- for (String groupStr : groups) {
- RosterGroup group = mAdaptee.getGroup(groupStr);
- if (group == null) {
- group = mAdaptee.createGroup(groupStr);
- }
- try {
- group.addEntry(contact);
- } catch (XMPPException e) {
- e.printStackTrace();
- return null;
- }
- }
- }
return getContactFromRosterEntry(contact);
}
@@ -145,11 +154,8 @@
*/
@Override
public void createGroup(String groupname) throws RemoteException {
- try {
+ if (mAdaptee.getGroup(groupname) == null)
mAdaptee.createGroup(groupname);
- } catch (IllegalArgumentException e) {
- Log.v(TAG, "Error while creating group", e);
- }
}
/**
@@ -168,17 +174,10 @@
@Override
public List<Contact> getContactList() throws RemoteException {
boolean add = true;
- List<Contact> coList = new ArrayList<Contact>(mAdaptee.getEntries().size());
- for (RosterEntry entry : mAdaptee.getEntries()) {
- for (Contact c : coList) {
- if (c.getJID().equals(entry.getUser())) {
- add = false;
- break;
- }
- }
- // Because getEntries return duplicated user.
- if (add)
- coList.add(getContactFromRosterEntry(entry));
+ Collection<RosterEntry> list = mAdaptee.getEntries();
+ List<Contact> coList = new ArrayList<Contact>(list.size());
+ for (RosterEntry entry : list) {
+ coList.add(getContactFromRosterEntry(entry));
}
return coList;
}
@@ -264,9 +263,16 @@
try {
c.setGroups(entry.getGroups());
} catch (NullPointerException e) {
- Log.d(TAG, "Group list not ready");
+ Log.d(TAG, "Group list not ready", e);
+ }
+ Iterator<Presence> iPres = mAdaptee.getPresences(user);
+ while (iPres.hasNext()) {
+ p = iPres.next();
+ if (!p.getType().equals(Presence.Type.unavailable))
+ c.addRes(StringUtils.parseResource(p.getFrom()));
}
c.setName(entry.getName());
+ c.setAvatarId(mAvatarIdmap.get(user));
return c;
}
@@ -307,8 +313,6 @@
*/
@Override
public void entriesAdded(Collection<String> addresses) {
- // Log.i(TAG, "Ajout de l'entry " + addresses.size() + " " +
- // addresses.toArray()[0]);
final int n = mRemoteRosListeners.beginBroadcast();
List<String> tab = new ArrayList<String>();
@@ -329,7 +333,6 @@
*/
@Override
public void entriesDeleted(Collection<String> addresses) {
- Log.i(TAG, "Suppression de l'entry");
final int n = mRemoteRosListeners.beginBroadcast();
List<String> tab = new ArrayList<String>();
@@ -350,8 +353,6 @@
*/
@Override
public void entriesUpdated(Collection<String> addresses) {
- Log.i(TAG, "Update de l'entry " + addresses.size() + " " +
- addresses.toArray()[0]);
final int n = mRemoteRosListeners.beginBroadcast();
List<String> tab = new ArrayList<String>();
@@ -373,14 +374,15 @@
@Override
public void presenceChanged(Presence presence) {
final int n = mRemoteRosListeners.beginBroadcast();
+ Log.v(TAG, ">>> Presence changed for " + presence.getFrom());
for (int i = 0; i < n; i++) {
IBeemRosterListener listener = mRemoteRosListeners.getBroadcastItem(i);
try {
- Log.d(TAG, ">>> Presence changed.");
+ if (!presence.isAvailable())
+ mAvatarIdmap.remove(StringUtils.parseBareAddress(presence.getFrom()));
if (presence.getStatus() == null || "".equals(presence.getStatus())) {
presence.setStatus(mDefaultStatusMessages.get(Status.getStatusFromPresence(presence)));
- Log.d(TAG, ">>> Default status added.");
}
listener.onPresenceChanged(new PresenceAdapter(presence));
} catch (RemoteException e) {
@@ -390,4 +392,26 @@
mRemoteRosListeners.finishBroadcast();
}
}
+
+ /**
+ * Listener on avatar metadata event.
+ *
+ */
+ private class AvatarEventListener implements AvatarListener {
+
+ /**
+ * Constructor.
+ */
+ public AvatarEventListener() { }
+
+ @Override
+ public void onAvatarChange(String from, String avatarId, List<Info> avatarInfos) {
+ String bare = StringUtils.parseBareAddress(from);
+ if (avatarId == null)
+ mAvatarIdmap.remove(bare);
+ else {
+ mAvatarIdmap.put(bare, avatarId);
+ }
+ }
+ }
}
--- a/src/com/beem/project/beem/service/XmppConnectionAdapter.java Sun Feb 14 17:25:38 2010 +0100
+++ b/src/com/beem/project/beem/service/XmppConnectionAdapter.java Sat Dec 25 17:01:00 2010 +0100
@@ -55,18 +55,24 @@
import org.jivesoftware.smack.packet.Presence;
import org.jivesoftware.smackx.ChatStateManager;
import org.jivesoftware.smackx.ServiceDiscoveryManager;
-import org.jivesoftware.smackx.jingle.JingleManager;
+import org.jivesoftware.smackx.packet.DiscoverInfo;
import android.app.Notification;
import android.app.PendingIntent;
+import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.RemoteCallbackList;
import android.os.RemoteException;
+import android.os.Environment;
import android.util.Log;
+import java.util.Iterator;
+import java.io.File;
+
import com.beem.project.beem.BeemService;
import com.beem.project.beem.R;
+import com.beem.project.beem.BeemApplication;
import com.beem.project.beem.service.aidl.IBeemConnectionListener;
import com.beem.project.beem.service.aidl.IChatManager;
import com.beem.project.beem.service.aidl.IRoster;
@@ -75,6 +81,10 @@
import com.beem.project.beem.ui.Subscription;
import com.beem.project.beem.utils.BeemBroadcastReceiver;
import com.beem.project.beem.utils.Status;
+import com.beem.project.beem.smack.pep.PepSubManager;
+import com.beem.project.beem.smack.avatar.AvatarCache;
+import com.beem.project.beem.smack.avatar.FileAvatarCache;
+import com.beem.project.beem.smack.avatar.AvatarManager;
/**
* This class implements an adapter for XMPPConnection.
@@ -97,9 +107,16 @@
private String mErrorMsg;
private RosterAdapter mRoster;
private int mPreviousPriority;
+ private int mPreviousMode;
+ private String mPreviousStatus;
private PrivacyListManagerAdapter mPrivacyListManager;
+ private ChatStateManager mChatStateManager;
private final BeemService mService;
- private final RemoteCallbackList<IBeemConnectionListener> mRemoteConnListeners = new RemoteCallbackList<IBeemConnectionListener>();
+ private BeemApplication mApplication;
+ private AvatarManager mAvatarManager;
+ private PepSubManager mPepManager;
+ private final RemoteCallbackList<IBeemConnectionListener> mRemoteConnListeners =
+ new RemoteCallbackList<IBeemConnectionListener>();
private final SubscribePacketListener mSubscribePacketListener = new SubscribePacketListener();
private final ConnexionListenerAdapter mConListener = new ConnexionListenerAdapter();
@@ -142,6 +159,10 @@
mLogin = login;
mPassword = password;
mService = service;
+ Context ctx = mService.getApplicationContext();
+ if (ctx instanceof BeemApplication) {
+ mApplication = (BeemApplication) ctx;
+ }
SharedPreferences pref = mService.getServicePreference();
try {
mPreviousPriority = Integer.parseInt(pref.getString("settings_key_priority", "0"));
@@ -177,7 +198,7 @@
mService.getResources().getIdentifier(
e.getXMPPError().getCondition().replace("-", "_"), "string", "com.beem.project.beem"));
mErrorMsg = str;
- } catch(NullPointerException e2) {
+ } catch (NullPointerException e2) {
if (!"".equals(e.getMessage()))
mErrorMsg = e.getMessage();
else
@@ -192,14 +213,12 @@
public boolean login() throws RemoteException {
if (mAdaptee.isAuthenticated())
return true;
+ if (!mAdaptee.isConnected())
+ return false;
try {
- mAdaptee.login(mLogin, mPassword, mResource);
- mChatManager = new BeemChatManager(mAdaptee.getChatManager(), mService);
- mPrivacyListManager = new PrivacyListManagerAdapter(PrivacyListManager.getInstanceFor(mAdaptee));
this.initFeatures(); // pour declarer les features xmpp qu'on
// supporte
- ChatStateManager.getInstance(mAdaptee);
PacketFilter filter = new PacketFilter() {
@@ -216,10 +235,15 @@
mAdaptee.addPacketListener(mSubscribePacketListener, filter);
+ mAdaptee.login(mLogin, mPassword, mResource);
+ mChatManager = new BeemChatManager(mAdaptee.getChatManager(), mService);
+ mPrivacyListManager = new PrivacyListManagerAdapter(PrivacyListManager.getInstanceFor(mAdaptee));
mService.resetStatus();
mService.initJingle(mAdaptee);
+ discoverServerFeatures();
- // triggerAsynchronousConnectEvent();
+ mRoster = new RosterAdapter(mAdaptee.getRoster(), mService, mAvatarManager);
+ mApplication.setConnected(true);
changeStatus(Status.CONTACT_STATUS_AVAILABLE, mService.getServicePreference().getString("status_text", ""));
return true;
} catch (XMPPException e) {
@@ -270,11 +294,16 @@
if (msg != null)
m = msg;
else
- m = "";
+ m = mPreviousStatus;
pres.setStatus(m);
+ mPreviousStatus = m;
Presence.Mode mode = Status.getPresenceModeFromStatus(status);
- if (mode != null)
+ if (mode != null) {
pres.setMode(mode);
+ mPreviousMode = status;
+ } else {
+ pres.setMode(Status.getPresenceModeFromStatus(mPreviousMode));
+ }
int p = priority;
if (priority < SMACK_PRIORITY_MIN)
p = SMACK_PRIORITY_MIN;
@@ -291,19 +320,32 @@
*/
@Override
public void changeStatus(int status, String msg) {
- Presence pres = new Presence(Presence.Type.available);
- String m;
- if (msg != null)
- m = msg;
- else
- m = "";
- pres.setStatus(m);
- Presence.Mode mode = Status.getPresenceModeFromStatus(status);
- if (mode != null)
- pres.setMode(mode);
- pres.setPriority(mPreviousPriority);
- mAdaptee.sendPacket(pres);
- updateNotification(msg);
+ changeStatusAndPriority(status, msg, mPreviousPriority);
+ }
+
+ /**
+ * Get the AvatarManager of this connection.
+ *
+ * @return the AvatarManager or null if there is not
+ */
+ public AvatarManager getAvatarManager() {
+ return mAvatarManager;
+ }
+
+ /**
+ * get the previous status.
+ * @return previous status.
+ */
+ public String getPreviousStatus() {
+ return mPreviousStatus;
+ }
+
+ /**
+ * get the previous mode.
+ * @return previous mode.
+ */
+ public int getPreviousMode() {
+ return mPreviousMode;
}
/**
@@ -319,7 +361,8 @@
mStatusNotification.setLatestEventInfo(mService, "Beem Status", text, PendingIntent.getActivity(mService, 0,
new Intent(mService, ChangeStatus.class), 0));
- mService.sendNotification(BeemService.NOTIFICATION_STATUS_ID, mStatusNotification);
+ // bypass the preferences for notification
+ mService.getNotificationManager().notify(BeemService.NOTIFICATION_STATUS_ID, mStatusNotification);
}
/**
@@ -349,14 +392,6 @@
}
/**
- * Get the context of the adapter.
- * @return The context of the adapter
- */
- public BeemService getContext() {
- return mService;
- }
-
- /**
* {@inheritDoc}
*/
@Override
@@ -366,21 +401,10 @@
Roster adap = mAdaptee.getRoster();
if (adap == null)
return null;
- mRoster = new RosterAdapter(adap, mService.getApplicationContext());
+ mRoster = new RosterAdapter(adap, mService, mAvatarManager);
return mRoster;
}
- /**
- * enregistre les features dispo dans notre version Liste de features que Telepathy supporte.
- */
- private void initFeatures() {
- ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(mAdaptee);
- if (sdm == null)
- sdm = new ServiceDiscoveryManager(mAdaptee);
- sdm.addFeature("http://jabber.org/protocol/disco#info");
- JingleManager.setJingleServiceEnabled();
- sdm.addFeature("jabber:iq:privacy");
- }
/**
* Returns true if currently authenticated by successfully calling the login method.
@@ -400,13 +424,6 @@
}
/**
- * Trigger Connection event.
- */
- private void triggerAsynchronousConnectEvent() {
- mConListener.onConnect();
- }
-
- /**
* PrivacyListManagerAdapter mutator.
* @param privacyListManager the privacy list manager
*/
@@ -431,6 +448,64 @@
}
/**
+ * Initialize the features provided by beem.
+ */
+ private void initFeatures() {
+ ServiceDiscoveryManager.setIdentityName("Beem");
+ ServiceDiscoveryManager.setIdentityType("phone");
+ ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(mAdaptee);
+ if (sdm == null)
+ sdm = new ServiceDiscoveryManager(mAdaptee);
+
+ sdm.addFeature("http://jabber.org/protocol/disco#info");
+ sdm.addFeature("jabber:iq:privacy");
+ sdm.addFeature("http://jabber.org/protocol/caps");
+ sdm.addFeature("urn:xmpp:avatar:metadata");
+ sdm.addFeature("urn:xmpp:avatar:metadata+notify");
+ sdm.addFeature("urn:xmpp:avatar:data");
+ sdm.addFeature("http://jabber.org/protocol/nick");
+ sdm.addFeature("http://jabber.org/protocol/nick+notify");
+
+ mChatStateManager = ChatStateManager.getInstance(mAdaptee);
+ BeemCapsManager caps = new BeemCapsManager(sdm, mAdaptee, mService);
+ caps.setNode("http://www.beem-project.com");
+ }
+
+ /**
+ * Discover the features provided by the server.
+ */
+ private void discoverServerFeatures() {
+ try {
+ // jid et server
+ ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(mAdaptee);
+ DiscoverInfo info = sdm.discoverInfo("elyzion.net");
+ Iterator<DiscoverInfo.Identity> it = info.getIdentities();
+ while (it.hasNext()) {
+ DiscoverInfo.Identity identity = it.next();
+ if ("pubsub".equals(identity.getCategory()) && "pep".equals(identity.getType())) {
+ initPEP();
+ }
+ }
+ } catch (XMPPException e) {
+ // No Pep
+ }
+ }
+
+ /**
+ * Initialize PEP.
+ */
+ private void initPEP() {
+ // Enable pep sending
+ // API 8
+ // mService.getExternalCacheDir()
+ mPepManager = new PepSubManager(mAdaptee);
+ File cacheDir = Environment.getExternalStorageDirectory();
+ cacheDir = new File(cacheDir, "/Android/data/com.beem.project.beem/cache/");
+ AvatarCache avatarCache = new FileAvatarCache(cacheDir);
+ mAvatarManager = new AvatarManager(mAdaptee, mPepManager, avatarCache, true);
+ }
+
+ /**
* Listener for XMPP connection events. It will calls the remote listeners for connection events.
* @author darisk
*/
@@ -454,6 +529,7 @@
intent.putExtra("normally", true);
mService.sendBroadcast(intent);
mService.stopSelf();
+ mApplication.setConnected(false);
}
/**
@@ -467,6 +543,7 @@
intent.putExtra("message", exception.getMessage());
mService.sendBroadcast(intent);
mService.stopSelf();
+ mApplication.setConnected(false);
}
/**
@@ -490,61 +567,7 @@
}
mRemoteConnListeners.finishBroadcast();
mService.stopSelf();
- }
-
- /**
- * Method to execute when a connection event occurs.
- */
- public void onConnect() {
- PacketFilter filter = new PacketFilter() {
-
- @Override
- public boolean accept(Packet packet) {
- if (packet instanceof Presence) {
- Presence pres = (Presence) packet;
- if (pres.getType() == Presence.Type.subscribe)
- return true;
- }
- return false;
- }
- };
-
- mAdaptee.addPacketListener(new PacketListener() {
-
- @Override
- public void processPacket(Packet packet) {
- String from = packet.getFrom();
- Notification notif = new Notification(android.R.drawable.stat_notify_more, mService.getString(
- R.string.AcceptContactRequest, from), System.currentTimeMillis());
- notif.defaults = Notification.DEFAULT_ALL;
- notif.flags = Notification.FLAG_AUTO_CANCEL;
- Intent intent = new Intent(mService, Subscription.class);
- intent.putExtra("from", from);
- notif.setLatestEventInfo(mService, from, mService
- .getString(R.string.AcceptContactRequestFrom, from), PendingIntent.getActivity(mService, 0,
- intent, PendingIntent.FLAG_ONE_SHOT));
- int id = packet.hashCode();
- mService.sendNotification(id, notif);
- }
- }, filter);
-
- mService.resetStatus();
- mService.initJingle(mAdaptee);
-
- final int n = mRemoteConnListeners.beginBroadcast();
-
- for (int i = 0; i < n; i++) {
- IBeemConnectionListener listener = mRemoteConnListeners.getBroadcastItem(i);
- try {
- if (listener != null)
- listener.onConnect();
- } catch (RemoteException e) {
- // The RemoteCallbackList will take care of removing the
- // dead listeners.
- Log.w(TAG, "Error while triggering remote connection listeners", e);
- }
- }
- mRemoteConnListeners.finishBroadcast();
+ mApplication.setConnected(false);
}
/**
@@ -597,6 +620,7 @@
@Override
public void reconnectionSuccessful() {
Log.d(TAG, "reconnectionSuccessful");
+ mApplication.setConnected(true);
PacketFilter filter = new PacketFilter() {
@Override
@@ -617,10 +641,10 @@
String from = packet.getFrom();
Notification notif = new Notification(android.R.drawable.stat_notify_more, mService.getString(
R.string.AcceptContactRequest, from), System.currentTimeMillis());
- notif.defaults = Notification.DEFAULT_ALL;
notif.flags = Notification.FLAG_AUTO_CANCEL;
Intent intent = new Intent(mService, Subscription.class);
- intent.putExtra("from", from);
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
+ .putExtra("from", from);
notif.setLatestEventInfo(mService, from, mService
.getString(R.string.AcceptContactRequestFrom, from), PendingIntent.getActivity(mService, 0,
intent, PendingIntent.FLAG_ONE_SHOT));
@@ -666,17 +690,16 @@
if (p.getType() != Presence.Type.subscribe)
return;
String from = p.getFrom();
- Notification notif = new Notification(android.R.drawable.stat_notify_more, mService.getString(
+ Notification notification = new Notification(android.R.drawable.stat_notify_more, mService.getString(
R.string.AcceptContactRequest, from), System.currentTimeMillis());
- notif.defaults = Notification.DEFAULT_ALL;
- notif.flags = Notification.FLAG_AUTO_CANCEL;
+ notification.flags = Notification.FLAG_AUTO_CANCEL;
Intent intent = new Intent(mService, Subscription.class);
intent.putExtra("from", from);
- notif.setLatestEventInfo(mService, from, mService
+ notification.setLatestEventInfo(mService, from, mService
.getString(R.string.AcceptContactRequestFrom, from), PendingIntent.getActivity(mService, 0,
intent, PendingIntent.FLAG_ONE_SHOT));
int id = p.hashCode();
- mService.sendNotification(id, notif);
+ mService.sendNotification(id, notification);
}
}
--- a/src/com/beem/project/beem/service/XmppFacade.java Sun Feb 14 17:25:38 2010 +0100
+++ b/src/com/beem/project/beem/service/XmppFacade.java Sat Dec 25 17:01:00 2010 +0100
@@ -43,9 +43,7 @@
*/
package com.beem.project.beem.service;
-import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.packet.Presence;
-import org.jivesoftware.smackx.packet.VCard;
import android.os.RemoteException;
@@ -57,6 +55,7 @@
import com.beem.project.beem.service.aidl.IXmppFacade;
import com.beem.project.beem.service.aidl.IJingle;
import com.beem.project.beem.utils.PresenceType;
+import com.beem.project.beem.smack.avatar.AvatarManager;
/**
* This class is a facade for the Beem Service.
@@ -157,18 +156,22 @@
}
/* (non-Javadoc)
+ * @see com.beem.project.beem.service.aidl.IXmppFacade#call(java.lang.String)
+ */
+ @Override
+ public void call(String jid) throws RemoteException {
+ mJingle.call(jid);
+ }
+
+ /* (non-Javadoc)
* @see com.beem.project.beem.service.aidl.IXmppFacade#getVcardAvatar(java.lang.String)
*/
@Override
- public byte[] getVcardAvatar(String jid) throws RemoteException {
- VCard vcard = new VCard();
+ public byte[] getAvatar(String avatarId) throws RemoteException {
+ AvatarManager mgr = mConnexion.getAvatarManager();
+ if (mgr == null)
+ return null;
- try {
- vcard.load(mConnexion.getAdaptee(), jid);
- return vcard.getAvatar();
- } catch (XMPPException e) {
- e.printStackTrace();
- }
- return null;
+ return mgr.getAvatar(avatarId);
}
}
--- a/src/com/beem/project/beem/service/aidl/IBeemConnectionListener.aidl Sun Feb 14 17:25:38 2010 +0100
+++ b/src/com/beem/project/beem/service/aidl/IBeemConnectionListener.aidl Sat Dec 25 17:01:00 2010 +0100
@@ -56,8 +56,9 @@
/**
* Callback to call when the connection occurs
+ * @Deprecated
*/
- void onConnect();
+ //void onConnect();
//void connectionClosedOnError(in Exception e);
/**
--- a/src/com/beem/project/beem/service/aidl/IChatManager.aidl Sun Feb 14 17:25:38 2010 +0100
+++ b/src/com/beem/project/beem/service/aidl/IChatManager.aidl Sat Dec 25 17:01:00 2010 +0100
@@ -63,6 +63,12 @@
IChat createChat(in Contact contact, in IMessageListener listener);
/**
+ * Get an existing Chat session with a contact.
+ * @return null if the chat session does not exist.
+ */
+ IChat getChat(in Contact contact);
+
+ /**
* Destroy a chat session with a contact.
* @param chat the chat session
*/
@@ -85,5 +91,9 @@
*/
void removeChatCreationListener(in IChatManagerListener listener);
+ /**
+ * Get a list of contact which we are currently chatting.
+ * @return list of contact.
+ */
List<Contact> getOpenedChatList();
}
--- a/src/com/beem/project/beem/service/aidl/IMessageListener.aidl Sun Feb 14 17:25:38 2010 +0100
+++ b/src/com/beem/project/beem/service/aidl/IMessageListener.aidl Sat Dec 25 17:01:00 2010 +0100
@@ -48,10 +48,17 @@
interface IMessageListener {
+ /**
+ * This method is executed when a chat receive a message.
+ * @param chat the chat receiving the message.
+ * @param msg the message received in the chat.
+ */
void processMessage(in IChat chat, in Message msg);
/**
- * le chatState se trouve dans le IChat
- */
+ * This method is executed when a new ChatState is received by the chat.
+ * You can use IChat.getState() in order to get the new state.
+ * @param chat the chat changed.
+ */
void stateChanged(in IChat chat);
}
--- a/src/com/beem/project/beem/service/aidl/IXmppFacade.aidl Sun Feb 14 17:25:38 2010 +0100
+++ b/src/com/beem/project/beem/service/aidl/IXmppFacade.aidl Sat Dec 25 17:01:00 2010 +0100
@@ -97,10 +97,10 @@
void sendPresencePacket(in PresenceAdapter presence);
/**
- * get the user vcard avatar
- * @param jid the user jid
+ * get the an avatar
+ * @param id the id of the avatar
*/
- byte[] getVcardAvatar(in String jid);
+ byte[] getAvatar(in String id);
IPrivacyListManager getPrivacyListManager();
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/smack/avatar/AvatarCache.java Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,90 @@
+/*
+ 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.smack.avatar;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * Interface for an AvatarCache.
+ * This can be improved to a generic cache.
+ *
+ */
+public interface AvatarCache {
+
+ /**
+ * Put some datas in cache.
+ *
+ * @param id the key id of the data
+ * @param data the datato cache
+ * @throws IOException if an IO error occurs while caching the data
+ */
+ void put(String id, byte[] data) throws IOException;
+
+ /**
+ * Put some datas in cache.
+ *
+ * @param id the key id of the data
+ * @param data an InputStream to the data to cache
+ * @throws IOException if an IO error occurs while caching the data
+ */
+ void put(String id, InputStream data) throws IOException;
+
+ /**
+ * Get some data from the cache.
+ *
+ * @param id the id of the data to get
+ * @return the cached data
+ * @throws IOException if an IO error occurs while geting the data
+ */
+ byte[] get(String id) throws IOException;
+
+ /**
+ * Test if a data is in cache.
+ *
+ * @param id the id of the data
+ * @return true if data is in cache false otherwise
+ */
+ boolean contains(String id);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/smack/avatar/AvatarExtension.java Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,111 @@
+/*
+ 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.smack.avatar;
+
+import org.jivesoftware.smack.util.Base64;
+import org.jivesoftware.smack.packet.PacketExtension;
+
+/**
+ * PacketExtension to represent the Avatar data.
+ * XML namespace urn:xmpp:avatar:data
+ *
+ */
+public class AvatarExtension implements PacketExtension {
+
+ private String mData;
+
+ /**
+ * Create an AvatarExtension.
+ * @param base64 the data of the avatar as a base64 string
+ */
+ public AvatarExtension(final String base64) {
+ mData = base64;
+ }
+
+ /**
+ * Create an AvatarExtension.
+ * @param data the data of the avatar
+ */
+ public AvatarExtension(final byte[] data) {
+ mData = Base64.encodeBytes(data);
+ }
+
+ /**
+ * Get the avatar data as a Base64 string.
+ *
+ * @return a base64 string.
+ */
+ public String getBase64() {
+ return mData;
+ }
+
+ /**
+ * Get the avatar data.
+ *
+ * @return the decoded data
+ */
+ public byte[] getData() {
+ return Base64.decode(mData);
+ }
+
+ @Override
+ public String getElementName() {
+ return "data";
+ }
+
+ @Override
+ public String getNamespace() {
+ return "urn:xmpp:avatar:data";
+ }
+
+ @Override
+ public String toXML() {
+ StringBuilder builder = new StringBuilder("<data xmlns=\"");
+ builder.append(getNamespace()).append("\">");
+ builder.append(mData);
+ builder.append("</data>");
+ return builder.toString();
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/smack/avatar/AvatarListener.java Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,64 @@
+/*
+ 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.smack.avatar;
+
+import java.util.List;
+import com.beem.project.beem.smack.avatar.AvatarMetadataExtension.Info;
+
+/**
+ * A listener for avatar changes event.
+ *
+ */
+public interface AvatarListener {
+
+ /**
+ * Event which is fired when a contact change avatar.
+ *
+ * @param from the contact who change his avatar
+ * @param avatarId the new avatar id, may be null if the contact set no avatar
+ * @param avatarInfos the metadata infos of the avatar, may be empty if the contact set no avatar
+ */
+ void onAvatarChange(String from, String avatarId, List<Info> avatarInfos);
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/smack/avatar/AvatarManager.java Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,204 @@
+/*
+ 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.smack.avatar;
+
+import com.beem.project.beem.smack.avatar.AvatarMetadataExtension.Info;
+import com.beem.project.beem.smack.pep.PEPListener;
+import com.beem.project.beem.smack.pep.PepSubManager;
+
+import java.io.IOException;
+
+import java.util.List;
+import java.util.LinkedList;
+
+import org.jivesoftware.smack.Connection;
+import org.jivesoftware.smack.packet.PacketExtension;
+import org.jivesoftware.smackx.pubsub.Item;
+import org.jivesoftware.smackx.pubsub.PayloadItem;
+
+/**
+ * This class deals with the avatar data.
+ * It can be configured to auto retrieve the avatar and put it in cache.
+ *
+ */
+public class AvatarManager {
+
+ private PepSubManager mPep;
+ private Connection mCon;
+ private boolean mAutoDownload;
+ private AvatarCache mCache;
+ private final List<AvatarListener> mListeners = new LinkedList<AvatarListener>();
+
+ /**
+ * Create an AvatarManager.
+ *
+ * @param con the connection
+ * @param pepMgr the PepSubManager of the Connection
+ * @param cache the cache which will store the avatars
+ * @param autoDownload true to enable auto download of avatars
+ */
+ public AvatarManager(final Connection con, final PepSubManager pepMgr, final AvatarCache cache, final boolean autoDownload) {
+ mCon = con;
+ mPep = pepMgr;
+ mAutoDownload = autoDownload;
+ mCache = cache;
+ mPep.addPEPListener(new Listener());
+ }
+
+ /**
+ * Get an avatar from the cache.
+ *
+ * @param avatarId the id of the avatar
+ * @return the avatar or null if it cannot be retrieved from the cache
+ */
+ public byte[] getAvatar(String avatarId) {
+ if (avatarId == null)
+ return null;
+ try {
+ return mCache.get(avatarId);
+ } catch (IOException e) {
+ return null;
+ }
+ }
+
+ /**
+ * Add an AvatarListener.
+ *
+ * @param listener the AvatarListener to add
+ */
+ public void addAvatarListener(AvatarListener listener) {
+ if (!mListeners.contains(listener))
+ mListeners.add(listener);
+ }
+
+ /**
+ * Remove an AvatarListener.
+ *
+ * @param listener the AvatarListener to remove
+ */
+ public void removeAvatarListener(AvatarListener listener) {
+ mListeners.remove(listener);
+ }
+
+
+ /**
+ * Select the avatar to download.
+ * Subclass should override this method to take control over the selection process.
+ * This implementation select the first element.
+ *
+ * @param available list of the avatar metadata information
+ * @return the metadata of the avatar to download
+ */
+ protected Info selectAvatar(List<Info> available) {
+ return available.get(0);
+ }
+
+ /**
+ * Fire the listeners for avatar change.
+ *
+ * @param from the jid of the contact
+ * @param avatarId the new avatar id
+ * @param avatarInfos the metadata infos of the avatar
+ */
+ private void fireListeners(String from, String avatarId, List<Info> avatarInfos) {
+ for (AvatarListener l : mListeners)
+ l.onAvatarChange(from, avatarId, avatarInfos);
+ }
+
+ /**
+ * Download an avatar.
+ *
+ * @param from The jid of the user
+ * @param avatarId the id of the avatar
+ * @param info the metadata information of the avatar to download
+ * @return true if the download was successfull
+ */
+ public boolean downloadAvatar(String from, String avatarId, Info info) {
+ try {
+ AvatarRetriever retriever = AvatarRetrieverFactory.getRetriever(mCon, from, info);
+ byte[] avatar = retriever.getAvatar();
+ // TODO check the hash before store
+ mCache.put(avatarId, avatar);
+ return true;
+ } catch (IOException e) {
+ System.err.println("Error while downloading avatar");
+ e.printStackTrace();
+ return false;
+ }
+ }
+
+ /**
+ * A listener to PEPEevent.
+ */
+ private class Listener implements PEPListener {
+
+ /**
+ * Create a listener.
+ */
+ public Listener() {
+ }
+
+ @Override
+ public void eventReceived(String from, String node, List<Item> items) {
+ if (!"urn:xmpp:avatar:metadata".equals(node))
+ return;
+ Item i = items.get(0);
+ if (i instanceof PayloadItem) {
+ PayloadItem<PacketExtension> pi = (PayloadItem<PacketExtension>) i;
+ PacketExtension ex = pi.getPayload();
+ if (ex instanceof AvatarMetadataExtension) {
+ AvatarMetadataExtension ext = (AvatarMetadataExtension) ex;
+ String id = i.getId();
+ List<Info> infos = ext.getInfos();
+ if (infos.size() > 0 && mAutoDownload) {
+ Info info = selectAvatar(infos);
+ if (!mCache.contains(id))
+ downloadAvatar(from, id, info);
+ }
+ fireListeners(from, id, infos);
+ }
+ }
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/smack/avatar/AvatarMetadataExtension.java Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,257 @@
+/*
+ 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.smack.avatar;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.jivesoftware.smack.packet.PacketExtension;
+
+/**
+ * PacketExtension to represent the Avatar metadata.
+ * XML namespace urn:xmpp:avatar:metadata
+ *
+ */
+public class AvatarMetadataExtension implements PacketExtension {
+ private List<Info> mInfos = new LinkedList<Info>();
+
+ /**
+ * Create an AvatarMetadataExtension.
+ */
+ public AvatarMetadataExtension() {
+ }
+
+ /**
+ * Get the metadata informations.
+ *
+ * @return a list of informations
+ */
+ public List<Info> getInfos() {
+ return mInfos;
+ }
+
+ /**
+ * Add a metadate information.
+ *
+ * @param info the metadata information to add
+ */
+ public void addInfo(Info info) {
+ mInfos.add(info);
+ }
+
+ @Override
+ public String getElementName() {
+ return "metadata";
+ }
+
+ @Override
+ public String getNamespace() {
+ return "urn:xmpp:avatar:metadata";
+ }
+
+ @Override
+ public String toXML() {
+ StringBuilder builder = new StringBuilder("<metadata xmlns=\"");
+ builder.append(getNamespace()).append("\">");
+ for (Info info : mInfos) {
+ builder.append(info.toXML());
+ }
+ builder.append("</metadata>");
+ return builder.toString();
+ }
+
+ /**
+ * A metadata information element.
+ */
+ public static class Info {
+ private int mBytes;
+ private int mHeight;
+ private int mWidth;
+ private String mId;
+ private String mType;
+ private String mUrl;
+
+ /**
+ * Create an Info.
+ *
+ * @param id the id of the info
+ * @param type the MIME type of the avatar
+ * @param bytes the size of the avatar in bytes
+ */
+ public Info(final String id, final String type, final int bytes) {
+ mId = id;
+ mType = type;
+ mBytes = bytes;
+ }
+
+ /**
+ * Set the size of the avatar in bytes.
+ *
+ * @param bytes the size
+ */
+ public void setBytes(int bytes) {
+ this.mBytes = bytes;
+ }
+
+ /**
+ * Set the size of the avatar in bytes.
+ *
+ * @return the size
+ */
+ public int getBytes() {
+ return mBytes;
+ }
+
+ /**
+ * Set the height.
+ *
+ * @param height the height
+ */
+ public void setHeight(int height) {
+ this.mHeight = height;
+ }
+
+ /**
+ * Get the height.
+ *
+ * @return the height
+ */
+ public int getHeight() {
+ return mHeight;
+ }
+
+ /**
+ * Set the width.
+ *
+ * @param width the width
+ */
+ public void setWidth(int width) {
+ this.mWidth = width;
+ }
+
+ /**
+ * Get the width.
+ *
+ * @return the width
+ */
+ public int getWidth() {
+ return mWidth;
+ }
+
+ /**
+ * Set the url.
+ *
+ * @param url the url
+ */
+ public void setUrl(String url) {
+ this.mUrl = url;
+ }
+
+ /**
+ * Get the url.
+ *
+ * @return the url, null if no url is present
+ */
+ public String getUrl() {
+ return mUrl;
+ }
+
+ /**
+ * Get the id.
+ *
+ * @return the id
+ */
+ public String getId() {
+ return mId;
+ }
+
+ /**
+ * Set the id.
+ *
+ * @param id the id
+ */
+ public void setId(String id) {
+ this.mId = id;
+ }
+
+ /**
+ * Set the MIME type of the avatar.
+ *
+ * @param type the type
+ */
+ public void setType(String type) {
+ this.mType = type;
+ }
+
+ /**
+ * Get the MIME type of the avatar.
+ *
+ * @return the type, null if no type is present
+ */
+ public String getType() {
+ return mType;
+ }
+
+ /**
+ * Return this information as an xml element.
+ *
+ * @return an xml element representing this information
+ */
+ public String toXML() {
+ StringBuilder builder = new StringBuilder("<info ");
+ builder.append("id=\"" + mId + "\"");
+ builder.append(" type=\"" + mType + "\"");
+ builder.append(" bytes=\"" + mBytes + "\"");
+
+ if (mHeight > 0)
+ builder.append(" height=\"" + mHeight + "\"");
+ if (mWidth > 0)
+ builder.append(" width=\"" + mWidth + "\"");
+ if (mUrl != null)
+ builder.append(" url=\"" + mUrl + "\"");
+ builder.append(" />");
+ return builder.toString();
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/smack/avatar/AvatarMetadataProvider.java Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,93 @@
+/*
+ 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.smack.avatar;
+
+import org.jivesoftware.smack.packet.PacketExtension;
+import org.jivesoftware.smack.provider.PacketExtensionProvider;
+import org.xmlpull.v1.XmlPullParser;
+
+/**
+ * A PacketExtensionProvider to parse the Avatar metadata.
+ * XML namespace urn:xmpp:avatar:metadata
+ */
+public class AvatarMetadataProvider implements PacketExtensionProvider {
+
+ /**
+ * Creates a new AvatarMetadataProvider.
+ * ProviderManager requires that every PacketExtensionProvider has a public, no-argument constructor
+ */
+ public AvatarMetadataProvider() {
+ }
+
+ @Override
+ public PacketExtension parseExtension(XmlPullParser parser)
+ throws Exception {
+ AvatarMetadataExtension metadata = new AvatarMetadataExtension();
+ boolean done = false;
+ StringBuilder buffer = new StringBuilder();
+ while (!done) {
+ int eventType = parser.next();
+ if (eventType == XmlPullParser.START_TAG) {
+ if ("info".equals(parser.getName())) {
+ int bytes = Integer.parseInt(parser.getAttributeValue(null, "bytes"));
+ int height = Integer.parseInt(parser.getAttributeValue(null, "height"));
+ int width = Integer.parseInt(parser.getAttributeValue(null, "width"));
+ String id = parser.getAttributeValue(null, "id");
+ String type = parser.getAttributeValue(null, "type");
+ String url = parser.getAttributeValue(null, "url");
+ AvatarMetadataExtension.Info info = new AvatarMetadataExtension.Info(id, type, bytes);
+ info.setHeight(height);
+ info.setWidth(width);
+ info.setUrl(url);
+ metadata.addInfo(info);
+ }
+ } else if (eventType == XmlPullParser.END_TAG) {
+ if (parser.getName().equals(metadata.getElementName())) {
+ done = true;
+ }
+ }
+ }
+ return metadata;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/smack/avatar/AvatarProvider.java Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,82 @@
+/*
+ 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.smack.avatar;
+
+import org.jivesoftware.smack.packet.PacketExtension;
+import org.jivesoftware.smack.provider.PacketExtensionProvider;
+import org.xmlpull.v1.XmlPullParser;
+
+/**
+ * A PacketExtensionProvider to parse the Avatar data.
+ * XML namespace urn:xmpp:avatar:data
+ */
+public class AvatarProvider implements PacketExtensionProvider {
+
+ /**
+ * Creates a new AvatarProvider.
+ * ProviderManager requires that every PacketExtensionProvider has a public, no-argument constructor
+ */
+ public AvatarProvider() {
+ }
+
+ @Override
+ public PacketExtension parseExtension(XmlPullParser parser)
+ throws Exception {
+ AvatarMetadataExtension metadata = new AvatarMetadataExtension();
+ boolean done = false;
+ StringBuilder buffer = new StringBuilder();
+ while (!done) {
+ int eventType = parser.getEventType();
+ if (eventType == XmlPullParser.START_TAG) {
+ if ("data".equals(parser.getName())) {
+ String data = parser.nextText();
+ AvatarExtension avatar = new AvatarExtension(data);
+ return avatar;
+ }
+ }
+ parser.next();
+ }
+ return null;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/smack/avatar/AvatarRetriever.java Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,60 @@
+/*
+ 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.smack.avatar;
+
+import java.io.IOException;
+
+/**
+ * Interface for an AvatarRetriever.
+ */
+public interface AvatarRetriever {
+
+ /**
+ * Retrieve the avatar.
+ *
+ * @return the avatar
+ * @throws IOException if an IO error occurs while retrieving the avatar
+ */
+ byte[] getAvatar() throws IOException;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/smack/avatar/AvatarRetrieverFactory.java Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,80 @@
+/*
+ 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.smack.avatar;
+
+import com.beem.project.beem.smack.avatar.AvatarMetadataExtension.Info;
+import org.jivesoftware.smack.Connection;
+// API level 8
+//import android.net.http.AndroidHttpClient;
+//import org.apache.http.client.HttpClient;
+
+/**
+ * A factory for AvatarRetriever.
+ */
+public final class AvatarRetrieverFactory {
+
+ /**
+ * Private constructor.
+ */
+ private AvatarRetrieverFactory() {
+ }
+
+ /**
+ * Get a AvatarRetriever to retrieve this avatar.
+ *
+ * @param con the connection
+ * @param from the user which own the avatar
+ * @param info the metadata information of the avatar to retrieve
+ * @return an AvatarRetriever null if none can retrieve this avatar
+ */
+ public static AvatarRetriever getRetriever(Connection con, String from, Info info) {
+ String url = info.getUrl();
+ if (url != null) {
+ // return new HttpAvatarRetriever(url);
+ // HttpClient client = AndroidHttpClient.newInstance("Beem");
+ return new HttpClientAvatarRetriever(url);
+ }
+ return new XmppAvatarRetriever(con, from, info.getId());
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/smack/avatar/FileAvatarCache.java Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,121 @@
+/*
+ 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.smack.avatar;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+
+/**
+ * An implementation of an AvatarCache which store the data of the filesystem.
+ */
+public class FileAvatarCache implements AvatarCache {
+
+ private File mStoreDir;
+
+ /**
+ * Create a FileAvatarCache.
+ *
+ * @param storedir The directory used to store the data.
+ */
+ public FileAvatarCache(final File storedir) {
+ if (storedir.exists() && !storedir.isDirectory())
+ throw new IllegalArgumentException("The store directory must be a directory");
+ mStoreDir = storedir;
+ mStoreDir.mkdirs();
+ }
+
+ @Override
+ public void put(String key, byte[] data) throws IOException {
+ File f = new File(mStoreDir, key);
+ OutputStream os = new BufferedOutputStream(new FileOutputStream(f));
+ try {
+ os.write(data);
+ } finally {
+ os.close();
+ }
+ }
+
+ @Override
+ public void put(String key, InputStream in) throws IOException {
+ File f = new File(mStoreDir, key);
+ OutputStream os = new BufferedOutputStream(new FileOutputStream(f));
+ try {
+ byte[] data = new byte[1024];
+ int nbread;
+ while ((nbread = in.read(data)) != -1)
+ os.write(data, 0, nbread);
+ } finally {
+ in.close();
+ os.close();
+ }
+ }
+
+ @Override
+ public byte[] get(String key) throws IOException {
+ File f = new File(mStoreDir, key);
+ InputStream is = new BufferedInputStream(new FileInputStream(f));
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ try {
+ byte[] data = new byte[1024];
+ is.read(data);
+ bos.write(data);
+ } finally {
+ is.close();
+ }
+ return bos.toByteArray();
+ }
+
+ @Override
+ public boolean contains(String key) {
+ File f = new File(mStoreDir, key);
+ return f.exists();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/smack/avatar/HttpAvatarRetriever.java Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,96 @@
+/*
+ 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.smack.avatar;
+
+import java.io.InputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.net.URL;
+
+/**
+ * An AvatarRetriever which retrieve the avatar over HTTP.
+ */
+public class HttpAvatarRetriever implements AvatarRetriever {
+
+ private URL mUrl;
+ private String mUrlString;
+
+ /**
+ * Create a HttpAvatarRetriever.
+ *
+ * @param url the url of the avatar to download.
+ */
+ public HttpAvatarRetriever(final URL url) {
+ mUrl = url;
+ }
+
+ /**
+ * Create a HttpAvatarRetriever.
+ *
+ * @param url the url of the avatar to download.
+ */
+ public HttpAvatarRetriever(final String url) {
+ mUrlString = url;
+ }
+
+ @Override
+ public byte[] getAvatar() throws IOException {
+ if (mUrl == null)
+ mUrl = new URL(mUrlString);
+ InputStream in = mUrl.openStream();
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+ try {
+ byte[] data = new byte[1024];
+ int nbread;
+ while ((nbread = in.read(data)) != -1) {
+ os.write(data, 0, nbread);
+ }
+ } finally {
+ in.close();
+ os.close();
+ }
+ return os.toByteArray();
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/smack/avatar/HttpClientAvatarRetriever.java Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,112 @@
+/*
+ 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.smack.avatar;
+
+import java.io.InputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import org.apache.http.client.HttpClient;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpUriRequest;
+import org.apache.http.HttpResponse;
+import org.apache.http.HttpEntity;
+
+/**
+ * An AvatarRetriever which retrieve the avatar over HTTP using the Apache HttpClient.
+ */
+public class HttpClientAvatarRetriever implements AvatarRetriever {
+
+ private String mUrl;
+ private HttpClient mClient;
+
+ /**
+ * Create a HttpAvatarRetriever.
+ *
+ * @param client the custom HttpClient to use to downlowad
+ * @param url the url of the avatar to download.
+ */
+ public HttpClientAvatarRetriever(final HttpClient client, final String url) {
+ mUrl = url;
+ mClient = client;
+ }
+
+ /**
+ * Create a HttpAvatarRetriever.
+ *
+ * @param url the url of the avatar to download.
+ */
+ public HttpClientAvatarRetriever(final String url) {
+ mUrl = url;
+ mClient = new DefaultHttpClient();
+ }
+
+ @Override
+ public byte[] getAvatar() throws IOException {
+ HttpUriRequest request;
+ try {
+ request = new HttpGet(mUrl);
+ } catch (IllegalArgumentException e) {
+ IOException ioe = new IOException("Invalid url " + mUrl);
+ ioe.initCause(e);
+ throw ioe;
+ }
+ HttpResponse response = mClient.execute(request);
+ HttpEntity entity = response.getEntity();
+ InputStream in = entity.getContent();
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+ try {
+ byte[] data = new byte[1024];
+ int nbread;
+ while ((nbread = in.read(data)) != -1) {
+ os.write(data, 0, nbread);
+ }
+ } finally {
+ in.close();
+ os.close();
+ }
+ return os.toByteArray();
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/smack/avatar/XmppAvatarRetriever.java Sat Dec 25 17:01:00 2010 +0100
@@ -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.smack.avatar;
+
+import java.util.List;
+import java.util.Arrays;
+import org.jivesoftware.smack.Connection;
+import org.jivesoftware.smack.XMPPException;
+import org.jivesoftware.smackx.pubsub.LeafNode;
+import org.jivesoftware.smackx.pubsub.Item;
+import org.jivesoftware.smackx.pubsub.PayloadItem;
+
+import com.beem.project.beem.smack.pep.PepSubManager;
+
+/**
+ * An AvatarRetriever which retrieve the avatar over the XMPP connection.
+ */
+public class XmppAvatarRetriever implements AvatarRetriever {
+
+ private static String AVATARDATANODE = "urn:xmpp:avatar:data";
+ private PepSubManager mPubsub;
+ private String mFrom;
+ private String mId;
+
+ /**
+ * Create an XmppAvatarRetriever.
+ *
+ * @param con the xmpp connection
+ * @param from the contact from which we retrieve the avatar
+ * @param id the id of the avatar to retrieve
+ */
+ public XmppAvatarRetriever(final Connection con, final String from, final String id) {
+ mPubsub = new PepSubManager(con, from);
+ mFrom = from;
+ mId = id;
+ }
+
+ @Override
+ public byte[] getAvatar() {
+ try {
+ LeafNode node = mPubsub.getPEPNode(AVATARDATANODE);
+ List<Item> items = node.getItems(Arrays.asList(mId));
+ PayloadItem<AvatarExtension> item = (PayloadItem<AvatarExtension>) items.get(0);
+ AvatarExtension avatar = item.getPayload();
+ return avatar.getData();
+ } catch (XMPPException e) {
+ return null;
+ }
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/smack/avatar/package-info.java Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,48 @@
+/*
+ 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.
+
+*/
+
+/**
+ * This package contains implementation of XEP-0084 User Avatar.
+ */
+package com.beem.project.beem.smack.avatar;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/smack/caps/CapsExtension.java Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,174 @@
+/*
+ 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.smack.caps;
+
+import org.jivesoftware.smack.packet.PacketExtension;
+
+/**
+ * This extension represents a capability of XEP-0115.
+ *
+ */
+public class CapsExtension implements PacketExtension {
+
+ private String mVer;
+ private String mHash;
+ private String mNode;
+ private String mExt;
+
+
+ /**
+ * Create a CapsExtension.
+ *
+ * @param hash The value of the hash attribute.
+ * @param node the value of the node attribute
+ * @param ver the value of the ver attribute.
+ */
+ public CapsExtension(final String hash, final String node, final String ver) {
+ mHash = hash;
+ mNode = node;
+ mVer = ver;
+ }
+
+ /**
+ * Get the ver attribute value.
+ *
+ * @return the value of the ver attribute.
+ */
+ public String getVer() {
+ return mVer;
+ }
+
+ /**
+ * Get the hash attribute value.
+ *
+ * @return the value of the hash attribute.
+ */
+ public String getHash() {
+ return mHash;
+ }
+
+ /**
+ * Get the node attribute value.
+ *
+ * @return the value of the node attribute.
+ */
+ public String getNode() {
+ return mNode;
+ }
+
+ /**
+ * Get the ext attribute value.
+ *
+ * @return the value of the ext attribute.
+ */
+ public String getExt() {
+ return mExt;
+ }
+
+ /**
+ * Set the hash attribute.
+ *
+ * @param hash the value of hash
+ */
+ public void setHash(String hash) {
+ mHash = hash;
+ }
+
+ /**
+ * Set the ver attribute.
+ *
+ * @param ver the value of ver
+ */
+ public void setVer(String ver) {
+ mVer = ver;
+ }
+
+ /**
+ * Set the node attribute.
+ *
+ * @param node the value of node
+ */
+ public void setNode(String node) {
+ mNode = node;
+ }
+
+ /**
+ * Set the ext attribute.
+ *
+ * @param ext the value of ext
+ */
+ public void setExt(String ext) {
+ mExt = ext;
+ }
+
+ @Override
+ public String getElementName() {
+ return "c";
+ }
+
+ @Override
+ public String getNamespace() {
+ return "http://jabber.org/protocol/caps";
+ }
+
+ @Override
+ public String toXML() {
+ StringBuilder b = new StringBuilder("<");
+ b.append(getElementName());
+ b.append(" xmlns=\"").append(getNamespace()).append("\" ");
+ if (mHash != null) {
+ b.append("hash=\"").append(mHash).append("\" ");
+ }
+ if (mNode != null)
+ b.append("node=\"").append(mNode).append("\" ");
+ if (mVer != null)
+ b.append("ver=\"").append(mVer).append("\" ");
+ if (mExt != null)
+ b.append("ext=\"").append(mExt).append("\" ");
+ b.append("/>");
+ return b.toString();
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/smack/caps/CapsManager.java Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,371 @@
+/*
+ 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.smack.caps;
+
+import org.jivesoftware.smack.Connection;
+import org.jivesoftware.smack.PacketInterceptor;
+import org.jivesoftware.smack.XMPPException;
+import org.jivesoftware.smackx.packet.DiscoverInfo;
+import org.jivesoftware.smack.packet.Packet;
+import org.jivesoftware.smack.packet.PacketExtension;
+import org.jivesoftware.smack.packet.Presence;
+import org.jivesoftware.smackx.ServiceDiscoveryManager;
+import org.jivesoftware.smack.util.collections.ReferenceMap;
+import org.jivesoftware.smack.PacketListener;
+import org.jivesoftware.smack.filter.PacketFilter;
+import org.jivesoftware.smack.filter.PacketTypeFilter;
+import org.jivesoftware.smack.filter.PacketExtensionFilter;
+
+import java.util.Map;
+import java.util.Iterator;
+import java.util.Comparator;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.security.NoSuchAlgorithmException;
+import java.security.MessageDigest;
+
+import org.jivesoftware.smack.util.StringUtils;
+
+/**
+ * Capabilities manager to implements XEP-0115.
+ * The DiscoverInfo are cached in memory.
+ *
+ */
+public class CapsManager {
+ // the verCache should be stored on disk
+ private Map<String, DiscoverInfo> mVerCache = new ReferenceMap<String, DiscoverInfo>();
+ private Map<String, DiscoverInfo> mJidCache = new ReferenceMap<String, DiscoverInfo>();
+
+ private ServiceDiscoveryManager mSdm;
+ private Connection mConnection;
+ private String mNode;
+ private List<String> mSupportedAlgorithm = new ArrayList<String>();
+
+ /**
+ * Create a CapsManager.
+ *
+ * @param sdm The service discovery manager to use.
+ * @param conn The connection to manage.
+ */
+ public CapsManager(final ServiceDiscoveryManager sdm, final Connection conn) {
+ mSdm = sdm;
+ mConnection = conn;
+ init();
+ }
+
+ /**
+ * Get the discover info associated with a ver attribute.
+ *
+ * @param ver the ver attribute.
+ * @return the discover info or null if it was not cached.
+ */
+ public DiscoverInfo getDiscoverInfo(String ver) {
+ return mVerCache.get(ver);
+ }
+
+ /**
+ * Get the discover info of a contact.
+ *
+ * @param jid the jid of the contact.
+ * @param ver the ver attribute of the contact capability.
+ * @return The info of the client null if the info was not cached.
+ */
+ public DiscoverInfo getDiscoverInfo(String jid, String ver) {
+ DiscoverInfo info = mVerCache.get(ver);
+ if (info == null) {
+ info = load(ver);
+ if (info == null)
+ info = mJidCache.get(jid);
+ }
+ return info;
+ }
+
+ /**
+ * Set the node attribute to send in your capability.
+ * This is usually an uri to identify the client.
+ *
+ * @param node the node attribute to set.
+ */
+ public void setNode(String node) {
+ mNode = node;
+ }
+
+ /**
+ * Load a persistent DiscoverInfo.
+ * The default implementation does nothing and always return null.
+ *
+ * @param ver the ver hash of the discoverInfo.
+ * @return The discover info or null if not present.
+ */
+ protected DiscoverInfo load(String ver) {
+ return null;
+ }
+
+ /**
+ * Store a DiscoverInfo for persistence.
+ * The default implementation does nothing.
+ *
+ * @param ver the ver hash of the DiscoverInfo
+ * @param info the DiscoverInfo to store
+ */
+ protected void store(String ver, DiscoverInfo info) {
+ }
+
+ /**
+ * Check if the discover info correspondig to the ver hash is in cache.
+ * This implementation checks the memory cache.
+ * If the info is not in cache it is necessary to request it from the network.
+ *
+ * @param ver the ver hash
+ * @return true if it is in cache false otherwise
+ */
+ protected boolean isInCache(String ver) {
+ return mVerCache.containsKey(ver);
+ }
+
+ /**
+ * Initialize this CapsManageer.
+ */
+ private void init() {
+ initSupportedAlgorithm();
+ PacketFilter filter = new PacketExtensionFilter("c", "http://jabber.org/protocol/caps");
+ mConnection.addPacketListener(new PacketListener() {
+ public void processPacket(Packet packet) {
+ if (packet.getFrom().equals(mConnection.getUser()))
+ return;
+ PacketExtension p = packet.getExtension("c", "http://jabber.org/protocol/caps");
+ CapsExtension caps = (CapsExtension) p;
+ if (!isInCache(caps.getVer())) {
+ validate(packet.getFrom(), caps.getVer(), caps.getHash());
+ }
+ }
+ }, filter);
+ mConnection.addPacketInterceptor(new PacketInterceptor() {
+
+ public void interceptPacket(Packet packet) {
+ DiscoverInfo info = getOwnInformation();
+ if (mSupportedAlgorithm.size() > 0) {
+ try {
+ String algo = mSupportedAlgorithm.get(0);
+ String ver = calculateVer(info, algo);
+ CapsExtension caps = new CapsExtension(algo, mNode, ver);
+ packet.addExtension(caps);
+ } catch (NoSuchAlgorithmException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }, new PacketTypeFilter(Presence.class));
+ }
+
+ /**
+ * Validate the ver attribute of a received capability.
+ *
+ * @param jid the jid of the sender of the capability.
+ * @param ver the ver attribute of the capability.
+ * @param hashMethod the hash algorithm to use to calculate ver
+ * @return true if the ver attribute is valid false otherwise.
+ */
+ private boolean validate(String jid, String ver, String hashMethod) {
+ try {
+ DiscoverInfo info = mSdm.discoverInfo(jid);
+ if (!mSupportedAlgorithm.contains(hashMethod)) {
+ mJidCache.put(jid, info);
+ return false;
+ }
+ String v = calculateVer(info, hashMethod);
+ boolean res = v.equals(ver);
+ if (res) {
+ mVerCache.put(ver, info);
+ store(ver, info);
+ }
+ return res;
+ } catch (XMPPException e) {
+ e.printStackTrace();
+ } catch (NoSuchAlgorithmException e) {
+ e.printStackTrace();
+ }
+ return false;
+ }
+
+ /**
+ * Calculate the ver attribute.
+ *
+ * @param info The discover info to calculate the ver.
+ * @param hashMethod the hash algorithm to use.
+ * @return the value of the ver attribute
+ * @throws NoSuchAlgorithmException if the hash algorithm is not supported.
+ */
+ private String calculateVer(DiscoverInfo info, String hashMethod) throws NoSuchAlgorithmException {
+ StringBuilder s = new StringBuilder();
+ for (DiscoverInfo.Identity identity : getSortedIdentity(info)) {
+ String c = identity.getCategory();
+ if (c != null)
+ s.append(c);
+ s.append('/');
+ c = identity.getType();
+ if (c != null)
+ s.append(c);
+ s.append('/');
+ // Should add lang but it is not available
+// c = identity.getType();
+// if (c != null)
+// S.append(c);
+ s.append('/');
+ c = identity.getName();
+ if (c != null)
+ s.append(c);
+ s.append('<');
+ }
+ for (String f : getSortedFeature(info)) {
+ s.append(f);
+ s.append('<');
+ }
+ // Should add data form (XEP 0128) but it is not available
+ byte[] hash = getHash(hashMethod, s.toString().getBytes());
+ return StringUtils.encodeBase64(hash);
+ }
+
+ /**
+ * Get the identities sorted correctly to calculate the ver attribute.
+ *
+ * @param info the DiscoverInfo containing the identities
+ * @return the sorted list of identities.
+ */
+ private List<DiscoverInfo.Identity> getSortedIdentity(DiscoverInfo info) {
+ List<DiscoverInfo.Identity> result = new ArrayList<DiscoverInfo.Identity>();
+ Iterator<DiscoverInfo.Identity> it = info.getIdentities();
+ while (it.hasNext()) {
+ DiscoverInfo.Identity id = it.next();
+ result.add(id);
+ }
+ Collections.sort(result, new Comparator<DiscoverInfo.Identity>() {
+ public int compare(DiscoverInfo.Identity o1, DiscoverInfo.Identity o2) {
+
+ String cat1 = o1.getCategory();
+ if (cat1 == null) cat1 = "";
+ String cat2 = o2.getCategory();
+ if (cat2 == null) cat2 = "";
+ int res = cat1.compareTo(cat2);
+ if (res != 0)
+ return res;
+ String type1 = o1.getType();
+ if (type1 == null) type1 = "";
+ String type2 = o2.getCategory();
+ if (type2 == null) type2 = "";
+ res = type1.compareTo(type2);
+ if (res != 0)
+ return res;
+ // should compare lang but not avalaible
+ return 0;
+ }
+ });
+ return result;
+ }
+
+ /**
+ * Get the features sorted correctly to calculate the ver attribute.
+ *
+ * @param info the DiscoverInfo containing the features
+ * @return the sorted list of features.
+ */
+ private List<String> getSortedFeature(DiscoverInfo info) {
+ List<String> result = new ArrayList<String>();
+ Iterator<DiscoverInfo.Feature> it = info.getFeatures();
+ while (it.hasNext()) {
+ DiscoverInfo.Feature feat = it.next();
+ result.add(feat.getVar());
+ }
+ Collections.sort(result);
+ return result;
+ }
+
+ /**
+ * Get the Discover Information send by your own connection.
+ *
+ * @return your own DiscoverInfo
+ */
+ private DiscoverInfo getOwnInformation() {
+ DiscoverInfo result = new DiscoverInfo();
+ DiscoverInfo.Identity id = new DiscoverInfo.Identity("client", ServiceDiscoveryManager.getIdentityName());
+ id.setType(ServiceDiscoveryManager.getIdentityType());
+ result.addIdentity(id);
+ Iterator<String> it = mSdm.getFeatures();
+ while (it.hasNext()) {
+ result.addFeature(it.next());
+ }
+ return result;
+ }
+
+ /**
+ * Calculate a Hash (digest).
+ *
+ * @param algo the algorithm to use
+ * @param data the data to compute
+ * @return the resulting hash
+ * @throws NoSuchAlgorithmException if the algorithm is not supported
+ */
+ private byte[] getHash(String algo, byte[] data) throws NoSuchAlgorithmException {
+ MessageDigest md = MessageDigest.getInstance(algo);
+ return md.digest(data);
+ }
+
+ /**
+ * Initialize a list of supported Hash algorithm.
+ */
+ private void initSupportedAlgorithm() {
+ // sort by ""preference"
+ String[] algo = new String[] {"sha-1", "md2", "md5", "sha-224", "sha-256", "sha-384", "sha-512" };
+ for (String a : algo) {
+ try {
+ MessageDigest md = MessageDigest.getInstance(a);
+ mSupportedAlgorithm.add(a);
+ } catch (NoSuchAlgorithmException e) {
+ System.err.println("Hash algorithm " + a + " not supported");
+ }
+ }
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/smack/caps/CapsProvider.java Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,74 @@
+/*
+ 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.smack.caps;
+
+import org.xmlpull.v1.XmlPullParser;
+import org.jivesoftware.smack.provider.PacketExtensionProvider;
+import org.jivesoftware.smack.packet.PacketExtension;
+
+/**
+ * PacketExtensionProvider for XEP-0115.
+ * This provider parse c element of namespace
+ * http://jabber.org/protocol/caps which represents a capability of XEP-0115
+ *
+ */
+public class CapsProvider implements PacketExtensionProvider {
+
+ /**
+ * Constructor.
+ */
+ public CapsProvider() { }
+
+ @Override
+ public PacketExtension parseExtension(XmlPullParser parser) {
+ String ver = parser.getAttributeValue("", "ver");
+ String hash = parser.getAttributeValue("", "hash");
+ String node = parser.getAttributeValue("", "node");
+ String ext = parser.getAttributeValue("", "ext");
+ CapsExtension e = new CapsExtension(hash, node, ver);
+ e.setExt(ext);
+ return e;
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/smack/caps/package-info.java Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,48 @@
+/*
+ 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.
+
+*/
+
+/**
+ * This package contains implementation of XEP-0115.
+ */
+package com.beem.project.beem.smack.caps;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/smack/pep/PEPListener.java Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,63 @@
+/*
+ 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.smack.pep;
+
+import org.jivesoftware.smackx.pubsub.Item;
+import java.util.List;
+
+/**
+ * A listener that is fired anytime a PEP event message is received.
+ */
+public interface PEPListener {
+
+ /**
+ * Called when PEP events are received.
+ *
+ * @param from the JID of the user who send the event
+ * @param node the node of the items in the event
+ * @param items the different items of the event
+ */
+ void eventReceived(String from, String node, List<Item> items);
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/smack/pep/PepSubManager.java Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,158 @@
+/*
+ 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.smack.pep;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jivesoftware.smack.Connection;
+import org.jivesoftware.smack.filter.PacketExtensionFilter;
+import org.jivesoftware.smack.filter.PacketFilter;
+import org.jivesoftware.smack.PacketListener;
+import org.jivesoftware.smack.packet.Packet;
+import org.jivesoftware.smackx.pubsub.EventElement;
+import org.jivesoftware.smackx.pubsub.EventElementType;
+import org.jivesoftware.smackx.pubsub.Item;
+import org.jivesoftware.smackx.pubsub.ItemsExtension;
+import org.jivesoftware.smackx.pubsub.PubSubManager;
+import org.jivesoftware.smackx.pubsub.LeafNode;
+
+/**
+ * Little extension of {@link PubSubManager} which allows to add {@link PEPListener}.
+ *
+ */
+public class PepSubManager extends PubSubManager {
+ private List<PEPListener> mPepListeners = new ArrayList<PEPListener>();
+ private PacketFilter mPacketFilter = new PacketExtensionFilter("event", "http://jabber.org/protocol/pubsub#event");
+
+ /**
+ * Create a PepSubManager.
+ *
+ * @param connection the connection
+ */
+ public PepSubManager(final Connection connection) {
+ super(connection);
+ init(connection);
+ }
+
+ /**
+ * Create a PepSubManager associated to the specified connection where the pubsub
+ * requests require a specific to address for packets.
+ *
+ * @param connection the connection
+ * @param toAddress The pubsub specific to address (required for some servers)
+ */
+ public PepSubManager(final Connection connection, final String toAddress) {
+ super(connection, toAddress);
+ init(connection);
+ }
+
+ /**
+ * Add a listener to PEP event.
+ *
+ * @param listener the listener
+ */
+ public void addPEPListener(PEPListener listener) {
+ if (!mPepListeners.contains(listener))
+ mPepListeners.add(listener);
+ }
+
+ /**
+ * Remove a listener to PEP event.
+ *
+ * @param listener the listener
+ */
+ public void removePEPListener(PEPListener listener) {
+ mPepListeners.remove(listener);
+ }
+
+ /**
+ * Get a PepNode.
+ * This node is obtain without checking its existence as PEP should auto create it.
+ *
+ * @param nodeName the node name
+ * @return the node
+ */
+ public LeafNode getPEPNode(String nodeName) {
+ LeafNode node = new LeafNode(con, nodeName);
+ node.setTo(to);
+ return node;
+ }
+
+ /**
+ * Initialize the PepSubManager.
+ *
+ * @param con the connection
+ */
+ private void init(Connection con) {
+ PacketListener packetListener = new PacketListener() {
+
+ @Override
+ public void processPacket(Packet packet) {
+ EventElement e = (EventElement) packet.getExtension("event", "http://jabber.org/protocol/pubsub#event");
+ if (e.getEventType() != EventElementType.items)
+ return;
+ ItemsExtension it = (ItemsExtension) e.getEvent();
+ if (it.getItemsElementType() != ItemsExtension.ItemsElementType.items)
+ return;
+ List<Item> items = (List<Item>) it.getItems();
+ firePEPListeners(packet.getFrom(), it.getNode(), items);
+ }
+ };
+ con.addPacketListener(packetListener, mPacketFilter);
+ }
+
+ /**
+ * Fire the PEP listeners.
+ *
+ * @param from the JID of the user who send the event
+ * @param node the node of the items in the event
+ * @param items the different items of the event
+ */
+ private void firePEPListeners(String from, String node, List<Item> items) {
+ for (PEPListener listener : mPepListeners) {
+ listener.eventReceived(from, node, items);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/smack/pep/package-info.java Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,49 @@
+/*
+ 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.
+
+*/
+
+/**
+ * This package contains an implementation of XEP-0163 Personnal Eventing Protocol based on the pubsub implementation.
+ */
+package com.beem.project.beem.smack.pep;
+
--- a/src/com/beem/project/beem/ui/ChangeStatus.java Sun Feb 14 17:25:38 2010 +0100
+++ b/src/com/beem/project/beem/ui/ChangeStatus.java Sat Dec 25 17:01:00 2010 +0100
@@ -65,6 +65,7 @@
import android.widget.Toast;
import com.beem.project.beem.BeemService;
+import com.beem.project.beem.BeemApplication;
import com.beem.project.beem.R;
import com.beem.project.beem.service.aidl.IXmppFacade;
import com.beem.project.beem.utils.BeemBroadcastReceiver;
@@ -129,7 +130,7 @@
mSettings = PreferenceManager.getDefaultSharedPreferences(this);
mStatusMessageEditText = (EditText) findViewById(R.id.ChangeStatusMessage);
- mStatusMessageEditText.setText(getPreferenceString(R.string.PreferenceStatusText));
+ mStatusMessageEditText.setText(mSettings.getString(BeemApplication.STATUS_TEXT_KEY, ""));
mSpinner = (Spinner) findViewById(R.id.ChangeStatusSpinner);
mAdapter = ArrayAdapter.createFromResource(this, R.array.status_types, android.R.layout.simple_spinner_item);
@@ -180,7 +181,7 @@
* @return the status index from status the settings.
*/
private int getPreferenceStatusIndex() {
- return mSettings.getInt(getString(R.string.PreferenceStatus), AVAILABLE_IDX);
+ return mSettings.getInt(BeemApplication.STATUS_KEY, AVAILABLE_IDX);
}
/**
@@ -269,27 +270,22 @@
@Override
public void onClick(View v) {
if (v == mOk) {
- if (!mStatusMessageEditText.getText().toString().equals(
- getPreferenceString(R.string.PreferenceStatusText))
- || getPreferenceStatusIndex() != mSpinner.getSelectedItemPosition()) {
- String msg = mStatusMessageEditText.getText().toString();
- int status = getStatusForService((String) mSpinner.getSelectedItem());
- Editor edit = mSettings.edit();
- edit.putString(getString(R.string.PreferenceStatusText), msg);
- if (status == Status.CONTACT_STATUS_DISCONNECT) {
- stopService(new Intent(ChangeStatus.this, BeemService.class));
- edit.putInt(getString(R.string.PreferenceStatus), AVAILABLE_IDX);
- } else {
- try {
- mXmppFacade.changeStatus(status, msg.toString());
- edit.putInt(getString(R.string.PreferenceStatus), mSpinner.getSelectedItemPosition());
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- mToast.show();
+ String msg = mStatusMessageEditText.getText().toString();
+ int status = getStatusForService((String) mSpinner.getSelectedItem());
+ Editor edit = mSettings.edit();
+ edit.putString(BeemApplication.STATUS_TEXT_KEY, msg);
+ if (status == Status.CONTACT_STATUS_DISCONNECT) {
+ stopService(new Intent(ChangeStatus.this, BeemService.class));
+ } else {
+ try {
+ mXmppFacade.changeStatus(status, msg.toString());
+ edit.putInt(BeemApplication.STATUS_KEY, mSpinner.getSelectedItemPosition());
+ } catch (RemoteException e) {
+ e.printStackTrace();
}
- edit.commit();
+ mToast.show();
}
+ edit.commit();
ChangeStatus.this.finish();
} else if (v == mClear) {
mStatusMessageEditText.setText(null);
--- a/src/com/beem/project/beem/ui/Chat.java Sun Feb 14 17:25:38 2010 +0100
+++ b/src/com/beem/project/beem/ui/Chat.java Sat Dec 25 17:01:00 2010 +0100
@@ -43,7 +43,9 @@
*/
package com.beem.project.beem.ui;
+import java.text.DateFormat;
import java.util.ArrayList;
+import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -51,15 +53,16 @@
import org.jivesoftware.smack.util.StringUtils;
import android.app.Activity;
-import android.app.AlertDialog;
+import android.app.Dialog;
import android.content.ComponentName;
-import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.ServiceConnection;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
+import android.graphics.drawable.Drawable;
+import android.graphics.drawable.LayerDrawable;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
@@ -72,9 +75,9 @@
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
-import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.view.View.OnKeyListener;
+import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.EditText;
@@ -82,6 +85,8 @@
import android.widget.ListView;
import android.widget.TextView;
+import java.io.ByteArrayInputStream;
+
import com.beem.project.beem.R;
import com.beem.project.beem.service.Contact;
import com.beem.project.beem.service.Message;
@@ -89,9 +94,11 @@
import com.beem.project.beem.service.aidl.IBeemRosterListener;
import com.beem.project.beem.service.aidl.IChat;
import com.beem.project.beem.service.aidl.IChatManager;
+import com.beem.project.beem.service.aidl.IChatManagerListener;
import com.beem.project.beem.service.aidl.IMessageListener;
import com.beem.project.beem.service.aidl.IRoster;
import com.beem.project.beem.service.aidl.IXmppFacade;
+import com.beem.project.beem.ui.dialogs.builders.ChatList;
import com.beem.project.beem.utils.BeemBroadcastReceiver;
import com.beem.project.beem.utils.Status;
@@ -113,10 +120,12 @@
private TextView mContactNameTextView;
private TextView mContactStatusMsgTextView;
+ private TextView mContactChatState;
private ImageView mContactStatusIcon;
private ListView mMessagesListView;
private EditText mInputField;
private Button mSendButton;
+ private LayerDrawable mAvatarStatusDrawable;
private final Map<Integer, Bitmap> mStatusIconsMap = new HashMap<Integer, Bitmap>();
private final List<MessageText> mListMessages = new ArrayList<MessageText>();
@@ -124,12 +133,14 @@
private IChat mChat;
private IChatManager mChatManager;
private final IMessageListener mMessageListener = new OnMessageListener();
+ private final IChatManagerListener mChatManagerListener = new ChatManagerListener();
private MessagesListAdapter mMessagesListAdapter = new MessagesListAdapter();
private final ServiceConnection mConn = new BeemServiceConnection();
private final BeemBroadcastReceiver mBroadcastReceiver = new BeemBroadcastReceiver();
private final BeemRosterListener mBeemRosterListener = new BeemRosterListener();
private IXmppFacade mXmppFacade;
+ private boolean mBinded;
/**
* Constructor.
@@ -150,11 +161,15 @@
// UI
mContactNameTextView = (TextView) findViewById(R.id.chat_contact_name);
mContactStatusMsgTextView = (TextView) findViewById(R.id.chat_contact_status_msg);
+ mContactChatState = (TextView) findViewById(R.id.chat_contact_chat_state);
mContactStatusIcon = (ImageView) findViewById(R.id.chat_contact_status_icon);
+ mAvatarStatusDrawable = (LayerDrawable) mContactStatusIcon.getDrawable();
+ mAvatarStatusDrawable.setLayerInset(1, 36, 36, 0, 0);
mMessagesListView = (ListView) findViewById(R.id.chat_messages);
mMessagesListView.setAdapter(mMessagesListAdapter);
mInputField = (EditText) findViewById(R.id.chat_input);
mInputField.setOnKeyListener(this);
+ mInputField.requestFocus();
mSendButton = (Button) findViewById(R.id.chat_send_message);
mSendButton.setOnClickListener(new OnClickListener() {
@Override
@@ -169,8 +184,11 @@
@Override
protected void onResume() {
super.onResume();
- if (mXmppFacade == null)
+ mContact = new Contact(getIntent().getData());
+ if (!mBinded) {
bindService(SERVICE_INTENT, mConn, BIND_AUTO_CREATE);
+ mBinded = true;
+ }
}
/**
@@ -195,10 +213,15 @@
}
if (mRoster != null)
mRoster.removeRosterListener(mBeemRosterListener);
+ if (mChatManager != null)
+ mChatManager.removeChatCreationListener(mChatManagerListener);
} catch (RemoteException e) {
Log.e(TAG, e.getMessage());
}
- unbindService(mConn);
+ if (mBinded) {
+ unbindService(mConn);
+ mBinded = false;
+ }
mXmppFacade = null;
mRoster = null;
mChat = null;
@@ -219,7 +242,6 @@
*/
@Override
protected void onSaveInstanceState(Bundle savedInstanceState) {
- // TODO
super.onSaveInstanceState(savedInstanceState);
}
@@ -229,7 +251,6 @@
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
- // TODO
}
/**
@@ -257,10 +278,9 @@
case R.id.chat_menu_change_chat:
try {
final List<Contact> openedChats = mChatManager.getOpenedChatList();
- if (openedChats.size() > 0)
- createChatSwitcherDialog(openedChats);
- else
- createNoActiveChatsDialog();
+ Log.d(TAG, "opened chats = " + openedChats);
+ Dialog chatList = new ChatList(Chat.this, openedChats).create();
+ chatList.show();
} catch (RemoteException e) {
Log.e(TAG, e.getMessage());
}
@@ -280,41 +300,6 @@
}
/**
- * Create the change chat dialog.
- * @param openedChats A list containing the JID of participants of the opened chats.
- */
- private void createChatSwitcherDialog(final List<Contact> openedChats) {
- CharSequence[] items = new CharSequence[openedChats.size()];
-
- int i = 0;
- for (Contact c : openedChats) {
- items[i++] = c.getName();
- }
-
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.setTitle(getString(R.string.chat_dialog_change_chat_title));
- builder.setItems(items, new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int item) {
- Intent chatIntent = new Intent(getApplicationContext(), com.beem.project.beem.ui.Chat.class);
- chatIntent.setData((openedChats.get(item)).toUri());
- startActivity(chatIntent);
- }
- });
- AlertDialog chatSwitcherDialog = builder.create();
- chatSwitcherDialog.show();
- }
-
- /**
- * Create a dialog which notify the user that there're not another one active chat.
- */
- private void createNoActiveChatsDialog() {
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.setMessage(getString(R.string.chat_no_more_chats));
- AlertDialog noActiveChatsDialog = builder.create();
- noActiveChatsDialog.show();
- }
-
- /**
* Change the displayed chat.
* @param contact the targeted contact of the new chat
* @throws RemoteException If a Binder remote-invocation error occurred.
@@ -324,13 +309,19 @@
mChat.setOpen(false);
mChat.removeMessageListener(mMessageListener);
}
- mChat = mChatManager.createChat(contact, mMessageListener);
- mChat.setOpen(true);
- mChatManager.deleteChatNotification(mChat);
-
+ mChat = mChatManager.getChat(contact);
+ if (mChat != null) {
+ mChat.setOpen(true);
+ mChat.addMessageListener(mMessageListener);
+ mChatManager.deleteChatNotification(mChat);
+ }
mContact = mRoster.getContact(contact.getJID());
+ String res = contact.getSelectedRes();
if (mContact == null)
mContact = contact;
+ if (!"".equals(res)) {
+ mContact.setSelectedRes(res);
+ }
updateContactInformations();
updateContactStatusIcon();
@@ -343,13 +334,15 @@
*/
private void playRegisteredTranscript() throws RemoteException {
mListMessages.clear();
- List<MessageText> msgList = convertMessagesList(mChat.getMessages());
- mListMessages.addAll(msgList);
- mMessagesListAdapter.notifyDataSetChanged();
+ if (mChat != null) {
+ List<MessageText> msgList = convertMessagesList(mChat.getMessages());
+ mListMessages.addAll(msgList);
+ mMessagesListAdapter.notifyDataSetChanged();
+ }
}
/**
- * Convert a list of Mesage coming from the service to a list of MessageText that can be displayed in UI.
+ * Convert a list of Message coming from the service to a list of MessageText that can be displayed in UI.
* @param chatMessages the list of Message
* @return a list of message that can be displayed.
*/
@@ -364,8 +357,7 @@
String fromBareJid = StringUtils.parseBareAddress(m.getFrom());
if (m.getType() == Message.MSG_TYPE_ERROR) {
lastMessage = null;
- result.add(new MessageText(fromBareJid, name, m.getBody(), true));
- continue;
+ result.add(new MessageText(fromBareJid, name, m.getBody(), true, m.getTimestamp()));
} else if (m.getType() == Message.MSG_TYPE_CHAT) {
if (fromBareJid == null) { //nofrom or from == yours
name = localName;
@@ -373,8 +365,8 @@
}
if (m.getBody() != null) {
- if (lastMessage == null || ! fromBareJid.equals(lastMessage.getBareJid())) {
- lastMessage = new MessageText(fromBareJid, name, m.getBody());
+ if (lastMessage == null || !fromBareJid.equals(lastMessage.getBareJid())) {
+ lastMessage = new MessageText(fromBareJid, name, m.getBody(), false, m.getTimestamp());
result.add(lastMessage);
} else {
lastMessage.setMessage(lastMessage.getMessage().concat("\n" + m.getBody()));
@@ -393,7 +385,8 @@
/**
* Constructor.
*/
- public BeemServiceConnection() { }
+ public BeemServiceConnection() {
+ }
/**
* {@inheritDoc}.
@@ -402,11 +395,14 @@
public void onServiceConnected(ComponentName name, IBinder service) {
mXmppFacade = IXmppFacade.Stub.asInterface(service);
try {
- if ((mRoster = mXmppFacade.getRoster()) != null)
+ mRoster = mXmppFacade.getRoster();
+ if (mRoster != null)
mRoster.addRosterListener(mBeemRosterListener);
- mContact = new Contact(getIntent().getData());
- if ((mChatManager = mXmppFacade.getChatManager()) != null)
+ mChatManager = mXmppFacade.getChatManager();
+ if (mChatManager != null) {
+ mChatManager.addChatCreationListener(mChatManagerListener);
changeCurrentChat(mContact);
+ }
} catch (RemoteException e) {
Log.e(TAG, e.getMessage());
}
@@ -420,6 +416,7 @@
mXmppFacade = null;
try {
mRoster.removeRosterListener(mBeemRosterListener);
+ mChatManager.removeChatCreationListener(mChatManagerListener);
} catch (RemoteException e) {
Log.e(TAG, e.getMessage());
}
@@ -501,17 +498,19 @@
@Override
public void run() {
if (msg.getType() == Message.MSG_TYPE_ERROR) {
- mListMessages.add(new MessageText(fromBareJid, mContact.getName(), msg.getBody(), true));
+ mListMessages.add(new MessageText(fromBareJid, mContact.getName(), msg.getBody(), true, msg.getTimestamp()));
mMessagesListAdapter.notifyDataSetChanged();
- } else if (msg.getBody() != null ) {
- MessageText lastMessage = mListMessages.size() != 0 ? mListMessages.get(mListMessages
- .size() - 1) : null;
+ } else if (msg.getBody() != null) {
+ MessageText lastMessage = null;
+ if (mListMessages.size() != 0)
+ lastMessage = mListMessages.get(mListMessages.size() - 1);
if (lastMessage != null && lastMessage.getBareJid().equals(fromBareJid)) {
lastMessage.setMessage(lastMessage.getMessage().concat("\n" + msg.getBody()));
+ lastMessage.setTimestamp(msg.getTimestamp());
mListMessages.set(mListMessages.size() - 1, lastMessage);
} else if (msg.getBody() != null)
- mListMessages.add(new MessageText(fromBareJid, mContact.getName(), msg.getBody()));
+ mListMessages.add(new MessageText(fromBareJid, mContact.getName(), msg.getBody(), false, msg.getTimestamp()));
mMessagesListAdapter.notifyDataSetChanged();
}
}
@@ -524,7 +523,26 @@
*/
@Override
public void stateChanged(IChat chat) throws RemoteException {
- //TODO
+ final String state = chat.getState();
+ mHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ String text = null;
+ if ("active".equals(state)) {
+ text = Chat.this.getString(R.string.chat_state_active);
+ } else if ("composing".equals(state)) {
+ text = Chat.this.getString(R.string.chat_state_composing);
+ } else if ("gone".equals(state)) {
+ text = Chat.this.getString(R.string.chat_state_gone);
+ } else if ("inactive".equals(state)) {
+ text = Chat.this.getString(R.string.chat_state_inactive);
+ } else if ("paused".equals(state)) {
+ text = Chat.this.getString(R.string.chat_state_active);
+ }
+ mContactChatState.setText(text);
+ }
+ });
+
}
}
@@ -533,8 +551,12 @@
*/
private void updateContactInformations() {
// Check for a contact name update
- if (!(mContactNameTextView.getText().toString().equals(mContact.getName())))
- mContactNameTextView.setText(mContact.getName());
+ String name = mContact.getName();
+ String res = mContact.getSelectedRes();
+ if (!"".equals(res))
+ name += "(" + res + ")";
+ if (!(mContactNameTextView.getText().toString().equals(name)))
+ mContactNameTextView.setText(name);
// Check for a contact status message update
if (!(mContactStatusMsgTextView.getText().toString().equals(mContact.getMsgState()))) {
@@ -547,7 +569,31 @@
* Update the contact status icon.
*/
private void updateContactStatusIcon() {
- mContactStatusIcon.setImageBitmap(mStatusIconsMap.get(mContact.getStatus()));
+ Drawable avatar = getAvatarDrawable(mContact.getAvatarId());
+ mAvatarStatusDrawable.setDrawableByLayerId(R.id.avatar, avatar);
+ mContactStatusIcon.setImageLevel(mContact.getStatus());
+ }
+
+ /**
+ * Get a Drawable containing the avatar icon.
+ *
+ * @param avatarId the avatar id to retrieve or null to get default
+ * @return a Drawable
+ */
+ private Drawable getAvatarDrawable(String avatarId) {
+ Drawable avatarDrawable = null;
+ try {
+ byte[] avatar = mXmppFacade.getAvatar(avatarId);
+ if (avatar != null) {
+ ByteArrayInputStream in = new ByteArrayInputStream(avatar);
+ avatarDrawable = Drawable.createFromStream(in, avatarId);
+ }
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error while setting the avatar", e);
+ }
+ if (avatarDrawable == null)
+ avatarDrawable = getResources().getDrawable(R.drawable.beem_launcher_icon_silver);
+ return avatarDrawable;
}
/**
@@ -630,6 +676,10 @@
msgName.setError(null);
TextView msgText = (TextView) sv.findViewById(R.id.chatmessagetext);
msgText.setText(msg.getMessage());
+ TextView msgDate = (TextView) sv.findViewById(R.id.chatmessagedate);
+ DateFormat df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM);
+ String date = df.format(msg.getTimestamp());
+ msgDate.setText(date);
if (msg.isError()) {
String err = getString(R.string.chat_error);
msgName.setText(err);
@@ -649,6 +699,7 @@
private String mName;
private String mMessage;
private boolean mIsError;
+ private Date mTimestamp;
/**
* Constructor.
@@ -678,6 +729,22 @@
}
/**
+ * Constructor.
+ * @param bareJid A String containing the bare JID of the message's author.
+ * @param name A String containing the name of the message's author.
+ * @param message A String containing the message.
+ * @param isError if the message is an error message.
+ * @param date the time of the message.
+ */
+ public MessageText(final String bareJid, final String name, final String message, final boolean isError, Date date) {
+ mBareJid = bareJid;
+ mName = name;
+ mMessage = message;
+ mIsError = isError;
+ mTimestamp = date;
+ }
+
+ /**
* JID attribute accessor.
* @return A String containing the bare JID of the message's author.
*/
@@ -734,6 +801,25 @@
public boolean isError() {
return mIsError;
}
+
+ /**
+ * Set the Date of the message.
+ *
+ * @param date date of the message.
+ */
+ public void setTimestamp(Date date) {
+ mTimestamp = date;
+ }
+
+ /**
+ * Get the Date of the message.
+ *
+ * @return if it is a delayed message get the date the message was sended.
+ */
+ public Date getTimestamp() {
+ return mTimestamp;
+ }
+
}
/**
@@ -760,24 +846,66 @@
final String inputContent = mInputField.getText().toString();
if (!"".equals(inputContent)) {
- Message msgToSend = new Message(mContact.getJID(), Message.MSG_TYPE_CHAT);
+ Message msgToSend = new Message(mContact.getJIDWithRes(), Message.MSG_TYPE_CHAT);
msgToSend.setBody(inputContent);
try {
+ if (mChat == null) {
+ mChat = mChatManager.createChat(mContact, mMessageListener);
+ mChat.setOpen(true);
+ }
mChat.sendMessage(msgToSend);
} catch (RemoteException e) {
Log.e(TAG, e.getMessage());
}
final String self = getString(R.string.chat_self);
- MessageText lastMessage = mListMessages.size() != 0 ? mListMessages.get(mListMessages.size() - 1) : null;
+ MessageText lastMessage = null;
+ if (mListMessages.size() != 0)
+ lastMessage = mListMessages.get(mListMessages.size() - 1);
if (lastMessage != null && lastMessage.getName().equals(self)) {
lastMessage.setMessage(lastMessage.getMessage().concat("\n" + inputContent));
+ lastMessage.setTimestamp(new Date());
} else
- mListMessages.add(new MessageText(self, self, inputContent));
+ mListMessages.add(new MessageText(self, self, inputContent, false, new Date()));
mMessagesListAdapter.notifyDataSetChanged();
mInputField.setText(null);
}
}
+
+ /**
+ * This class is in charge of getting the new chat in the activity if someone talk to you.
+ */
+ private class ChatManagerListener extends IChatManagerListener.Stub {
+
+ /**
+ * Constructor.
+ */
+ public ChatManagerListener() {
+ }
+
+ @Override
+ public void chatCreated(IChat chat, boolean locally) {
+ if (locally)
+ return;
+ try {
+ String contactJid = mContact.getJIDWithRes();
+ String chatJid = chat.getParticipant().getJIDWithRes();
+ if (chatJid.equals(contactJid)) {
+ // This should not be happened but to be sure
+ if (mChat != null) {
+ mChat.setOpen(false);
+ mChat.removeMessageListener(mMessageListener);
+ }
+ mChat = chat;
+ mChat.setOpen(true);
+ mChat.addMessageListener(mMessageListener);
+ mChatManager.deleteChatNotification(mChat);
+ }
+ } catch (RemoteException ex) {
+ Log.e(TAG, "A remote exception occurs during the creation of a chat", ex);
+ }
+ }
+ }
}
--- a/src/com/beem/project/beem/ui/ContactList.java Sun Feb 14 17:25:38 2010 +0100
+++ b/src/com/beem/project/beem/ui/ContactList.java Sat Dec 25 17:01:00 2010 +0100
@@ -39,15 +39,17 @@
Flavien Astraud, November 26, 2009
- */
+*/
package com.beem.project.beem.ui;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.io.ByteArrayInputStream;
import org.jivesoftware.smack.util.StringUtils;
@@ -58,8 +60,6 @@
import android.content.IntentFilter;
import android.content.ServiceConnection;
import android.content.SharedPreferences;
-import android.graphics.BitmapFactory;
-import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
@@ -75,25 +75,32 @@
import android.view.ViewGroup;
import android.view.ViewStub;
import android.widget.AdapterView;
+import android.widget.AdapterView.AdapterContextMenuInfo;
+import android.widget.AdapterView.OnItemClickListener;
import android.widget.BaseAdapter;
+import android.widget.Filter;
+import android.widget.Filterable;
import android.widget.Gallery;
+import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
-import android.widget.AdapterView.AdapterContextMenuInfo;
-import android.widget.AdapterView.OnItemClickListener;
+import android.graphics.drawable.Drawable;
+import android.graphics.drawable.LayerDrawable;
import com.beem.project.beem.R;
import com.beem.project.beem.service.Contact;
import com.beem.project.beem.service.PresenceAdapter;
import com.beem.project.beem.service.aidl.IBeemRosterListener;
-import com.beem.project.beem.service.aidl.IJingle;
+import com.beem.project.beem.service.aidl.IChatManager;
import com.beem.project.beem.service.aidl.IRoster;
import com.beem.project.beem.service.aidl.IXmppFacade;
import com.beem.project.beem.ui.dialogs.builders.Alias;
+import com.beem.project.beem.ui.dialogs.builders.ChatList;
import com.beem.project.beem.ui.dialogs.builders.DeleteContact;
import com.beem.project.beem.ui.dialogs.builders.ResendSubscription;
import com.beem.project.beem.utils.BeemBroadcastReceiver;
+import com.beem.project.beem.utils.SortedList;
import com.beem.project.beem.utils.Status;
/**
@@ -101,40 +108,42 @@
*/
public class ContactList extends Activity {
- // private static final String TAG = "CONTACTLIST_ACT";
private static final Intent SERVICE_INTENT = new Intent();
static {
SERVICE_INTENT.setComponent(new ComponentName("com.beem.project.beem", "com.beem.project.beem.BeemService"));
}
- private static final int REQUEST_CODE = 1;
private static final String SETTINGS_HIDDEN_CONTACT = "settings_key_hidden_contact";
private static final String TAG = "ContactList";
private final BeemContactList mAdapterContactList = new BeemContactList();
- private final BeemBanner mAdapterBanner = new BeemBanner();
private final List<String> mListGroup = new ArrayList<String>();
+
+ /** Map containing a list of the different contacts of a given group.
+ * Each list is a @{link SortedList} so there is no need to sort it again.
+ * */
private final Map<String, List<Contact>> mContactOnGroup = new HashMap<String, List<Contact>>();
+ private final BeemContactListOnClick mOnContactClick = new BeemContactListOnClick();
private final Handler mHandler = new Handler();
private final ServiceConnection mServConn = new BeemServiceConnection();
private final BeemBroadcastReceiver mReceiver = new BeemBroadcastReceiver();
private final ComparatorContactListByStatusAndName<Contact> mComparator =
new ComparatorContactListByStatusAndName<Contact>();
private final BeemRosterListener mBeemRosterListener = new BeemRosterListener();
- private final Map<Integer, BitmapDrawable> mIconsMap = new HashMap<Integer, BitmapDrawable>();
private List<Contact> mListContact;
+ private String mSelectedGroup;
private IRoster mRoster;
- private String mCurGroup;
- private Contact mContact;
+ private Contact mSelectedContact;
private IXmppFacade mXmppFacade;
- private IJingle mJingle;
+ private IChatManager mChatManager;
private SharedPreferences mSettings;
private LayoutInflater mInflater;
+ private BeemBanner mAdapterBanner;
+ private boolean mBinded;
/**
* Constructor.
*/
public ContactList() {
-
}
/**
@@ -150,28 +159,37 @@
return true;
}
- /**
- * Callback for menu item selected.
- * @param item the item selected
- * @return true on success, false otherwise
- */
@Override
public final boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.contact_list_menu_settings:
- startActivityForResult(new Intent(this, Settings.class), REQUEST_CODE);
+ startActivity(new Intent(this, Settings.class));
return true;
case R.id.contact_list_menu_add_contact:
startActivity(new Intent(ContactList.this, AddContact.class));
return true;
+ case R.id.menu_change_status:
+ startActivity(new Intent(ContactList.this, ChangeStatus.class));
+ return true;
+ case R.id.contact_list_menu_chatlist:
+ List<Contact> openedChats;
+ try {
+ openedChats = mChatManager.getOpenedChatList();
+ Log.d(TAG, "opened chats = " + openedChats);
+ Dialog chatList = new ChatList(ContactList.this, openedChats).create();
+ chatList.show();
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ return true;
+ case R.id.menu_disconnect:
+ stopService(SERVICE_INTENT);
+ finish();
default:
return false;
}
}
- /**
- * {@inheritDoc}
- */
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
@@ -180,26 +198,30 @@
AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo;
Contact c = mListContact.get(info.position);
try {
- mContact = mRoster.getContact(c.getJID());
+ mSelectedContact = mRoster.getContact(c.getJID());
} catch (RemoteException e) {
e.printStackTrace();
}
- menu.setHeaderTitle(mContact.getJID());
+ menu.setHeaderTitle(mSelectedContact.getJID());
}
- /**
- * {@inheritDoc}
- */
@Override
public boolean onContextItemSelected(MenuItem item) {
Intent in;
boolean result;
- if (mContact != null) {
+ if (mSelectedContact != null) {
switch (item.getItemId()) {
case R.id.contact_list_context_menu_chat_item:
- in = new Intent(this, Chat.class);
- in.setData(mContact.toUri());
- startActivity(in);
+ List<String> res = mSelectedContact.getMRes();
+ if (res.isEmpty()) {
+ result = false;
+ break;
+ }
+ for (String resv : res) {
+ in = new Intent(this, Chat.class);
+ in.setData(mSelectedContact.toUri(resv));
+ item.getSubMenu().add(resv).setIntent(in);
+ }
result = true;
break;
case R.id.contact_list_context_menu_call_item:
@@ -216,22 +238,23 @@
result = true;
break;
case R.id.contact_list_context_menu_user_info:
- item.getSubMenu().setHeaderTitle(mContact.getJID());
+ item.getSubMenu().setHeaderTitle(mSelectedContact.getJID());
result = true;
break;
case R.id.contact_list_context_menu_userinfo_alias:
- Dialog alias = new Alias(ContactList.this, mRoster, mContact).create();
+ Dialog alias = new Alias(ContactList.this, mRoster, mSelectedContact).create();
alias.show();
result = true;
break;
case R.id.contact_list_context_menu_userinfo_group:
in = new Intent(this, GroupList.class);
- in.putExtra("contact", mContact);
+ in.putExtra("contact", mSelectedContact);
startActivity(in);
result = true;
break;
case R.id.contact_list_context_menu_userinfo_subscription:
- Dialog subscription = new ResendSubscription(ContactList.this, mXmppFacade, mContact).create();
+ Dialog subscription = new ResendSubscription(ContactList.this,
+ mXmppFacade, mSelectedContact).create();
subscription.show();
result = true;
break;
@@ -239,38 +262,19 @@
result = true;
break;
case R.id.contact_list_context_menu_userinfo_delete:
- Dialog delete = new DeleteContact(ContactList.this, mRoster, mContact).create();
+ Dialog delete = new DeleteContact(ContactList.this, mRoster, mSelectedContact).create();
delete.show();
result = true;
break;
default:
result = super.onContextItemSelected(item);
- break;
+ break;
}
return result;
}
return super.onContextItemSelected(item);
}
- /*
- * (non-Javadoc)
- * @see android.app.Activity#onActivityResult(int, int, android.content.Intent)
- */
- @Override
- protected void onActivityResult(int requestCode, int resultCode, Intent data) {
- super.onActivityResult(requestCode, resultCode, data);
- if (requestCode == REQUEST_CODE) {
- if (resultCode == RESULT_OK) {
- mListContact.clear();
- stopService(SERVICE_INTENT);
- finish();
- }
- }
- }
-
- /**
- * {@inheritDoc}
- */
@Override
protected void onCreate(Bundle saveBundle) {
super.onCreate(saveBundle);
@@ -280,24 +284,19 @@
this.registerReceiver(mReceiver, new IntentFilter(BeemBroadcastReceiver.BEEM_CONNECTION_CLOSED));
mInflater = getLayoutInflater();
- prepareIconsStatus();
+ mAdapterBanner = new BeemBanner(mInflater, mListGroup);
+ mListContact = new ArrayList<Contact>();
+ ListView listView = (ListView) findViewById(R.id.contactlist);
+ listView.setOnItemClickListener(mOnContactClick);
+ registerForContextMenu(listView);
+ listView.setAdapter(mAdapterContactList);
}
- /**
- * {@inheritDoc}
- */
@Override
protected void onResume() {
super.onResume();
- if (mXmppFacade == null)
- bindService(SERVICE_INTENT, mServConn, BIND_AUTO_CREATE);
- else {
- if (!mSettings.getBoolean("settings_key_hide_groups", false))
- buildBanner();
- else
- hideGroups();
- buildContactList();
- }
+ if (!mBinded)
+ mBinded = bindService(SERVICE_INTENT, mServConn, BIND_AUTO_CREATE);
}
/**
@@ -314,14 +313,13 @@
} catch (RemoteException e) {
Log.d("ContactList", "Remote exception", e);
}
- unbindService(mServConn);
+ if (mBinded) {
+ unbindService(mServConn);
+ mBinded = false;
+ }
mXmppFacade = null;
}
- /*
- * (non-Javadoc)
- * @see android.app.Activity#onDestroy()
- */
@Override
protected void onDestroy() {
super.onDestroy();
@@ -330,38 +328,571 @@
}
/**
- * Comparator Contact by Name.
+ * Build and display the contact list.
+ * @param group name of the contact list.
+ */
+ private void buildContactList(String group) {
+ mListContact = mContactOnGroup.get(group);
+ mSelectedGroup = group;
+ Log.d(TAG, "buildContactList for group " + group);
+ mAdapterContactList.notifyDataSetChanged();
+ }
+
+ /**
+ * Show the groups view.
*/
- @SuppressWarnings("unused")
- private class ComparatorContactListByName<T> implements Comparator<T> {
+ private void showGroups() {
+
+ ViewStub stub = (ViewStub) findViewById(R.id.contactlist_stub);
+ if (stub != null) {
+ View v = stub.inflate();
+ Gallery g = (Gallery) v.findViewById(R.id.contactlist_banner);
+ g.setOnItemClickListener(new OnItemClickGroupName());
+ g.setAdapter(mAdapterBanner);
+ g.setSelection(0);
+ } else {
+ ((LinearLayout) findViewById(R.id.contactlist_groupstub)).setVisibility(View.VISIBLE);
+ Gallery g = (Gallery) findViewById(R.id.contactlist_banner);
+ g.setSelection(0);
+ }
+ }
+
+ /**
+ * Hide the groups view.
+ */
+ private void hideGroups() {
+ View v = findViewById(R.id.contactlist_groupstub);
+ if (v != null)
+ v.setVisibility(View.GONE);
+ }
+
+ /**
+ * Listener on service event.
+ */
+ private class BeemRosterListener extends IBeemRosterListener.Stub {
/**
* Constructor.
*/
- public ComparatorContactListByName() {
+ public BeemRosterListener() {
+ }
+
+ /**
+ * {@inheritDoc}
+ * Simple stategy to handle the onEntriesAdded event.
+ * if contact has to be shown :
+ * <ul>
+ * <li> add him to his groups</li>
+ * <li> add him to the specials groups</>
+ * </ul>
+ */
+ @Override
+ public void onEntriesAdded(final List<String> addresses) throws RemoteException {
+ final boolean hideDisconnected = mSettings.getBoolean(SETTINGS_HIDDEN_CONTACT, false);
+ for (String newName : addresses) {
+ Contact contact = mRoster.getContact(newName);
+ boolean visible = !hideDisconnected || Status.statusOnline(contact.getStatus());
+ List<String> groups = contact.getGroups();
+ if (visible) {
+ for (String group : groups) {
+ if (!mListGroup.contains(group)) {
+ mListGroup.add(mListGroup.size() - 1, group);
+ List<Contact> tmplist = new SortedList<Contact>(new LinkedList<Contact>(), mComparator);
+ mContactOnGroup.put(group, tmplist);
+ }
+ List<Contact> contactByGroups = mContactOnGroup.get(group);
+ if (mSelectedGroup.equals(group)) {
+ updateCurrentList(group, contact);
+ continue;
+ }
+ contactByGroups.add(contact);
+ }
+
+ // add the contact to all and no groups
+ addToSpecialList(contact);
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ * Simple stategy to handle the onEntriesDeleted event.
+ * <ul>
+ * <li> Remove the contact from all groups</li>
+ * </ul>
+ */
+ @Override
+ public void onEntriesDeleted(final List<String> addresses) throws RemoteException {
+ Log.d(TAG, "onEntries deleted " + addresses);
+ for (String cToDelete : addresses) {
+ Contact contact = new Contact(cToDelete);
+ for (Map.Entry<String, List<Contact>> entry : mContactOnGroup.entrySet()) {
+ List<Contact> contactByGroups = entry.getValue();
+ if (mSelectedGroup.equals(entry.getKey())) {
+ updateCurrentList(entry.getKey(), contact);
+ continue;
+ }
+ contactByGroups.remove(contact);
+ }
+ cleanBannerGroup();
+ }
+
+ mHandler.post(new Runnable() {
+ public void run() {
+ mSelectedGroup = getString(R.string.contact_list_all_contact);
+ mListContact = mContactOnGroup.get(mSelectedGroup);
+
+ mAdapterContactList.notifyDataSetChanged();
+ }
+ });
+
+ }
+
+ /**
+ * {@inheritDoc}
+ * Simple stategy to handle the onEntriesUpdated event.
+ * <ul>
+ * <li> Remove the contact from all groups</li>
+ * <li> if contact has to be shown add it to his groups</li>
+ * <li> if contact has to be shown add it to the specials groups</li>
+ * </ul>
+ */
+ @Override
+ public void onEntriesUpdated(final List<String> addresses) throws RemoteException {
+ final boolean hideDisconnected = mSettings.getBoolean(SETTINGS_HIDDEN_CONTACT, false);
+ for (String adr : addresses) {
+ Contact contact = mRoster.getContact(adr);
+ boolean visible = !hideDisconnected || Status.statusOnline(contact.getStatus());
+ List<String> groups = contact.getGroups();
+ for (Map.Entry<String, List<Contact>> entry : mContactOnGroup.entrySet()) {
+ List<Contact> contactByGroups = entry.getValue();
+ if (mSelectedGroup.equals(entry.getKey())) {
+ updateCurrentList(entry.getKey(), contact);
+ continue;
+ }
+ contactByGroups.remove(contact);
+ if (visible) {
+ for (String group : groups) {
+ if (!mListGroup.contains(group)) {
+ mListGroup.add(mListGroup.size() - 1, group);
+ List<Contact> tmplist = new SortedList<Contact>(
+ new LinkedList<Contact>(), mComparator);
+ mContactOnGroup.put(group, tmplist);
+ }
+ mContactOnGroup.get(group).remove(contact);
+ }
+ }
+
+ }
+
+ // add the contact to all and no groups
+ if (visible) {
+ addToSpecialList(contact);
+ }
+ }
+ cleanBannerGroup();
+ }
+
+ /**
+ * {@inheritDoc}
+ * Simple stategy to handle the onPresenceChanged event.
+ * <ul>
+ * <li> Remove the contact from all groups</li>
+ * <li> if contact has to be shown add it to his groups</li>
+ * <li> if contact has to be shown add it to the specials groups</li>
+ * </ul>
+ */
+ @Override
+ public void onPresenceChanged(PresenceAdapter presence) throws RemoteException {
+ Log.d(TAG, "presence");
+ String from = presence.getFrom();
+ final boolean hideDisconnected = mSettings.getBoolean(SETTINGS_HIDDEN_CONTACT, false);
+ final Contact contact = mRoster.getContact(StringUtils.parseBareAddress(from));
+ boolean visible = !hideDisconnected || Status.statusOnline(contact.getStatus());
+ List<String> groups = contact.getGroups();
+ for (Map.Entry<String, List<Contact>> entry : mContactOnGroup.entrySet()) {
+ List<Contact> contactByGroups = entry.getValue();
+ if (mSelectedGroup.equals(entry.getKey())) {
+ updateCurrentList(entry.getKey(), contact);
+ continue;
+ }
+ contactByGroups.remove(contact);
+ if (visible) {
+ if (groups.contains(entry.getKey())) {
+ contactByGroups.add(contact);
+ }
+ }
+ }
+ if (visible) {
+ addToSpecialList(contact);
+ }
+ }
+
+ /**
+ * Add a contact to the special list No Group and All contacts.
+ * The contact will be added if the list is not the current list otherwise
+ * the list must be modified in a Handler.
+ *
+ * @param contact the contact to add.
+ */
+ private void addToSpecialList(Contact contact) {
+ List<String> groups = contact.getGroups();
+ List<Contact> list = mContactOnGroup.get(getString(R.string.contact_list_all_contact));
+ if (list != mListContact) {
+ list.add(contact);
+ }
+ list = mContactOnGroup.get(getString(R.string.contact_list_no_group));
+ if (list != mListContact && groups.isEmpty()) {
+ list.add(contact);
+ }
+ }
+
+ /**
+ * Update the current list with the status of contact.
+ *
+ * @param listName name of the current list
+ * @param contact contact to update
+ */
+ private void updateCurrentList(String listName, final Contact contact) {
+ final boolean hideDisconnected = mSettings.getBoolean(SETTINGS_HIDDEN_CONTACT, false);
+ final List<String> groups = contact.getGroups();
+ String noGroup = getString(R.string.contact_list_no_group);
+ String allGroup = getString(R.string.contact_list_all_contact);
+ final boolean add = ((!hideDisconnected || Status.statusOnline(contact.getStatus())) && // must show and
+ (
+ (listName.equals(noGroup) && groups.isEmpty()) || // in no group
+ groups.contains(listName) || // or in current
+ listName.equals(allGroup) // or in all
+ ));
+ mHandler.post(new Runnable() {
+ public void run() {
+ mListContact.remove(contact);
+ if (add) {
+ mListContact.add(contact);
+ }
+ mAdapterContactList.notifyDataSetChanged();
+ }
+ });
+
+ }
+
+ /**
+ * Remove old groups on the banner.
+ * @throws RemoteException if an error occur when communicating with the service
+ */
+ private void cleanBannerGroup() throws RemoteException {
+ List<String> rosterGroups = mRoster.getGroupsNames();
+ List<String> realGroups = mListGroup.subList(1, mListContact.size() - 1);
+ realGroups.retainAll(rosterGroups);
+ }
+
+ }
+
+ /**
+ * Adapter contact list.
+ */
+ private class BeemContactList extends BaseAdapter implements Filterable {
+
+ private final ContactFilter mFilter;
+
+ /**
+ * Constructor.
+ */
+ public BeemContactList() {
+ mFilter = new ContactFilter();
}
/**
* {@inheritDoc}
*/
@Override
- public int compare(T c1, T c2) {
- return ((Contact) c1).getName().compareToIgnoreCase(((Contact) c2).getName());
+ public int getCount() {
+ return mListContact.size();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Object getItem(int position) {
+ return mListContact.get(position);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public long getItemId(int position) {
+ return mListContact.get(position).hashCode();
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ View v = convertView;
+ if (convertView == null) {
+ v = mInflater.inflate(R.layout.contactlistcontact, null);
+ }
+ Contact c = mListContact.get(position);
+ if (mRoster != null) {
+ try {
+ c = mRoster.getContact(c.getJID());
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+ bindView(v, c);
+ return v;
+ }
+
+ @Override
+ public Filter getFilter() {
+ return mFilter;
+ }
+
+ /**
+ * Adapte curContact to the view.
+ * @param view the row view.
+ * @param curContact the current contact.
+ */
+ private void bindView(View view, Contact curContact) {
+ if (curContact != null) {
+ TextView v = (TextView) view.findViewById(R.id.contactlistpseudo);
+ v.setText(curContact.getName());
+ v = (TextView) view.findViewById(R.id.contactlistmsgperso);
+ v.setText(curContact.getMsgState());
+ ImageView img = (ImageView) view.findViewById(R.id.avatar);
+ String avatarId = curContact.getAvatarId();
+ int contactStatus = curContact.getStatus();
+ Drawable avatar = getAvatarStatusDrawable(curContact.getAvatarId());
+ img.setImageDrawable(avatar);
+ img.setImageLevel(contactStatus);
+ }
+ }
+
+ /**
+ * Get a LayerDrawable containing the avatar and the status icon.
+ * The status icon will change with the level of the drawable.
+ * @param avatarId the avatar id to retrieve or null to get default
+ * @return a LayerDrawable
+ */
+ private Drawable getAvatarStatusDrawable(String avatarId) {
+ Drawable avatarDrawable = null;
+ try {
+ byte[] avatar = mXmppFacade.getAvatar(avatarId);
+ if (avatar != null) {
+ ByteArrayInputStream in = new ByteArrayInputStream(avatar);
+ avatarDrawable = Drawable.createFromStream(in, avatarId);
+ }
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error while setting the avatar", e);
+ }
+ if (avatarDrawable == null)
+ avatarDrawable = getResources().getDrawable(R.drawable.beem_launcher_icon_silver);
+ LayerDrawable ld = (LayerDrawable) getResources().getDrawable(R.drawable.avatar_status);
+ ld.setLayerInset(1, 36, 36, 0, 0);
+ ld.setDrawableByLayerId(R.id.avatar, avatarDrawable);
+ return ld;
+ }
+
+ /**
+ * A Filter which select Contact to display by searching in ther Jid.
+ */
+ private class ContactFilter extends Filter {
+
+ /**
+ * Create a ContactFilter.
+ */
+ public ContactFilter() { }
+
+ @Override
+ protected Filter.FilterResults performFiltering(CharSequence constraint) {
+ Log.d(TAG, "performFiltering");
+ List<Contact> result = mListContact;
+ if (constraint.length() > 0) {
+ result = new LinkedList<Contact>();
+ for (Contact c : mContactOnGroup.get(mSelectedGroup)) {
+ if (c.getJID().contains(constraint))
+ result.add(c);
+ }
+ }
+ Filter.FilterResults fr = new Filter.FilterResults();
+ fr.values = result;
+ fr.count = result.size();
+ return fr;
+ }
+
+ @Override
+ protected void publishResults(CharSequence constraint, Filter.FilterResults results) {
+ Log.d(TAG, "publishResults");
+ List<Contact> contacts = (List<Contact>) results.values;
+ mListContact = contacts;
+ notifyDataSetChanged();
+ }
}
}
/**
+ * Adapter banner list.
+ */
+ private static class BeemBanner extends BaseAdapter {
+ private List<String> mGroups;
+ private LayoutInflater mInflater;
+
+ /**
+ * Constructor.
+ * @param inflater the inflater use to create the view for the banner
+ * @param groups list of the differents groups to adapt
+ */
+ public BeemBanner(final LayoutInflater inflater, final List<String> groups) {
+ mGroups = groups;
+ mInflater = inflater;
+ }
+
+ @Override
+ public int getCount() {
+ return mGroups.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return mGroups.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ View v = convertView;
+ if (convertView == null) {
+ v = mInflater.inflate(R.layout.contactlist_group, null);
+ }
+ ((TextView) v).setText(mGroups.get(position));
+ return v;
+ }
+ }
+
+ /**
+ * The service connection used to connect to the Beem service.
+ */
+ private class BeemServiceConnection implements ServiceConnection {
+
+ /**
+ * Constructor.
+ */
+ public BeemServiceConnection() {
+ }
+
+ @Override
+ public void onServiceConnected(ComponentName name, IBinder service) {
+ mXmppFacade = IXmppFacade.Stub.asInterface(service);
+ try {
+ mRoster = mXmppFacade.getRoster();
+ if (mRoster != null) {
+ List<String> tmpGroupList = mRoster.getGroupsNames();
+ Collections.sort(tmpGroupList);
+ mListGroup.clear();
+ mListGroup.add(getString(R.string.contact_list_all_contact));
+ mListGroup.addAll(tmpGroupList);
+ mListGroup.add(getString(R.string.contact_list_no_group));
+ assignContactToGroups(mRoster.getContactList(), tmpGroupList);
+ makeSortedList(mContactOnGroup);
+ if (!mSettings.getBoolean("settings_key_hide_groups", false))
+ showGroups();
+ else
+ hideGroups();
+ String group = getString(R.string.contact_list_all_contact);
+ buildContactList(group);
+ mRoster.addRosterListener(mBeemRosterListener);
+ Log.d(TAG, "add roster listener");
+ mChatManager = mXmppFacade.getChatManager();
+ }
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void onServiceDisconnected(ComponentName name) {
+ try {
+ mRoster.removeRosterListener(mBeemRosterListener);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ mXmppFacade = null;
+ mChatManager = null;
+ mRoster = null;
+ mListContact.clear();
+ mListGroup.clear();
+ mContactOnGroup.clear();
+ mBinded = false;
+ }
+
+ /**
+ * Assign the differents contact to their groups.
+ * This methods will fill the mContactOnGroup map.
+ *
+ * @param contacts list of contacts
+ * @param groupNames list of existing groups
+ */
+ private void assignContactToGroups(List<Contact> contacts, List<String> groupNames) {
+ boolean hideDisconnected = mSettings.getBoolean(SETTINGS_HIDDEN_CONTACT, false);
+ mContactOnGroup.clear();
+ List<Contact> all = new LinkedList<Contact>();
+ List<Contact> noGroups = new LinkedList<Contact>();
+ for (String group : groupNames) {
+ mContactOnGroup.put(group, new LinkedList<Contact>());
+ }
+ for (Contact c : contacts) {
+ if (hideDisconnected && !Status.statusOnline(c.getStatus())) {
+ continue;
+ }
+ all.add(c);
+ List<String> groups = c.getGroups();
+ if (groups.isEmpty())
+ noGroups.add(c);
+ else {
+ for (String currentGroup : groups) {
+ List<Contact> contactsByGroups = mContactOnGroup.get(currentGroup);
+ contactsByGroups.add(c);
+ }
+ }
+ }
+ mContactOnGroup.put(getString(R.string.contact_list_no_group), noGroups);
+ mContactOnGroup.put(getString(R.string.contact_list_all_contact), all);
+ }
+
+ /**
+ * Make the List of the map became Insertion sorted list.
+ *
+ * @param map the map to convert.
+ */
+ private void makeSortedList(Map<String, List<Contact>> map) {
+ for (Map.Entry<String, List<Contact>> entry : map.entrySet()) {
+ List<Contact> l = entry.getValue();
+ entry.setValue(new SortedList<Contact>(l, mComparator));
+ }
+ }
+ }
+
+
+
+
+ /**
* Comparator Contact by status and name.
*/
- private class ComparatorContactListByStatusAndName<T> implements Comparator<T> {
+ private static class ComparatorContactListByStatusAndName<T> implements Comparator<T> {
/**
* Constructor.
*/
public ComparatorContactListByStatusAndName() {
}
- /**
- * {@inheritDoc}
- */
@Override
public int compare(T c1, T c2) {
if (((Contact) c1).getStatus() < ((Contact) c2).getStatus()) {
@@ -374,35 +905,6 @@
}
/**
- * Contact List construction.
- */
- private void buildContactList() {
- if (mCurGroup != null) {
- mListContact = mContactOnGroup.get(mCurGroup);
- }
- sortBeemContactList();
- ListView listView = (ListView) findViewById(R.id.contactlist);
- listView.setOnItemClickListener(new BeemContactListOnClick());
- registerForContextMenu(listView);
- listView.setAdapter(mAdapterContactList);
- }
-
- /**
- * buildBanner.
- */
- private void buildBanner() {
-
- ViewStub stub = (ViewStub) findViewById(R.id.contactlist_stub);
- if (stub != null)
- stub.inflate();
- else
- ((LinearLayout) findViewById(R.id.contactlist_groupstub)).setVisibility(View.VISIBLE);
- Gallery g = (Gallery) findViewById(R.id.contactlist_banner);
- g.setOnItemClickListener(new OnItemClickGroupName());
- g.setAdapter(mAdapterBanner);
- }
-
- /**
* Event simple click on item of the contact list.
*/
private class BeemContactListOnClick implements OnItemClickListener {
@@ -437,408 +939,9 @@
@Override
public void onItemClick(AdapterView<?> arg0, View v, int i, long l) {
- mCurGroup = mListGroup.get(i);
- buildContactList();
- }
- }
-
- /**
- * Prepare Bitmap Map.
- */
- private void prepareIconsStatus() {
- mIconsMap.put(Status.CONTACT_STATUS_AVAILABLE, new BitmapDrawable(BitmapFactory.decodeResource(getResources(),
- android.R.drawable.presence_online)));
- mIconsMap.put(Status.CONTACT_STATUS_AVAILABLE_FOR_CHAT,
- new BitmapDrawable(BitmapFactory.decodeResource(getResources(), android.R.drawable.presence_online)));
- mIconsMap.put(Status.CONTACT_STATUS_AWAY,
- new BitmapDrawable(BitmapFactory.decodeResource(getResources(), android.R.drawable.presence_away)));
- mIconsMap.put(Status.CONTACT_STATUS_BUSY,
- new BitmapDrawable(BitmapFactory.decodeResource(getResources(), android.R.drawable.presence_busy)));
- mIconsMap.put(Status.CONTACT_STATUS_DISCONNECT, new BitmapDrawable(BitmapFactory.decodeResource(getResources(),
- android.R.drawable.presence_offline)));
- mIconsMap.put(Status.CONTACT_STATUS_UNAVAILABLE, new BitmapDrawable(BitmapFactory.decodeResource(getResources(),
- R.drawable.status_requested)));
- }
-
- /**
- * Sort the contact list.
- */
- private void sortBeemContactList() {
- Collections.sort(mListContact, mComparator);
- }
-
- /**
- * Listener on service event.
- */
- private class BeemRosterListener extends IBeemRosterListener.Stub {
- /**
- * Constructor.
- */
- public BeemRosterListener() {
- }
-
- /**
- * Refresh the contact list.
- */
- private class RunnableChange implements Runnable {
- /**
- * Constructor.
- */
- public RunnableChange() {
-
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void run() {
- sortBeemContactList();
- mAdapterContactList.notifyDataSetChanged();
- mAdapterBanner.notifyDataSetChanged();
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void onEntriesAdded(List<String> addresses) throws RemoteException {
- for (String newName : addresses) {
- Contact c = mRoster.getContact(newName);
- mContactOnGroup.get(getString(R.string.contact_list_all_contact)).add(c);
- if (c.getGroups().size() == 0)
- mContactOnGroup.get(getString(R.string.contact_list_no_group)).add(c);
- else {
- for (String group : c.getGroups()) {
- if (!mListGroup.contains(group)) {
- mListGroup.add(mListGroup.size() - 1, group);
- List<Contact> tmplist = new ArrayList<Contact>();
- mContactOnGroup.put(group, tmplist);
- }
- mContactOnGroup.get(group).add(c);
- if (group.equals(mCurGroup) && !mListContact.contains(c))
- mListContact.add(c);
- }
- }
- }
- mHandler.post(new RunnableChange());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void onEntriesDeleted(List<String> addresses) throws RemoteException {
- for (String cToDelete : addresses) {
- for (Contact c : mListContact) {
- if (c.getJID().equals(cToDelete)) {
- for (String group : mListGroup) {
- mContactOnGroup.get(group).remove(c);
- if (mContactOnGroup.get(group).size() == 0) {
- //mContactOnGroup.remove(group);
- //mListGroup.remove(group);
- }
- }
- mListContact.remove(c);
- break;
- }
- }
- }
- mListContact = mContactOnGroup.get(getString(R.string.contact_list_all_contact));
- mHandler.post(new RunnableChange());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void onEntriesUpdated(List<String> addresses) throws RemoteException {
- for (String adr : addresses) {
- Contact c = mRoster.getContact(adr);
- if (c.getGroups() != null) {
- if (mContactOnGroup.get(getString(R.string.contact_list_no_group)).contains(c)) {
- mContactOnGroup.get(getString(R.string.contact_list_no_group)).remove(c);
- }
- }
- }
- mHandler.post(new RunnableChange());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void onPresenceChanged(PresenceAdapter presence) throws RemoteException {
- String from = presence.getFrom();
- boolean resfound = false;
- for (Contact curContact : mListContact) {
- if (curContact.getJID().equals(StringUtils.parseBareAddress(from))) {
- String pres = StringUtils.parseResource(from);
- for (String res : curContact.getMRes()) {
- if (res.equals(pres)) {
- resfound = true;
- break;
- }
- }
- curContact.setStatus(mRoster.getPresence(StringUtils.parseBareAddress(presence.getFrom())));
- int status = presence.getStatus();
- if (!resfound && !Status.statusOnline(status))
- curContact.addRes(pres);
- else if (resfound && Status.statusOnline(status))
- curContact.delRes(pres);
- mHandler.post(new RunnableChange());
- return;
- }
- }
+ String group = mListGroup.get(i);
+ buildContactList(group);
}
}
- /**
- * Adapter contact list.
- */
- private class BeemContactList extends BaseAdapter {
-
- /**
- * Constructor.
- */
- public BeemContactList() {
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int getCount() {
- if (mSettings.getBoolean(SETTINGS_HIDDEN_CONTACT, false)) {
- int res = 0;
- for (Contact c : mListContact) {
- if (Status.statusOnline(c.getStatus()))
- res++;
- }
- return res;
- } else {
- return mListContact.size();
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Object getItem(int position) {
- Contact c = null;
- if (mSettings.getBoolean(SETTINGS_HIDDEN_CONTACT, false)) {
- int res = 0;
- for (Contact cur : mListContact) {
- if (res == position) {
- c = cur;
- break;
- }
- if (Status.statusOnline(cur.getStatus()))
- res++;
- }
- } else
- c = mListContact.get(position);
- return c;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public long getItemId(int position) {
- return position;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- View v = convertView;
- if (convertView == null) {
- v = mInflater.inflate(R.layout.contactlistcontact, null);
- }
- Contact c = null;
- if (mSettings.getBoolean(SETTINGS_HIDDEN_CONTACT, false)) {
- int res = 0;
- for (Contact cur : mListContact) {
- if (res == position) {
- c = cur;
- break;
- }
- if (Status.statusOnline(cur.getStatus()))
- res++;
- }
- } else
- c = mListContact.get(position);
- if (mRoster != null) {
- try {
- c = mRoster.getContact(c.getJID());
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- }
- if (mSettings.getBoolean(SETTINGS_HIDDEN_CONTACT, false) && !Status.statusOnline(c.getStatus())) {
- v.setVisibility(View.GONE);
- } else {
- bindView(v, c);
- }
- return v;
- }
-
- /**
- * Adapte curContact to the view.
- * @param view the row view.
- * @param curContact the current contact.
- */
- private void bindView(View view, Contact curContact) {
-
- if (curContact != null) {
- TextView v = (TextView) view.findViewById(R.id.contactlistpseudo);
- v.setCompoundDrawablesWithIntrinsicBounds(mIconsMap.get(curContact.getStatus()), null, null, null);
- v.setText(curContact.getName());
- v = (TextView) view.findViewById(R.id.contactlistmsgperso);
- v.setText(curContact.getMsgState());
- }
- }
- }
-
- /**
- * Adapter banner list.
- */
- private class BeemBanner extends BaseAdapter {
- /**
- * Constructor.
- */
- public BeemBanner() {
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int getCount() {
- return mListGroup.size();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Object getItem(int position) {
- return mListGroup.get(position);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public long getItemId(int position) {
- return position;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- View v = convertView;
- if (convertView == null) {
- v = mInflater.inflate(R.layout.contactlist_group, null);
- }
- ((TextView) v).setText(mListGroup.get(position));
- return v;
- }
-
- }
-
- /**
- * Create dialog resend subscription.
- */
-
- /**
- * The service connection used to connect to the Beem service.
- */
- private class BeemServiceConnection implements ServiceConnection {
-
- /**
- * Constructor.
- */
- public BeemServiceConnection() {
- }
-
- @Override
- public void onServiceConnected(ComponentName name, IBinder service) {
- mXmppFacade = IXmppFacade.Stub.asInterface(service);
- try {
- mRoster = mXmppFacade.getRoster();
- mJingle = mXmppFacade.getJingleService();
- if (mRoster != null) {
- mRoster.addRosterListener(mBeemRosterListener);
- List<Contact> tmpContactList = mRoster.getContactList();
- List<String> tmpGroupList = mRoster.getGroupsNames();
- Collections.sort(tmpGroupList);
- if (mListGroup.size() > 0)
- mListGroup.clear();
- mListGroup.add(getString(R.string.contact_list_all_contact));
- mListGroup.addAll(tmpGroupList);
- mListGroup.add(getString(R.string.contact_list_no_group));
- mContactOnGroup.clear();
- if (tmpGroupList.size() > 0) {
- List<Contact> tmpNoGroup = new ArrayList<Contact>();
- for (String s : tmpGroupList) {
- List<Contact> tmpList = new ArrayList<Contact>();
- for (Contact c : tmpContactList) {
- if (c.getGroups().size() == 0 && !tmpNoGroup.contains(c))
- tmpNoGroup.add(c);
- else if (c.getGroups().contains(s))
- tmpList.add(c);
- }
- mContactOnGroup.put(s, tmpList);
- }
- mContactOnGroup.put(getString(R.string.contact_list_no_group), tmpNoGroup);
- } else {
- mContactOnGroup.put(getString(R.string.contact_list_no_group), tmpContactList);
- }
- mContactOnGroup.put(getString(R.string.contact_list_all_contact), tmpContactList);
- mCurGroup = getString(R.string.contact_list_all_contact);
- if (!mSettings.getBoolean("settings_key_hide_groups", false))
- buildBanner();
- else
- hideGroups();
- buildContactList();
- }
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- }
-
- @Override
- public void onServiceDisconnected(ComponentName name) {
- try {
- mRoster.removeRosterListener(mBeemRosterListener);
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- mXmppFacade = null;
- mRoster = null;
- mJingle = null;
- mListContact.clear();
- mListGroup.clear();
- mContactOnGroup.clear();
- }
- }
-
- @Override
- protected void finalize() {
- Log.e(TAG, "FINALIZE");
- }
-
- private void hideGroups() {
- ViewStub stub = (ViewStub) findViewById(R.id.contactlist_stub);
- if (stub == null)
- ((LinearLayout) findViewById(R.id.contactlist_groupstub)).setVisibility(View.GONE);
- }
}
--- a/src/com/beem/project/beem/ui/CreateAccount.java Sun Feb 14 17:25:38 2010 +0100
+++ b/src/com/beem/project/beem/ui/CreateAccount.java Sat Dec 25 17:01:00 2010 +0100
@@ -64,6 +64,7 @@
import android.widget.TextView;
import android.widget.Toast;
+import com.beem.project.beem.BeemApplication;
import com.beem.project.beem.R;
/**
@@ -171,7 +172,7 @@
* @return Registered proxy password
*/
private String getRegisteredProxyPassword() {
- return mSettings.getString("settings_key_proxy_password", DEFAULT_STRING_VALUE);
+ return mSettings.getString(BeemApplication.PROXY_PASSWORD_KEY, DEFAULT_STRING_VALUE);
}
/**
@@ -179,7 +180,7 @@
* @return Registered proxy port
*/
private int getRegisteredProxyPort() {
- return Integer.parseInt(mSettings.getString("settings_key_proxy_port", DEFAULT_STRING_VALUE));
+ return Integer.parseInt(mSettings.getString(BeemApplication.PROXY_PORT_KEY, DEFAULT_STRING_VALUE));
}
/**
@@ -187,7 +188,7 @@
* @return Registered proxy server
*/
private String getRegisteredProxyServer() {
- return mSettings.getString("settings_key_proxy_server", DEFAULT_STRING_VALUE);
+ return mSettings.getString(BeemApplication.PROXY_SERVER_KEY, DEFAULT_STRING_VALUE);
}
/**
@@ -196,8 +197,8 @@
*/
private ProxyInfo.ProxyType getRegisteredProxyType() {
ProxyInfo.ProxyType result = ProxyInfo.ProxyType.NONE;
- if (mSettings.getBoolean("settings_key_proxy_use", false)) {
- String type = mSettings.getString("settings_key_proxy_type", "none");
+ if (mSettings.getBoolean(BeemApplication.PROXY_USE_KEY, false)) {
+ String type = mSettings.getString(BeemApplication.PROXY_TYPE_KEY, "none");
if ("HTTP".equals(type))
result = ProxyInfo.ProxyType.HTTP;
else if ("SOCKS4".equals(type))
@@ -215,7 +216,7 @@
* @return Registered proxy use
*/
private boolean getRegisteredProxyUse() {
- return mSettings.getBoolean("settings_key_proxy_use", DEFAULT_BOOLEAN_VALUE);
+ return mSettings.getBoolean(BeemApplication.PROXY_USE_KEY, DEFAULT_BOOLEAN_VALUE);
}
/**
@@ -223,7 +224,7 @@
* @return Registered proxy username
*/
private String getRegisteredProxyUsername() {
- return mSettings.getString("settings_key_proxy_username", DEFAULT_STRING_VALUE);
+ return mSettings.getString(BeemApplication.PROXY_USERNAME_KEY, DEFAULT_STRING_VALUE);
}
/**
@@ -318,10 +319,9 @@
else {
if (createAccount(username, passwordFieldValue)) {
SharedPreferences.Editor settingsEditor = mSettings.edit();
- settingsEditor.putString("settings_key_account_username", usernameFieldValue);
- settingsEditor.putString("settings_key_account_password", passwordFieldValue);
+ settingsEditor.putString(BeemApplication.ACCOUNT_USERNAME_KEY, usernameFieldValue);
+ settingsEditor.putString(BeemApplication.ACCOUNT_PASSWORD_KEY, passwordFieldValue);
settingsEditor.putBoolean("settings_key_gmail", false);
- settingsEditor.putBoolean("PreferenceIsConfigured", true);
settingsEditor.commit();
finish();
}
--- a/src/com/beem/project/beem/ui/Login.java Sun Feb 14 17:25:38 2010 +0100
+++ b/src/com/beem/project/beem/ui/Login.java Sat Dec 25 17:01:00 2010 +0100
@@ -45,33 +45,33 @@
import android.app.Activity;
import android.app.AlertDialog;
+import android.app.Application;
import android.content.DialogInterface;
import android.content.Intent;
+import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
-import android.content.pm.PackageInfo;
-import android.content.SharedPreferences;
import android.os.Bundle;
-import android.preference.PreferenceManager;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.TextView;
import android.widget.Toast;
+import com.beem.project.beem.BeemApplication;
import com.beem.project.beem.R;
+import com.beem.project.beem.ui.wizard.Account;
import com.beem.project.beem.utils.BeemConnectivity;
/**
* This class is the main Activity for the Beem project.
- * @author Da Risk <darisk972@gmai.com>
+ * @author Da Risk <darisk@beem-project.com>
*/
public class Login extends Activity {
private static final int LOGIN_REQUEST_CODE = 1;
- private SharedPreferences mSettings;
private TextView mTextView;
- private boolean mIsConfigured;
private boolean mIsResult;
+ private BeemApplication mBeemApplication;
/**
* Constructor.
@@ -82,17 +82,26 @@
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ Application app = getApplication();
+ if (app instanceof BeemApplication) {
+ mBeemApplication = (BeemApplication) app;
+ if (mBeemApplication.isConnected()) {
+ startActivity(new Intent(this, ContactList.class));
+ finish();
+ } else if (!mBeemApplication.isAccountConfigured()) {
+ startActivity(new Intent(this, Account.class));
+ finish();
+ }
+ }
setContentView(R.layout.login);
mTextView = (TextView) findViewById(R.id.log_as_msg);
- mSettings = PreferenceManager.getDefaultSharedPreferences(this);
}
@Override
protected void onStart() {
super.onStart();
- mIsConfigured = mSettings.getBoolean("PreferenceIsConfigured", false);
- // TODO utiliser une options des preference plutot.
- if (mIsConfigured && !mIsResult && BeemConnectivity.isConnected(getApplicationContext())) {
+ if (mBeemApplication.isAccountConfigured() && !mIsResult
+ && BeemConnectivity.isConnected(getApplicationContext())) {
mTextView.setText("");
Intent i = new Intent(this, LoginAnim.class);
startActivityForResult(i, LOGIN_REQUEST_CODE);
@@ -141,7 +150,7 @@
result = true;
break;
case R.id.login_menu_login:
- if (testConnectivity()) {
+ if (mBeemApplication.isAccountConfigured()) {
Intent i = new Intent(this, LoginAnim.class);
startActivityForResult(i, LOGIN_REQUEST_CODE);
}
@@ -155,18 +164,6 @@
}
/**
- * Test the connectivity of the phone.
- * @return true if we are connected to a network.
- */
- private boolean testConnectivity() {
- if (!BeemConnectivity.isConnected(getApplicationContext())) {
- Toast.makeText(Login.this, R.string.login_no_connectivity, Toast.LENGTH_SHORT).show();
- return false;
- }
- return true;
- }
-
- /**
* Create an about "BEEM" dialog.
*/
private void createAboutDialog() {
--- a/src/com/beem/project/beem/ui/Settings.java Sun Feb 14 17:25:38 2010 +0100
+++ b/src/com/beem/project/beem/ui/Settings.java Sat Dec 25 17:01:00 2010 +0100
@@ -43,12 +43,8 @@
*/
package com.beem.project.beem.ui;
-import android.content.BroadcastReceiver;
import android.content.ComponentName;
-import android.content.Context;
import android.content.Intent;
-import android.content.IntentFilter;
-import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.view.Menu;
@@ -56,7 +52,6 @@
import android.view.MenuItem;
import com.beem.project.beem.R;
-import com.beem.project.beem.utils.BeemBroadcastReceiver;
/**
* This class represents an activity which allows the user to change his account or proxy parameters.
@@ -64,7 +59,6 @@
public class Settings extends PreferenceActivity {
private static final Intent SERVICE_INTENT = new Intent();
- private SettingsBroadcastReceiver mReceiver;
static {
SERVICE_INTENT.setComponent(new ComponentName("com.beem.project.beem", "com.beem.project.beem.BeemService"));
@@ -76,45 +70,10 @@
public Settings() {
}
- /* (non-Javadoc)
- * @see android.preference.PreferenceActivity#onCreate(android.os.Bundle)
- */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.layout.preferences);
- mReceiver = new SettingsBroadcastReceiver();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void onPause() {
- super.onPause();
- this.unregisterReceiver(mReceiver);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void onResume() {
- super.onResume();
- this.registerReceiver(mReceiver, new IntentFilter(BeemBroadcastReceiver.BEEM_CONNECTION_CLOSED));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void onStop() {
- super.onStop();
- SharedPreferences settings = getPreferenceManager().getSharedPreferences();
- settings.edit().putBoolean(
- "PreferenceIsConfigured",
- !"".equals(settings.getString("settings_key_account_username", ""))
- || !"".equals(settings.getString("settings_key_account_password", ""))).commit();
}
/**
@@ -146,20 +105,4 @@
return false;
}
}
-
- /**
- * disconnect Broadcast receiver.
- */
- private class SettingsBroadcastReceiver extends BroadcastReceiver {
- /**
- * Constructor.
- */
- public SettingsBroadcastReceiver() {
- }
-
- @Override
- public void onReceive(Context context, Intent intent) {
- Settings.this.setResult(RESULT_CANCELED);
- }
- }
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/ui/dialogs/builders/ChatList.java Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,90 @@
+/*
+ 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.ui.dialogs.builders;
+
+import java.util.List;
+
+import android.app.AlertDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+
+import com.beem.project.beem.R;
+import com.beem.project.beem.service.Contact;
+
+/**
+ * Create the change chat dialog.
+ */
+public class ChatList extends AlertDialog.Builder {
+
+ //private static final String TAG = "Dialogs.Builders > Chat list";
+
+ /**
+ * Constructor.
+ * @param context context activity.
+ * @param openedChats A list containing the JID of participants of the opened chats.
+ */
+ public ChatList(final Context context, final List<Contact> openedChats) {
+ super(context);
+
+ if (openedChats.size() > 0) {
+ CharSequence[] items = new CharSequence[openedChats.size()];
+
+ int i = 0;
+ for (Contact c : openedChats) {
+ items[i++] = c.getName();
+ }
+ setTitle(R.string.chat_dialog_change_chat_title);
+ setItems(items, new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int item) {
+ Intent chatIntent = new Intent(context, com.beem.project.beem.ui.Chat.class);
+ chatIntent.setData((openedChats.get(item)).toUri());
+ context.startActivity(chatIntent);
+ }
+ });
+ } else {
+ setMessage(R.string.chat_no_more_chats);
+ }
+ }
+}
--- a/src/com/beem/project/beem/ui/dialogs/builders/CreatePrivacyList.java Sun Feb 14 17:25:38 2010 +0100
+++ b/src/com/beem/project/beem/ui/dialogs/builders/CreatePrivacyList.java Sat Dec 25 17:01:00 2010 +0100
@@ -73,24 +73,21 @@
/**
* Constructor.
* @param context context activity.
+ * @param privacyListManager the privacy list manager that will be use to create our list.
*/
- public CreatePrivacyList(final Context context,
- final IPrivacyListManager privacyListManager) {
+ public CreatePrivacyList(final Context context, final IPrivacyListManager privacyListManager) {
super(context);
LayoutInflater factory = LayoutInflater.from(context);
- mTextEntryView = factory.inflate(
- R.layout.privacy_list_create_dialog, null);
+ mTextEntryView = factory.inflate(R.layout.privacy_list_create_dialog, null);
setView(mTextEntryView);
mPrivacyListManager = privacyListManager;
- mListNameField = (EditText) mTextEntryView.findViewById(
- R.id.privacy_list_create_dialog_list_name);
+ mListNameField = (EditText) mTextEntryView.findViewById(R.id.privacy_list_create_dialog_list_name);
setTitle(R.string.privacy_list_create_dialog_title);
- setPositiveButton(R.string.privacy_list_create_dialog_create_button,
- new DialogClickListener());
+ setPositiveButton(R.string.privacy_list_create_dialog_create_button, new DialogClickListener());
setNegativeButton(R.string.CancelButton, new DialogClickListener());
}
@@ -120,4 +117,4 @@
}
}
}
-}
\ No newline at end of file
+}
--- a/src/com/beem/project/beem/ui/dialogs/builders/DeleteContact.java Sun Feb 14 17:25:38 2010 +0100
+++ b/src/com/beem/project/beem/ui/dialogs/builders/DeleteContact.java Sat Dec 25 17:01:00 2010 +0100
@@ -53,9 +53,13 @@
import com.beem.project.beem.service.Contact;
import com.beem.project.beem.service.aidl.IRoster;
+/**
+ * Use this builder to build a dialog which allows you to delete a contact from a specific roster.
+ * @author Jean-Manuel Da Silva <dasilvj at beem-project dot com>
+ */
public class DeleteContact extends AlertDialog.Builder {
- private final static String TAG = "Dialogs.Builders > DeleteContact";
+ private static final String TAG = "Dialogs.Builders > DeleteContact";
private IRoster mRoster;
private Contact mContact;
@@ -63,9 +67,10 @@
/**
* Constructor.
* @param context context activity.
+ * @param roster the roster which has the contact you want to delete.
+ * @param contact the contact to delete.
*/
- public DeleteContact(final Context context, final IRoster roster,
- final Contact contact) {
+ public DeleteContact(final Context context, final IRoster roster, final Contact contact) {
super(context);
mContact = contact;
--- a/src/com/beem/project/beem/ui/dialogs/builders/DeletePrivacyList.java Sun Feb 14 17:25:38 2010 +0100
+++ b/src/com/beem/project/beem/ui/dialogs/builders/DeletePrivacyList.java Sat Dec 25 17:01:00 2010 +0100
@@ -52,6 +52,10 @@
import com.beem.project.beem.R;
import com.beem.project.beem.service.aidl.IPrivacyListManager;
+/**
+ * Use this builder to build a dialog which allows you to delete a privacy list.
+ * @author Jean-Manuel Da Silva <dasilvj at beem-project dot com>
+ */
public class DeletePrivacyList extends AlertDialog.Builder {
private static final String TAG = "Dialogs.Builders > DeletePrivacyList";
@@ -62,16 +66,17 @@
/**
* Constructor.
* @param context context activity.
+ * @param privacyListManager the privacy list manager managing the privacy list you want to delete.
+ * @param privacyListName the name of the privacy list you want to delete.
*/
- public DeletePrivacyList(final Context context,
- final IPrivacyListManager privacyListManager, final String privacyListName) {
+ public DeletePrivacyList(final Context context, final IPrivacyListManager privacyListManager,
+ final String privacyListName) {
super(context);
mPrivacyListManager = privacyListManager;
mPrivacyListName = privacyListName;
- setMessage(context.getString(
- R.string.privacy_list_delete_dialog_msg, privacyListName));
+ setMessage(context.getString(R.string.privacy_list_delete_dialog_msg, privacyListName));
DialogClickListener dl = new DialogClickListener();
setPositiveButton(R.string.privacy_list_delete_dialog_yes, dl);
setNegativeButton(R.string.privacy_list_delete_dialog_no, dl);
--- a/src/com/beem/project/beem/ui/dialogs/builders/ResendSubscription.java Sun Feb 14 17:25:38 2010 +0100
+++ b/src/com/beem/project/beem/ui/dialogs/builders/ResendSubscription.java Sat Dec 25 17:01:00 2010 +0100
@@ -57,9 +57,13 @@
import com.beem.project.beem.service.PresenceAdapter;
import com.beem.project.beem.service.aidl.IXmppFacade;
+/**
+ * Use this builder to build a dialog which allows you resend a subscription query to a contact.
+ * @author Jean-Manuel Da Silva <dasilvj at beem-project dot com>
+ */
public class ResendSubscription extends AlertDialog.Builder {
- private final static String TAG = "Dialogs.Builders > ResendSubscription";
+ private static final String TAG = "Dialogs.Builders > ResendSubscription";
private Context mContext;
private IXmppFacade mXmppFacade;
@@ -67,10 +71,11 @@
/**
* Constructor.
- * @param context context activity
+ * @param context context activity.
+ * @param xmppFacade the XMPP Facade used to send the query.
+ * @param contact the receiver of the query.
*/
- public ResendSubscription(final Context context,
- final IXmppFacade xmppFacade, final Contact contact) {
+ public ResendSubscription(final Context context, final IXmppFacade xmppFacade, final Contact contact) {
super(context);
mContext = context;
@@ -100,10 +105,8 @@
Presence presencePacket = new Presence(Presence.Type.subscribe);
presencePacket.setTo(mContact.getJID());
try {
- mXmppFacade.sendPresencePacket(
- new PresenceAdapter(presencePacket));
- Toast.makeText(mContext, mContext.getString(
- R.string.userinfo_resend), Toast.LENGTH_SHORT).show();
+ mXmppFacade.sendPresencePacket(new PresenceAdapter(presencePacket));
+ Toast.makeText(mContext, mContext.getString(R.string.userinfo_resend), Toast.LENGTH_SHORT).show();
} catch (RemoteException e) {
Log.e(TAG, e.getMessage());
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/ui/wizard/Account.java Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,107 @@
+/*
+ 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.ui.wizard;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+import android.widget.RadioGroup;
+
+import com.beem.project.beem.ui.CreateAccount;
+import com.beem.project.beem.R;
+
+/**
+ * The first activity of an user friendly wizard to configure a XMPP account.
+ *
+ * @author Da Risk <darisk972@gmail.com>
+ */
+public class Account extends Activity implements OnClickListener, RadioGroup.OnCheckedChangeListener {
+
+ private RadioGroup mConfigureGroup;
+ private Button mNextButton;
+
+ /**
+ * Constructor.
+ */
+ public Account() {
+ }
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.wizard_account);
+ mConfigureGroup = (RadioGroup) findViewById(R.id.configure_group);
+ mConfigureGroup.setOnCheckedChangeListener(this);
+ mNextButton = (Button) findViewById(R.id.next);
+ mNextButton.setOnClickListener(this);
+ }
+
+ @Override
+ public void onClick(View v) {
+ if (v == mNextButton) {
+ int selectedid = mConfigureGroup.getCheckedRadioButtonId();
+ Intent i = null;
+ if (selectedid == R.id.configure_account) {
+ i = new Intent(this, AccountConfigure.class);
+ finish();
+ } else if (selectedid == R.id.create_account) {
+ i = new Intent(this, CreateAccount.class);
+ }
+ if (i != null) {
+ startActivity(i);
+ }
+ }
+ }
+
+ @Override
+ public void onCheckedChanged(RadioGroup group, int checkedId) {
+ if (checkedId == -1)
+ mNextButton.setEnabled(false);
+ else
+ mNextButton.setEnabled(true);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/ui/wizard/AccountConfigure.java Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,231 @@
+/*
+ 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.ui.wizard;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.os.Bundle;
+import android.preference.PreferenceManager;
+import android.text.Editable;
+import android.text.InputFilter;
+import android.text.LoginFilter;
+import android.text.TextUtils;
+import android.text.TextWatcher;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+import android.widget.EditText;
+
+import org.jivesoftware.smack.util.StringUtils;
+
+import com.beem.project.beem.ui.Login;
+import com.beem.project.beem.ui.Settings;
+import com.beem.project.beem.BeemApplication;
+import com.beem.project.beem.R;
+
+/**
+ * Activity to enter the information required in order to configure a XMPP account.
+ *
+ * @author Da Risk <darisk972@gmail.com>
+ */
+public class AccountConfigure extends Activity implements OnClickListener {
+
+ private static final int MANUAL_CONFIGURATION = 1;
+ private Button mNextButton;
+ private Button mManualConfigButton;
+ private EditText mAccountJID;
+ private EditText mAccountPassword;
+ private final JidTextWatcher mJidTextWatcher = new JidTextWatcher();
+ private final PasswordTextWatcher mPasswordTextWatcher = new PasswordTextWatcher();
+ private boolean mValidJid;
+ private boolean mValidPassword;
+
+ /**
+ * Constructor.
+ */
+ public AccountConfigure() {
+ }
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.wizard_account_configure);
+ mManualConfigButton = (Button) findViewById(R.id.manual_setup);
+ mManualConfigButton.setOnClickListener(this);
+ mNextButton = (Button) findViewById(R.id.next);
+ mNextButton.setOnClickListener(this);
+ mAccountJID = (EditText) findViewById(R.id.account_username);
+ mAccountPassword = (EditText) findViewById(R.id.account_password);
+
+
+ InputFilter[] orgFilters = mAccountJID.getFilters();
+ InputFilter[] newFilters = new InputFilter[orgFilters.length + 1];
+ int i;
+ for (i = 0; i < orgFilters.length; i++)
+ newFilters[i] = orgFilters[i];
+ newFilters[i] = new LoginFilter.UsernameFilterGeneric();
+ mAccountJID.setFilters(newFilters);
+ mAccountJID.addTextChangedListener(mJidTextWatcher);
+ mAccountPassword.addTextChangedListener(mPasswordTextWatcher);
+ }
+
+ @Override
+ public void onClick(View v) {
+ Intent i = null;
+ if (v == mNextButton) {
+ configureAccount();
+ i = new Intent(this, Login.class);
+ i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ startActivity(i);
+ finish();
+ } else if (v == mManualConfigButton) {
+ i = new Intent(this, Settings.class);
+ i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ startActivityForResult(i, MANUAL_CONFIGURATION);
+ }
+ }
+
+ @Override
+ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+ if (requestCode == MANUAL_CONFIGURATION) {
+ SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);
+ String login = settings.getString(BeemApplication.ACCOUNT_USERNAME_KEY, "");
+ String password = settings.getString(BeemApplication.ACCOUNT_PASSWORD_KEY, "");
+ mAccountJID.setText(login);
+ mAccountPassword.setText(password);
+ checkUsername(login);
+ checkPassword(password);
+ mNextButton.setEnabled(mValidJid && mValidPassword);
+ }
+ }
+
+ /**
+ * Store the account in the settings.
+ */
+ private void configureAccount() {
+ SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);
+ SharedPreferences.Editor edit = settings.edit();
+ edit.putString(BeemApplication.ACCOUNT_USERNAME_KEY, mAccountJID.getText().toString());
+ edit.putString(BeemApplication.ACCOUNT_PASSWORD_KEY, mAccountPassword.getText().toString());
+ edit.commit();
+ }
+
+ /**
+ * Check that the username is really a JID.
+ * @param username the username to check.
+ */
+ private void checkUsername(String username) {
+ String name = StringUtils.parseName(username);
+ String server = StringUtils.parseServer(username);
+ if (TextUtils.isEmpty(name) || TextUtils.isEmpty(server)) {
+ mValidJid = false;
+ } else {
+ mValidJid = true;
+ }
+ }
+
+ /**
+ * Check password.
+ * @param password the password to check.
+ */
+ private void checkPassword(String password) {
+ if (password.length() > 0)
+ mValidPassword = true;
+ else
+ mValidPassword = false;
+ }
+
+ /**
+ * Text watcher to test the existence of a password.
+ */
+ private class PasswordTextWatcher implements TextWatcher {
+
+ /**
+ * Constructor.
+ */
+ public PasswordTextWatcher() {
+ }
+
+ @Override
+ public void afterTextChanged(Editable s) {
+ checkPassword(s.toString());
+ mNextButton.setEnabled(mValidJid && mValidPassword);
+ }
+
+ @Override
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+ }
+
+ @Override
+ public void onTextChanged(CharSequence s, int start, int before, int count) {
+ }
+ }
+
+ /**
+ * TextWatcher to check the validity of a JID.
+ */
+ private class JidTextWatcher implements TextWatcher {
+
+ /**
+ * Constructor.
+ */
+ public JidTextWatcher() {
+ }
+
+ @Override
+ public void afterTextChanged(Editable s) {
+ checkUsername(s.toString());
+ mNextButton.setEnabled(mValidJid && mValidPassword);
+ }
+
+ @Override
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+ }
+
+ @Override
+ public void onTextChanged(CharSequence s, int start, int before, int count) {
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/ui/wizard/package-info.java Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,49 @@
+/*
+ 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.
+
+*/
+
+/**
+ * This package contains some configuration wizards.
+ */
+package com.beem.project.beem.ui.wizard;
+
--- a/src/com/beem/project/beem/utils/BeemBroadcastReceiver.java Sun Feb 14 17:25:38 2010 +0100
+++ b/src/com/beem/project/beem/utils/BeemBroadcastReceiver.java Sat Dec 25 17:01:00 2010 +0100
@@ -51,6 +51,7 @@
import android.widget.Toast;
import com.beem.project.beem.BeemService;
+import com.beem.project.beem.R;
/**
* Manage broadcast disconnect intent.
@@ -83,6 +84,8 @@
}
} else if (intentAction.equals(ConnectivityManager.CONNECTIVITY_ACTION)) {
if (intent.getBooleanExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY, false)) {
+ Toast.makeText(context, context.getString(R.string.BeemBroadcastReceiverDisconnect),
+ Toast.LENGTH_SHORT).show();
context.stopService(new Intent(context, BeemService.class));
}
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/utils/SortedList.java Sat Dec 25 17:01:00 2010 +0100
@@ -0,0 +1,312 @@
+/*
+ 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/
+
+*/
+package com.beem.project.beem.utils;
+
+import java.util.List;
+import java.util.Comparator;
+import java.util.ListIterator;
+import java.util.Iterator;
+import java.util.Collection;
+import java.util.Collections;
+
+/**
+ * This class add a sort by insertion to a List.
+ * All methods which allow you to insert an object at a specific index
+ * will throw an UnsupportedOperationException.
+ *
+ * @author Da Risk <da_risk@beem-project.com>
+ * @param <E> the type of elements maintained by this list
+ */
+public class SortedList<E> implements List<E> {
+
+ private final List<E> mBackend;
+ private final Comparator<? super E> mComparator;
+
+ /**
+ * Create a SortedList. The existing elements will be sorted.
+ *
+ * @param list list to sort
+ * @param mComparator mComparator to use.
+ */
+ public SortedList(final List<E> list, final Comparator<? super E> mComparator) {
+ this.mComparator = mComparator;
+ this.mBackend = list;
+ Collections.sort(mBackend, mComparator);
+ }
+
+ @Override
+ public int size() {
+ return mBackend.size();
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return mBackend.isEmpty();
+ }
+
+ @Override
+ public boolean contains(Object o) {
+ return mBackend.contains(o);
+ }
+
+ @Override
+ public Iterator<E> iterator() {
+ return new SortedListIterator<E>(mBackend.listIterator());
+ }
+
+ @Override
+ public Object[] toArray() {
+ return mBackend.toArray();
+ }
+
+ @Override
+ public <T> T[] toArray(T[] a) {
+ return mBackend.toArray(a);
+ }
+
+ @Override
+ public boolean add(E e) {
+ for (ListIterator<E> it = mBackend.listIterator(); it.hasNext();) {
+ if (mComparator.compare(e, it.next()) < 0) {
+ if (it.hasPrevious()) {
+ it.previous();
+ }
+ it.add(e);
+ return true;
+ }
+ }
+ mBackend.add(e);
+ return true;
+ }
+
+ @Override
+ public boolean remove(Object o) {
+ return mBackend.remove(o);
+ }
+
+ @Override
+ public boolean containsAll(Collection<?> c) {
+ return mBackend.containsAll(c);
+ }
+
+ @Override
+ public boolean addAll(Collection<? extends E> c) {
+ boolean result = false;
+ for (E e : c) {
+ boolean t = add(e);
+ if (t) {
+ result = t;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Add all the elements in the specified collection.
+ * The index param is ignored.
+ *
+ * @param index ignored
+ * @param c collection containing elements to be added to this list
+ * @return true if this list changed as a result of the call
+ */
+ @Override
+ public boolean addAll(int index, Collection<? extends E> c) {
+ return addAll(c);
+ }
+
+ /**
+ * Add all the elements in the specified collection.
+ * The index param is ignored.
+ *
+ * @param l collection containing elements to be added to this list
+ * @return true if this list changed as a result of the call
+ * @see addAll(Collection)
+ */
+ public boolean addAll(SortedList<? extends E> l) {
+ if (!l.isEmpty()) {
+ if (mBackend.isEmpty()) {
+ return mBackend.addAll(l);
+ }
+ boolean result = false;
+ E myfirst = mBackend.get(0);
+ E last = l.get(l.size() - 1);
+ E mylast = mBackend.get(mBackend.size() - 1);
+ E first = l.get(0);
+ if (mComparator.compare(last, myfirst) < 0) {
+ result = mBackend.addAll(0, l);
+ } else if (mComparator.compare(first, mylast) > 0) {
+ result = mBackend.addAll(l);
+ } else {
+ Collection<? extends E> c = l;
+ result = addAll(c);
+ }
+ return result;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean removeAll(Collection<?> c) {
+ return mBackend.removeAll(c);
+ }
+
+ @Override
+ public boolean retainAll(Collection<?> c) {
+ return mBackend.retainAll(c);
+ }
+
+ @Override
+ public void clear() {
+ mBackend.clear();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ return mBackend.equals(o);
+ }
+
+ @Override
+ public int hashCode() {
+ return mBackend.hashCode();
+ }
+
+ @Override
+ public E get(int index) {
+ return mBackend.get(index);
+ }
+
+ @Override
+ public E set(int index, E element) {
+ throw new UnsupportedOperationException("set() is not supported in SortedList");
+ }
+
+ @Override
+ public void add(int index, E element) {
+ throw new UnsupportedOperationException("add at specific index is not supported in SortedList");
+ }
+
+ @Override
+ public E remove(int index) {
+ return mBackend.remove(index);
+ }
+
+ @Override
+ public int indexOf(Object o) {
+ return mBackend.indexOf(o);
+ }
+
+ @Override
+ public int lastIndexOf(Object o) {
+ return mBackend.lastIndexOf(o);
+ }
+
+ @Override
+ public ListIterator<E> listIterator() {
+ return new SortedListIterator<E>(mBackend.listIterator());
+ }
+
+ @Override
+ public ListIterator<E> listIterator(int index) {
+ return new SortedListIterator<E>(mBackend.listIterator(index));
+ }
+
+ @Override
+ public List<E> subList(int fromIndex, int toIndex) {
+ return mBackend.subList(fromIndex, toIndex);
+ }
+
+ @Override
+ public String toString() {
+ return mBackend.toString();
+ }
+
+ /**
+ * A SortedList.iterator don't allow list modification.
+ * It use the mBackend iterator for the other operations.
+ */
+ private class SortedListIterator<E> implements ListIterator<E> {
+
+ private ListIterator<E> mIt;
+
+ /**
+ * Construct SortedList.Iterator.
+ *
+ * @param iterator the iterator of the backend list
+ */
+ SortedListIterator(final ListIterator<E> iterator) {
+ mIt = iterator;
+ }
+
+ @Override
+ public void add(E e) {
+ throw new UnsupportedOperationException("add() not supported in SortedList iterator");
+ }
+
+ @Override
+ public boolean hasNext() {
+ return mIt.hasNext();
+ }
+
+ @Override
+ public E next() {
+ return mIt.next();
+ }
+
+ @Override
+ public boolean hasPrevious() {
+ return mIt.hasPrevious();
+ }
+
+ @Override
+ public E previous() {
+ return mIt.previous();
+ }
+
+ @Override
+ public int nextIndex() {
+ return mIt.nextIndex();
+ }
+
+ @Override
+ public int previousIndex() {
+ return mIt.previousIndex();
+ }
+
+ @Override
+ public void remove() {
+ mIt.remove();
+ }
+
+ @Override
+ public void set(E e) {
+ throw new UnsupportedOperationException("set () not supported in SortedList iterator");
+ }
+ }
+}
--- a/src/com/beem/project/beem/utils/Status.java Sun Feb 14 17:25:38 2010 +0100
+++ b/src/com/beem/project/beem/utils/Status.java Sat Dec 25 17:01:00 2010 +0100
@@ -147,10 +147,10 @@
/**
* Check if contact is online by his status.
* @param status contact status
- * @return is obline
+ * @return is online
*/
public static boolean statusOnline(final int status) {
- return status != Status.CONTACT_STATUS_DISCONNECT && status != Status.CONTACT_STATUS_UNAVAILABLE;
+ return status != Status.CONTACT_STATUS_DISCONNECT;
}
}
--- a/tools/checkstyle.xml Sun Feb 14 17:25:38 2010 +0100
+++ b/tools/checkstyle.xml Sat Dec 25 17:01:00 2010 +0100
@@ -36,7 +36,7 @@
names will be relative to the specified directory. See
http://checkstyle.sourceforge.net/5.x/config.html#Checker
-->
- <property name="basedir" value="/home/beem/"/>
+ <property name="basedir" value="/home/beem/" default="."/>
<property name="severity" value="warning"/>
@@ -87,7 +87,7 @@
<!-- Header file -->
<module name="RegexpHeader">
- <property name="headerFile" value="tools/JavaHeaderCheck.regex"/>
+ <property name="headerFile" value="${basedir}/tools/JavaHeaderCheck.regex"/>
<property name="multiLines" value="5, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38"/>
<property name="severity" value="error" />
</module>
@@ -171,18 +171,34 @@
<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="EmptyForIteratorPad"/>
- <module name="GenericWhitespace"/>
- <module name="MethodParamPad"/>
- <module name="NoWhitespaceAfter"/>
- <module name="NoWhitespaceBefore"/>
+ <module name="GenericWhitespace">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="MethodParamPad">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="NoWhitespaceAfter">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="NoWhitespaceBefore">
+ <property name="severity" value="error"/>
+ </module>
<module name="OperatorWrap"/>
- <module name="ParenPad"/>
- <module name="TypecastParenPad"/>
+ <module name="ParenPad">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="TypecastParenPad">
+ <property name="severity" value="error"/>
+ </module>
<!-- We want mixed tabulation
<module name="TabCharacter"/>
-->
- <module name="WhitespaceAfter"/>
- <module name="WhitespaceAround"/>
+ <module name="WhitespaceAfter">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="WhitespaceAround">
+ <property name="severity" value="error"/>
+ </module>
<!-- Modifier Checks -->