--- a/.classpath Fri Jan 15 11:58:04 2010 +0100
+++ b/.classpath Fri Jan 15 12:02:29 2010 +0100
@@ -1,24 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
- <classpathentry kind="lib" path="libs/smackx-debug.jar"/>
- <classpathentry kind="lib" path="libs/smackx-jingle.jar" sourcepath="/home/nikita/devel/smack">
+ <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+ <classpathentry exported="true" kind="lib" path="libs/smackx-debug.jar"/>
+ <classpathentry exported="true" kind="lib" path="libs/smackx-jingle.jar" sourcepath="/home/nikita/devel/smack">
<attributes>
<attribute name="javadoc_location" value="file:/home/nikita/devel/smack_src_3_1_0/javadoc/"/>
</attributes>
</classpathentry>
- <classpathentry kind="lib" path="libs/security.jar"/>
- <classpathentry kind="lib" path="libs/smack.jar" sourcepath="/home/nikita/devel/smack/source">
+ <classpathentry exported="true" kind="lib" path="libs/smack.jar" sourcepath="/home/marseille/smack_src_3_1_0/source">
<attributes>
<attribute name="javadoc_location" value="file:/home/nikita/devel/smack_src_3_1_0/javadoc/org/"/>
</attributes>
</classpathentry>
- <classpathentry kind="lib" path="libs/smackx.jar" sourcepath="/home/nikita/devel/smack">
+ <classpathentry exported="true" kind="lib" path="libs/smackx.jar" sourcepath="/home/nikita/devel/smack">
<attributes>
<attribute name="javadoc_location" value="file:/home/nikita/devel/smack_src_3_1_0/javadoc/"/>
</attributes>
</classpathentry>
- <classpathentry excluding="com/beem/project/beem/ui/pref.java" kind="src" path="src"/>
+ <classpathentry exported="true" kind="lib" path="libs/jlibrtp.jar">
+ <classpathentry exported="true" kind="lib" path="libs/security.jar"/>
+ <classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="output" path="bin"/>
</classpath>
--- a/.hgignore Fri Jan 15 11:58:04 2010 +0100
+++ b/.hgignore Fri Jan 15 12:02:29 2010 +0100
@@ -5,3 +5,6 @@
src/com/beem/project/beem/service/aidl/*.java
gen/*
local.properties
+**~
+**/.*.sw?
+
--- a/.hgtags Fri Jan 15 11:58:04 2010 +0100
+++ b/.hgtags Fri Jan 15 12:02:29 2010 +0100
@@ -1,1 +1,2 @@
16373c4cd73330fa568960a11a6ee7aea6886a4d sfr-release
+bccd99644eac57bb19a239697704db089dd585f7 0.1
--- a/AndroidManifest.xml Fri Jan 15 11:58:04 2010 +0100
+++ b/AndroidManifest.xml Fri Jan 15 12:02:29 2010 +0100
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.beem.project.beem" android:versionCode="1"
- android:versionName="1.0">
+ android:versionName="0.1">
<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">
@@ -11,11 +11,9 @@
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
- <intent-filter android:label="Beem Connection">
- <action
- android:name="com.beem.project.beem.service.XmppConnectionAdapter.CONNECTION_CLOSED" />
- </intent-filter>
</activity>
+ <activity android:name=".ui.LoginAnim" android:label="@string/login_login_progress"
+ android:launchMode="singleTop" />
<activity android:name=".ui.Settings" android:label="@string/edit_settings_name">
<intent-filter android:label="Beem Connection">
<action
@@ -55,12 +53,6 @@
android:name="com.beem.project.beem.service.XmppConnectionAdapter.CONNECTION_CLOSED" />
</intent-filter>
</activity>
- <activity android:name=".ui.UserInfo" android:label="@string/user_info_name">
- <intent-filter android:label="Beem Connection">
- <action
- android:name="com.beem.project.beem.service.XmppConnectionAdapter.CONNECTION_CLOSED" />
- </intent-filter>
- </activity>
<activity android:name=".ui.GroupList" android:label="GroupList">
<intent-filter android:label="Beem Connection">
<action
@@ -73,6 +65,12 @@
android:name="com.beem.project.beem.service.XmppConnectionAdapter.CONNECTION_CLOSED" />
</intent-filter>
</activity>
+ <!-- Could be interesting if we would launch beem at startup
+ <receiver android:name=".tool.BeemBroadcastReceiver" android:enabled="true">
+ <intent-filter>
+ <action android:name="android.intent.action.BOOT_COMPLETED" />
+ </intent-filter>
+ </receiver> -->
<service android:name="BeemService" android:enabled="true"
android:label="Beem Service" android:permission="com.beem.project.beem.BEEM_SERVICE">
<intent-filter>
@@ -90,7 +88,7 @@
<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.PROCESS_OUTGOING_CALLS"></uses-permission>
- <uses-sdk android:minSdkVersion="3"></uses-sdk>
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
+ <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="6" />
</manifest>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/COPYING Fri Jan 15 12:02:29 2010 +0100
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/CREDITS Fri Jan 15 12:02:29 2010 +0100
@@ -0,0 +1,9 @@
+This file contains the name of the people who have contributed to
+BEEM. The names are sorted alphabetically by last name.
+
+Frederic-Charles Barthelery
+Jean-Manuel Da Silva
+Nikita Kozlov
+Philippe Lago
+Jean Baptiste Vergely
+Vincent Véronis
--- a/build.xml Fri Jan 15 11:58:04 2010 +0100
+++ b/build.xml Fri Jan 15 12:02:29 2010 +0100
@@ -1,23 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project name="Beem" default="help">
+<project name="Beem">
<!-- The local.properties file is created and updated by the 'android' tool.
It contain the path to the SDK. It should *NOT* be checked in in Version
Control Systems. -->
- <property file="local.properties"/>
+ <property file="local.properties" />
<!-- The build.properties file can be created by you and is never touched
by the 'android' tool. This is the place to change some of the default property values
used by the Ant rules.
Here are some properties you may want to change/update:
- application-package
+ application.package
the name of your application package as defined in the manifest. Used by the
'uninstall' rule.
- source-folder
- the name of the source folder. Default is 'src'.
- out-folder
- the name of the output folder. Default is 'bin'.
+ source.dir
+ the name of the source directory. Default is 'src'.
+ out.dir
+ the name of the output directory. Default is 'bin'.
Properties related to the SDK location or the project target should be updated
using the 'android' tool with the 'update' action.
@@ -26,41 +26,44 @@
should be checked in in Version Control Systems.
-->
- <property file="build.properties"/>
+ <property file="build.properties" />
<!-- The default.properties file is created and updated by the 'android' tool, as well
- as ADT.
+ as ADT.
This file is an integral part of the build system for your application and
should be checked in in Version Control Systems. -->
- <property file="default.properties"/>
+ <property file="default.properties" />
<!-- Custom Android task to deal with the project target, and import the proper rules.
This requires ant 1.6.0 or above. -->
<path id="android.antlibs">
- <pathelement path="${sdk-location}/tools/lib/anttasks.jar" />
- <pathelement path="${sdk-location}/tools/lib/sdklib.jar" />
- <pathelement path="${sdk-location}/tools/lib/androidprefs.jar" />
- <pathelement path="${sdk-location}/tools/lib/apkbuilder.jar" />
- <pathelement path="${sdk-location}/tools/lib/jarutils.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/apkbuilder.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/jarutils.jar" />
</path>
<taskdef name="setup"
classname="com.android.ant.SetupTask"
- classpathref="android.antlibs"/>
+ classpathref="android.antlibs" />
<!-- Execute the Android Setup task that will setup some properties specific to the target,
- and import the rules files.
- To customize the rules, copy/paste them below the task, and disable import by setting
- the import attribute to false:
- <setup import="false" />
-
+ and import the build rules files.
+
+ The rules file is imported from
+ <SDK>/platforms/<target_platform>/templates/android_rules.xml
+
+ To customize some build steps for your project:
+ - copy the content of the main node <project> from android_rules.xml
+ - paste it in this build.xml below the <setup /> task.
+ - disable the import by changing the setup task below to <setup import="false" />
+
This will ensure that the properties are setup correctly but that your customized
- targets are used.
+ build steps are used.
-->
<setup />
- <property name="out.dir" value="bin" />
- <property name="source.dir" value="src" />
<property name="javadoc.output" value="doc/javadoc" />
<property name="external.libs.dir" value="libs" />
<property name="encoding" value="UTF-8" />
--- a/checkstyle.xml Fri Jan 15 11:58:04 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,317 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE module PUBLIC
- "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
- "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
-
-<!--
-
- Checkstyle configuration that checks the sun coding conventions from:
-
- - the Java Language Specification at
- http://java.sun.com/docs/books/jls/second_edition/html/index.html
-
- - the Sun Code Conventions at http://java.sun.com/docs/codeconv/
-
- - the Javadoc guidelines at
- http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
-
- - the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html
-
- - some best practices
-
- Checkstyle is very configurable. Be sure to read the documentation at
- http://checkstyle.sf.net (or in your downloaded distribution).
-
- Most Checks are configurable, be sure to consult the documentation.
-
- To completely disable a check, just comment it out or delete it from the file.
-
- Finally, it is worth reading the documentation.
-
--->
-
-<module name="Checker">
- <!--
- If you set the basedir property below, then all reported file
- 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="severity" value="warning"/>
-
- <!-- Checks that a package-info.java file exists for each package. -->
- <!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage -->
- <module name="JavadocPackage">
- <property name="allowLegacy" value="true"/>
- </module>
-
- <!-- Checks whether files end with a new line. -->
- <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
- <module name="NewlineAtEndOfFile">
- <property name="severity" value="error"/>
- </module>
-
- <!-- Checks that property files contain the same keys. -->
- <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
- <module name="Translation">
- <property name="severity" value="error"/>
- </module>
-
- <!-- Checks for Size Violations. -->
- <!-- See http://checkstyle.sf.net/config_sizes.html -->
- <module name="FileLength"/>
-
- <!-- Checks for whitespace -->
- <!-- See http://checkstyle.sf.net/config_whitespace.html -->
- <!-- we want tab
- <module name="FileTabCharacter"/>
- -->
-
- <!-- Miscellaneous other checks. -->
- <!-- See http://checkstyle.sf.net/config_misc.html -->
- <module name="RegexpSingleline">
- <property name="severity" value="error"/>
- <property name="format" value="\s+$"/>
- <property name="minimum" value="0"/>
- <property name="maximum" value="0"/>
- <property name="message" value="Line has trailing spaces."/>
- </module>
-
- <module name="StrictDuplicateCode"/>
-
- <module name="TreeWalker">
-
- <!-- Checks for Javadoc comments. -->
- <!-- See http://checkstyle.sf.net/config_javadoc.html -->
- <module name="JavadocMethod">
- <property name="allowUndeclaredRTE" value="true"/>
- <property name="severity" value="error"/>
- </module>
- <module name="JavadocType">
- <property name="severity" value="error"/>
- </module>
- <module name="JavadocVariable">
- <property name="scope" value="package" />
- <property name="severity" value="error"/>
- </module>
- <module name="JavadocStyle">
- <property name="checkEmptyJavadoc" value="true"/>
- <property name="severity" value="error"/>
- </module>
-
-
- <!-- Checks for Naming Conventions. -->
- <!-- See http://checkstyle.sf.net/config_naming.html -->
- <module name="ConstantName"/>
- <module name="LocalFinalVariableName"/>
- <module name="LocalVariableName"/>
- <module name="MemberName">
- <property name="format" value="^m[A-Z][a-zA-Z0-9]*$"/>
- <property name="severity" value="error"/>
- </module>
- <module name="MethodName"/>
- <module name="PackageName"/>
- <module name="ParameterName"/>
- <module name="StaticVariableName"/>
- <module name="TypeName"/>
-
-
- <!-- Checks for Headers -->
- <!-- See http://checkstyle.sf.net/config_header.html -->
- <!-- <module name="Header"> -->
- <!-- The follow property value demonstrates the ability -->
- <!-- to have access to ANT properties. In this case it uses -->
- <!-- the ${basedir} property to allow Checkstyle to be run -->
- <!-- from any directory within a project. See property -->
- <!-- expansion, -->
- <!-- http://checkstyle.sf.net/config.html#properties -->
- <!-- <property -->
- <!-- name="headerFile" -->
- <!-- value="${basedir}/java.header"/> -->
- <!-- </module> -->
-
- <!-- Following interprets the header file as regular expressions. -->
- <!-- <module name="RegexpHeader"/> -->
-
-
- <!-- Checks for imports -->
- <!-- See http://checkstyle.sf.net/config_import.html -->
- <module name="AvoidStarImport"/>
- <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
- <module name="RedundantImport"/>
- <module name="UnusedImports">
- <property name="severity" value="error"/>
- </module>
- <module name="AvoidStaticImport">
- <property name="excludes" value="*"/>
- </module>
-
-
- <!-- Checks for Size Violations. -->
- <!-- See http://checkstyle.sf.net/config_sizes.html -->
- <module name="LineLength">
- <property name="max" value="120" />
- </module>
- <module name="MethodLength"/>
- <module name="ParameterNumber"/>
- <module name="AnonInnerLength">
- <property name="max" value="60" />
- </module>
-
-
- <!-- 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="OperatorWrap"/>
- <module name="ParenPad"/>
- <module name="TypecastParenPad"/>
- <!-- We want mixed tabulation
- <module name="TabCharacter"/>
- -->
- <module name="WhitespaceAfter"/>
- <module name="WhitespaceAround"/>
-
-
- <!-- Modifier Checks -->
- <!-- See http://checkstyle.sf.net/config_modifiers.html -->
- <module name="ModifierOrder">
- <property name="severity" value="error"/>
- </module>
- <module name="RedundantModifier">
- <property name="severity" value="error"/>
- </module>
-
-
- <!-- Checks for blocks. You know, those {}'s -->
- <!-- See http://checkstyle.sf.net/config_blocks.html -->
- <module name="AvoidNestedBlocks"/>
- <module name="EmptyBlock"/>
- <module name="LeftCurly">
- <property name="severity" value="error"/>
- </module>
- <module name="RightCurly">
- <property name="severity" value="error"/>
- </module>
- <!--
- <module name="NeedBraces"/>
- -->
-
- <!-- Check for annotations
- http://checkstyle.sourceforge.net/config_annotation.html#MissingDeprecated
- -->
- <module name="AnnotationUseStyle">
- <property name="severity" value="error"/>
- </module>
- <module name="MissingDeprecated">
- <property name="severity" value="error"/>
- </module>
- <module name="MissingOverride">
- <property name="severity" value="error"/>
- </module>
-
- <!-- Checks for common coding problems -->
- <!-- See http://checkstyle.sf.net/config_coding.html -->
- <module name="CovariantEquals"/>
- <module name="AvoidInlineConditionals"/>
- <module name="InnerAssignment" />
- <module name="DoubleCheckedLocking"/> <!-- MY FAVOURITE -->
- <module name="EmptyStatement"/>
- <module name="EqualsHashCode">
- <property name="severity" value="error"/>
- </module>
- <module name="HiddenField">
- <property name="ignoreConstructorParameter" value="true"/>
- <property name="ignoreAbstractMethods" value="true"/>
- <property name="ignoreSetter" value="true"/>
- </module>
- <module name="IllegalInstantiation"/>
- <module name="InnerAssignment">
- <property name="severity" value="error"/>
- </module>
- <module name="MagicNumber"/>
- <module name="MissingSwitchDefault">
- <property name="severity" value="error"/>
- </module>
- <module name="RedundantThrows"/>
- <module name="SimplifyBooleanExpression">
- <property name="severity" value="error"/>
- </module>
- <module name="SimplifyBooleanReturn">
- <property name="severity" value="error"/>
- </module>
- <module name="StringLiteralEquality">
- <property name="severity" value="error"/>
- </module>
- <module name="IllegalCatch"/>
- <module name="IllegalThrows"/>
- <module name="IllegalType"/>
- <module name="PackageDeclaration"/>
- <module name="JUnitTestCase"/>
- <module name="DeclarationOrder">
- <property name="severity" value="error"/>
- </module>
- <module name="ExplicitInitialization"/>
- <module name="DefaultComesLast"/>
- <module name="MissingCtor"/>
- <module name="FallThrough"/>
- <module name="MultipleStringLiterals">
- <property name="allowedDuplicates" value="2"/>
- </module>
- <module name="MultipleVariableDeclarations"/>
- <module name="UnnecessaryParentheses"/>
- <module name="ParameterAssignment"/>
- <module name="EqualsAvoidNull">
- <property name="severity" value="error"/>
- </module>
- <module name="NoClone"/>
- <module name="NoFinalizer"/>
- <module name="SuperClone"/>
- <module name="SuperFinalize"/>
- <module name="ModifiedControlVariable">
- <property name="severity" value="error"/>
- </module>
- <module name="ReturnCount">
- <property name="max" value="3"/>
- </module>
-
- <!-- Checks for class design -->
- <!-- See http://checkstyle.sf.net/config_design.html -->
- <!--
- <module name="DesignForExtension"/>
- -->
- <module name="FinalClass"/>
- <module name="HideUtilityClassConstructor"/>
- <!--
- <module name="InterfaceIsType"/>
- -->
- <module name="VisibilityModifier"/>
- <module name="MutableException"/>
- <module name="ThrowsCount">
- <property name="max" value="2" />
- </module>
-
-
- <!-- Miscellaneous other checks. -->
- <!-- See http://checkstyle.sf.net/config_misc.html -->
- <module name="ArrayTypeStyle"/>
- <module name="FinalParameters">
- <property name="tokens" value="CTOR_DEF"/>
- </module>
- <module name="Indentation"/>
-
- <module name="TodoComment"/>
- <module name="UpperEll"/>
-
- <module name="BooleanExpressionComplexity"/>
- <module name="UpperEll"/>
-
- <module name="ArrayTypeStyle"/>
-
- </module>
-
-</module>
--- a/default.properties Fri Jan 15 11:58:04 2010 +0100
+++ b/default.properties Fri Jan 15 12:02:29 2010 +0100
@@ -10,5 +10,5 @@
# Indicates whether an apk should be generated for each density.
split.density=false
# Project target.
-target=android-3
+target=android-5
apk-configurations=
--- a/doc/.what Fri Jan 15 11:58:04 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-This directory will contains some documentation about the project. The generated javadoc will be here (but not versionned).
--- a/eclipse_formatter.xml Fri Jan 15 11:58:04 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,269 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<profiles version="11">
-<profile kind="CodeFormatterProfile" name="Eclipse [good tabsize]" version="11">
-<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
-<setting id="org.eclipse.jdt.core.compiler.source" value="1.5"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
-<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
-<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="mixed"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="8"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
-<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.5"/>
-<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
-<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.5"/>
-<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
-</profile>
-</profiles>
--- a/libs/.what Fri Jan 15 11:58:04 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-This directory will contains the differents jar needs by the project
--- a/project.aidl Fri Jan 15 11:58:04 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-// This file is auto-generated by the
-// 'Create Aidl preprocess file for Parcelable classes'
-// action. Do not modify!
-
-parcelable com.beem.project.beem.BeemException
-parcelable com.beem.project.beem.service.Message
-parcelable com.beem.project.beem.service.PresenceAdapter
-parcelable com.beem.project.beem.service.Contact
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/anim/rotate_and_scale.xml Fri Jan 15 12:02:29 2010 +0100
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+ <scale android:fromXScale="0.5" android:toXScale="1.0"
+ android:fromYScale="0.5" android:toYScale="1.0"
+ 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"
+ android:repeatMode="restart"
+ android:repeatCount="infinite" />
+</set>
Binary file res/drawable/ic_menu_add.png has changed
Binary file res/drawable/ic_menu_agenda.png has changed
Binary file res/drawable/ic_menu_allfriends.png has changed
Binary file res/drawable/ic_menu_always_landscape_portrait.png has changed
Binary file res/drawable/ic_menu_archive.png has changed
Binary file res/drawable/ic_menu_attachment.png has changed
Binary file res/drawable/ic_menu_back.png has changed
Binary file res/drawable/ic_menu_block.png has changed
Binary file res/drawable/ic_menu_call.png has changed
Binary file res/drawable/ic_menu_camera.png has changed
Binary file res/drawable/ic_menu_cc.png has changed
Binary file res/drawable/ic_menu_clear_playlist.png has changed
Binary file res/drawable/ic_menu_close_clear_cancel.png has changed
Binary file res/drawable/ic_menu_compass.png has changed
Binary file res/drawable/ic_menu_compose.png has changed
Binary file res/drawable/ic_menu_crop.png has changed
Binary file res/drawable/ic_menu_day.png has changed
Binary file res/drawable/ic_menu_delete.png has changed
Binary file res/drawable/ic_menu_directions.png has changed
Binary file res/drawable/ic_menu_edit.png has changed
Binary file res/drawable/ic_menu_emoticons.png has changed
Binary file res/drawable/ic_menu_forward.png has changed
Binary file res/drawable/ic_menu_gallery.png has changed
Binary file res/drawable/ic_menu_goto.png has changed
Binary file res/drawable/ic_menu_help.png has changed
Binary file res/drawable/ic_menu_home.png has changed
Binary file res/drawable/ic_menu_info_details.png has changed
Binary file res/drawable/ic_menu_manage.png has changed
Binary file res/drawable/ic_menu_mapmode.png has changed
Binary file res/drawable/ic_menu_mark.png has changed
Binary file res/drawable/ic_menu_month.png has changed
Binary file res/drawable/ic_menu_more.png has changed
Binary file res/drawable/ic_menu_my_calendar.png has changed
Binary file res/drawable/ic_menu_mylocation.png has changed
Binary file res/drawable/ic_menu_myplaces.png has changed
Binary file res/drawable/ic_menu_notifications.png has changed
Binary file res/drawable/ic_menu_play_clip.png has changed
Binary file res/drawable/ic_menu_preferences.png has changed
Binary file res/drawable/ic_menu_recent_history.png has changed
Binary file res/drawable/ic_menu_refresh.png has changed
Binary file res/drawable/ic_menu_report_image.png has changed
Binary file res/drawable/ic_menu_revert.png has changed
Binary file res/drawable/ic_menu_rotate.png has changed
Binary file res/drawable/ic_menu_save.png has changed
Binary file res/drawable/ic_menu_search.png has changed
Binary file res/drawable/ic_menu_send.png has changed
Binary file res/drawable/ic_menu_set_as.png has changed
Binary file res/drawable/ic_menu_share.png has changed
Binary file res/drawable/ic_menu_slideshow.png has changed
Binary file res/drawable/ic_menu_sort_alphabetically.png has changed
Binary file res/drawable/ic_menu_sort_by_size.png has changed
Binary file res/drawable/ic_menu_star.png has changed
Binary file res/drawable/ic_menu_start_conversation.png has changed
Binary file res/drawable/ic_menu_stop.png has changed
Binary file res/drawable/ic_menu_today.png has changed
Binary file res/drawable/ic_menu_upload.png has changed
Binary file res/drawable/ic_menu_upload_you_tube.png has changed
Binary file res/drawable/ic_menu_view.png has changed
Binary file res/drawable/ic_menu_week.png has changed
Binary file res/drawable/ic_menu_zoom.png has changed
--- a/res/layout/changestatus.xml Fri Jan 15 11:58:04 2010 +0100
+++ b/res/layout/changestatus.xml Fri Jan 15 12:02:29 2010 +0100
@@ -34,5 +34,9 @@
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" />
</RelativeLayout>
</ScrollView>
--- a/res/layout/chat.xml Fri Jan 15 11:58:04 2010 +0100
+++ b/res/layout/chat.xml Fri Jan 15 12:02:29 2010 +0100
@@ -2,26 +2,25 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical">
- <LinearLayout android:id="@+id/chat_header"
+ <RelativeLayout android:id="@+id/chat_header"
android:layout_width="fill_parent" android:layout_height="wrap_content"
- 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" />
- <LinearLayout android:orientation="vertical"
+ android:layout_height="wrap_content"
+ android:layout_centerVertical="true" />
+ <TextView android:id="@+id/chat_contact_name"
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" />
- <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" />
- </LinearLayout>
- </LinearLayout>
+ android:layout_toRightOf="@id/chat_contact_status_icon"
+ android:layout_marginLeft="15sp"
+ android:lines="1" android:singleLine="true" android:textSize="16sp"
+ android:textStyle="bold" android:textColor="#FFFFFF" />
+ <TextView android:id="@+id/chat_contact_status_msg"
+ android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_below="@id/chat_contact_name" android:layout_alignLeft="@id/chat_contact_name"
+ android:autoLink="all" android:textSize="12sp" android:textColor="#FFFFFF"
+ android:textColorLink="#FFFFFF" />
+ </RelativeLayout>
<View android:layout_width="fill_parent" android:layout_height="2dp"
android:fadingEdge="horizontal" android:background="#555555" />
<ListView android:id="@+id/chat_messages"
@@ -32,9 +31,10 @@
<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:ellipsize="end" android:inputType="textShortMessage|textAutoCorrect"
+ android:maxLines="5"
+ android:inputType="textShortMessage|textAutoCorrect|textMultiLine"
android:imeOptions="actionSend" android:cursorVisible="true"
android:hint="@string/chat_input_default_value" />
<Button android:id="@+id/chat_send_message"
--- a/res/layout/contactdialog.xml Fri Jan 15 11:58:04 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-<?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="fill_parent">
-
- <Button android:id="@+id/CDChat" android:layout_width="fill_parent"
- android:layout_height="wrap_content" android:text="@string/CDChat" />
-
- <Button android:id="@+id/CDCall" android:layout_width="fill_parent"
- android:layout_height="wrap_content" android:text="@string/CDCall" />
-
- <Button android:id="@+id/CDInfos" android:layout_width="fill_parent"
- android:layout_height="wrap_content" android:text="@string/CDInfos" />
-
-</LinearLayout>
\ No newline at end of file
--- a/res/layout/contactdialogaliasdialog.xml Fri Jan 15 11:58:04 2010 +0100
+++ b/res/layout/contactdialogaliasdialog.xml Fri Jan 15 12:02:29 2010 +0100
@@ -2,13 +2,14 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
-
+ <TextView android:id="@+id/CDAliasDialogLabel"
+ android:layout_height="wrap_content" android:layout_width="wrap_content"
+ android:layout_marginLeft="20dip" android:layout_marginRight="20dip"
+ android:text="@string/userinfo_label_alias"
+ android:gravity="left" style="@style/Label" />
<EditText android:id="@+id/CDAliasDialogName"
- android:layout_width="fill_parent" android:layout_height="wrap_content"
- android:inputType="textPersonName" android:imeOptions="actionDone"
- android:singleLine="true" android:maxLines="1" />
-
- <Button android:id="@+id/CDAliasDialogOk" android:layout_width="fill_parent"
- android:layout_height="wrap_content" android:text="@string/OkButton" />
-
+ 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" />
</LinearLayout>
--- a/res/layout/contactlist.xml Fri Jan 15 11:58:04 2010 +0100
+++ b/res/layout/contactlist.xml Fri Jan 15 12:02:29 2010 +0100
@@ -11,8 +11,10 @@
<LinearLayout android:layout_width="fill_parent"
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" />
+ <ListView android:id="@+id/contactlist"
+ android:layout_width="fill_parent" android:layout_height="fill_parent"
+ android:transcriptMode="disabled" />
+ <!-- normal should be better -->
</LinearLayout>
</LinearLayout>
--- a/res/layout/contactlistcontact.xml Fri Jan 15 11:58:04 2010 +0100
+++ b/res/layout/contactlistcontact.xml Fri Jan 15 12:02:29 2010 +0100
@@ -1,25 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="horizontal" android:layout_width="fill_parent"
- android:layout_height="wrap_content" android:paddingLeft="10px"
- android:paddingRight="10px" android:paddingTop="8dip"
- android:paddingBottom="8dip" android:gravity="center_vertical">
- <ImageView android:id="@+id/contactliststatus"
- android:adjustViewBounds="true" android:layout_width="wrap_content"
- android:layout_height="wrap_content" android:gravity="center_vertical" />
- <LinearLayout android:orientation="vertical"
- android:layout_weight="1" android:layout_width="fill_parent"
- android:layout_height="wrap_content">
- <TextView android:id="@+id/contactlistpseudo"
- android:layout_width="fill_parent" android:layout_height="wrap_content"
- android:paddingLeft="16px" android:singleLine="true"
- android:maxLines="1" android:textColor="@color/white"
- android:textSize="18sp" android:textStyle="bold" />
- <TextView android:id="@+id/contactlistmsgperso"
- android:layout_width="fill_parent" android:layout_height="wrap_content"
- android:paddingLeft="16px" android:singleLine="true"
- android:maxLines="1" android:linksClickable="false" android:autoLink="all"
- android:scrollHorizontally="true" android:textColorLink="@color/white"
- android:textSize="12px" />
- </LinearLayout>
+ android:orientation="vertical" android:layout_width="fill_parent"
+ android:layout_height="wrap_content" android:paddingLeft="10px"
+ android:paddingRight="10px" android:paddingTop="8dip"
+ android:paddingBottom="8dip" >
+ <TextView android:id="@+id/contactlistpseudo"
+ android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:singleLine="true"
+ android:maxLines="1" android:textColor="@color/white"
+ android:drawablePadding="12px"
+ android:textSize="18sp" android:textStyle="bold" />
+
+ <TextView android:id="@+id/contactlistmsgperso"
+ android:layout_width="fill_parent" android:layout_height="wrap_content"
+ 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>
--- a/res/layout/jingle_call_activity.xml Fri Jan 15 11:58:04 2010 +0100
+++ b/res/layout/jingle_call_activity.xml Fri Jan 15 12:02:29 2010 +0100
@@ -2,7 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:orientation="vertical">
- <TextView android:text="Jid:" android:id="@+id/jingledemocalljidlabel"
+<!-- <TextView android:text="Jid:" android:id="@+id/jingledemocalljidlabel"
android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
<EditText android:id="@+id/jingledemocalljid"
android:layout_width="fill_parent" android:layout_height="wrap_content"></EditText>
@@ -18,5 +18,8 @@
<EditText android:text="" android:id="@+id/jingledemocallreceiver" android:layout_width="fill_parent" android:layout_height="wrap_content"></EditText>
-<Button android:text="Call" android:id="@+id/jingledemocallbutton" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+<Button android:text="Call" android:id="@+id/jingledemocallbutton" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button> -->
+<ImageView android:id="@+id/log_as_logo"
+ android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_marginBottom="25px" android:layout_marginTop="42px" />
</LinearLayout>
--- a/res/layout/login.xml Fri Jan 15 11:58:04 2010 +0100
+++ b/res/layout/login.xml Fri Jan 15 12:02:29 2010 +0100
@@ -3,7 +3,7 @@
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical">
<LinearLayout android:orientation="vertical"
- android:layout_width="fill_parent" android:layout_height="fill_parent">
+ android:layout_width="fill_parent" android:layout_height="wrap_content">
<ImageView android:id="@+id/log_as_logo" android:src="@drawable/logo"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_marginBottom="25px" android:layout_marginTop="42px" />
@@ -12,4 +12,4 @@
android:textColor="#FF0000" android:textStyle="bold"
android:textSize="14sp" />
</LinearLayout>
-</ScrollView>
\ No newline at end of file
+</ScrollView>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/layout/login_anim.xml Fri Jan 15 12:02:29 2010 +0100
@@ -0,0 +1,13 @@
+<?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">
+ <ImageView android:id="@+id/loginanim_logo_anim" android:src="@drawable/beem_launcher_icon_color"
+ android:layout_height="fill_parent" android:layout_width="fill_parent"
+ android:layout_weight="1" />
+ <Button android:id="@+id/loginanim_cancel_button"
+ android:layout_height="wrap_content" android:layout_width="fill_parent"
+ android:layout_gravity="bottom" android:text="@string/CancelButton" />
+</LinearLayout>
+
--- a/res/layout/preferences.xml Fri Jan 15 11:58:04 2010 +0100
+++ b/res/layout/preferences.xml Fri Jan 15 12:02:29 2010 +0100
@@ -12,10 +12,13 @@
<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:key="settings_key_account_username"
+ android:hint="@string/login_username_info_default" />
<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" />
+ </PreferenceCategory>
+ <PreferenceCategory android:title="@string/user_preferences_advanced">
<EditTextPreference
android:key="settings_key_resource"
android:title="@string/SettingsResourceTitle"
@@ -25,7 +28,7 @@
android:key="settings_key_priority"
android:title="@string/SettingsPriorityTitle"
android:summary="@string/SettingsPrioritySummary"
- android:numeric="integer"
+ android:numeric="signed"
android:defaultValue="0" />
<CheckBoxPreference android:title="@string/SettingsCheckboxText"
android:defaultValue="false" android:summary="@string/SettingsGmail"
@@ -51,7 +54,8 @@
<EditTextPreference android:singleLine="true"
android:dependency="settings_key_proxy_use" android:name="port"
android:summary="@string/SettingsProxyPort" android:title="@string/settings_proxy_port"
- android:key="settings_key_proxy_port" />
+ android:key="settings_key_proxy_port"
+ android:hint="@string/comments_proxy_port" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/proxy_user_settings">
<EditTextPreference android:singleLine="true"
@@ -80,11 +84,13 @@
<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: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:defaultValue="5222" android:key="settings_key_xmpp_port"
+ android:hint="@string/comments_xmpp_port"/>
</PreferenceScreen>
</PreferenceCategory>
</PreferenceScreen>
--- a/res/layout/userinfo.xml Fri Jan 15 11:58:04 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
- 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">
- <LinearLayout android:id="@+id/userinfo_layout_alias"
- android:orientation="vertical" android:layout_width="fill_parent"
- android:layout_height="70px">
- <TextView android:layout_width="fill_parent"
- android:layout_height="wrap_content" android:paddingLeft="20sp"
- android:singleLine="true" android:maxLines="1" android:textSize="30px"
- android:text="@string/userinfo_label_alias" />
- <TextView android:id="@+id/userinfo_alias"
- android:layout_width="fill_parent" android:layout_height="wrap_content"
- android:paddingLeft="20sp" android:singleLine="true" />
- </LinearLayout>
- <View android:layout_height="1px" android:layout_width="fill_parent"
- android:background="#FFFFFF" />
- <LinearLayout android:id="@+id/userinfo_layout_chg_group"
- android:orientation="vertical" android:layout_width="fill_parent"
- android:layout_height="70px">
- <TextView android:layout_width="fill_parent"
- android:layout_height="wrap_content" android:paddingLeft="20sp"
- android:singleLine="true" android:maxLines="1" android:textSize="30px"
- android:text="@string/userinfo_label_chg_group" />
- <Gallery android:id="@+id/userinfo_groups"
- android:layout_width="fill_parent" android:layout_height="wrap_content"
- android:spacing="10px" />
- </LinearLayout>
- <View android:layout_height="1px" android:layout_width="fill_parent"
- android:background="#FFFFFF" />
- <LinearLayout android:id="@+id/userinfo_layout_re_suscription"
- android:orientation="vertical" android:layout_width="fill_parent"
- android:layout_height="70px">
- <TextView android:layout_width="fill_parent"
- android:layout_height="wrap_content" android:paddingLeft="20sp"
- android:singleLine="true" android:maxLines="1" android:textSize="30px"
- android:text="@string/userinfo_label_re_suscription" />
- </LinearLayout>
- <View android:layout_height="1px" android:layout_width="fill_parent"
- android:background="#FFFFFF" />
- <LinearLayout android:id="@+id/userinfo_layout_block"
- android:orientation="vertical" android:layout_width="fill_parent"
- android:layout_height="70px">
- <TextView android:layout_width="fill_parent"
- android:layout_height="wrap_content" android:paddingLeft="20sp"
- android:singleLine="true" android:maxLines="1" android:textSize="30px"
- android:text="@string/userinfo_label_block" />
- </LinearLayout>
- <View android:layout_height="1px" android:layout_width="fill_parent"
- android:background="#FFFFFF" />
- <LinearLayout android:id="@+id/userinfo_layout_delete"
- android:orientation="vertical" android:layout_width="fill_parent"
- android:layout_height="70px">
- <TextView android:layout_width="fill_parent"
- android:layout_height="wrap_content" android:paddingLeft="20sp"
- android:singleLine="true" android:maxLines="1" android:textSize="30px"
- android:text="@string/userinfo_label_delete" />
- </LinearLayout>
- </LinearLayout>
-</ScrollView>
\ No newline at end of file
--- a/res/menu/contact_list.xml Fri Jan 15 11:58:04 2010 +0100
+++ b/res/menu/contact_list.xml Fri Jan 15 12:02:29 2010 +0100
@@ -2,9 +2,9 @@
<item android:id="@+id/contact_list_menu_add_contact"
android:visible="true"
android:title="@string/contact_list_menu_add_contact"
- android:icon="@drawable/ic_menu_add" />
+ android:icon="@android:drawable/ic_menu_add" />
<item android:id="@+id/contact_list_menu_settings"
android:visible="true"
android:title="@string/contact_list_menu_settings"
- android:icon="@drawable/ic_menu_manage" />
+ android:icon="@android:drawable/ic_menu_manage" />
</menu>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/menu/contactlist_context.xml Fri Jan 15 12:02:29 2010 +0100
@@ -0,0 +1,21 @@
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@+id/contact_list_context_menu_chat_item"
+ android:title="@string/CDChat" />
+ <item android:id="@+id/contact_list_context_menu_call_item"
+ android:title="@string/CDCall" android:visible="false" />
+ <item android:id="@+id/contact_list_context_menu_user_info"
+ android:title="@string/CDInfos">
+ <menu>
+ <item android:id="@+id/contact_list_context_menu_userinfo_alias"
+ android:title="@string/userinfo_label_alias" />
+ <item android:id="@+id/contact_list_context_menu_userinfo_group"
+ android:title="@string/userinfo_label_chg_group" />
+ <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"/>
+ <item android:id="@+id/contact_list_context_menu_userinfo_delete"
+ android:title="@string/userinfo_label_delete" />
+ </menu>
+ </item>
+</menu>
--- a/res/menu/edit_settings.xml Fri Jan 15 11:58:04 2010 +0100
+++ b/res/menu/edit_settings.xml Fri Jan 15 12:02:29 2010 +0100
@@ -3,10 +3,6 @@
android:visible="true"
android:icon="@drawable/ic_menu_invite"
android:title="@string/settings_menu_create_account" />
- <item android:id="@+id/settings_menu_login"
- android:visible="true"
- android:title="@string/settings_menu_login"
- android:icon="@drawable/ic_menu_login" />
<item android:id="@+id/settings_menu_privacy_lists"
android:visible="true"
android:title="@string/settings_menu_privacy_lists"
--- a/res/menu/login.xml Fri Jan 15 11:58:04 2010 +0100
+++ b/res/menu/login.xml Fri Jan 15 12:02:29 2010 +0100
@@ -1,10 +1,14 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@+id/login_menu_login"
+ android:visible="true"
+ android:title="@string/login_menu_login"
+ android:icon="@drawable/ic_menu_login" />
<item android:id="@+id/login_menu_settings"
android:visible="true"
android:title="@string/login_menu_settings"
- android:icon="@drawable/ic_menu_manage" />
+ android:icon="@android:drawable/ic_menu_manage" />
<item android:id="@+id/login_menu_about"
android:visible="true"
android:title="@string/login_menu_about"
- android:icon="@drawable/ic_menu_help" />
+ android:icon="@android:drawable/ic_menu_help" />
</menu>
--- a/res/menu/privacy_list.xml Fri Jan 15 11:58:04 2010 +0100
+++ b/res/menu/privacy_list.xml Fri Jan 15 12:02:29 2010 +0100
@@ -1,4 +1,4 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/privacy_list_menu_create" android:visible="true"
- android:title="@string/privacy_list_menu_create" android:icon="@drawable/ic_menu_add" />
+ android:title="@string/privacy_list_menu_create" android:icon="@android:drawable/ic_menu_add" />
</menu>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/menu/privacy_list_context.xml Fri Jan 15 12:02:29 2010 +0100
@@ -0,0 +1,8 @@
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@+id/privacy_list_context_menu_buddies_item"
+ android:title="@string/privacy_list_select_dialog_buddies" />
+ <item android:id="@+id/privacy_list_context_menu_groups_item"
+ android:title="@string/privacy_list_select_dialog_groups" />
+ <item android:id="@+id/privacy_list_context_menu_delete_item"
+ android:title="@string/privacy_list_select_dialog_delete" />
+</menu>
--- a/res/values-fr/arrays.xml Fri Jan 15 11:58:04 2010 +0100
+++ b/res/values-fr/arrays.xml Fri Jan 15 12:02:29 2010 +0100
@@ -6,7 +6,7 @@
<item>SOCKS5</item>
</string-array>
<string-array name="status_types">
- <item name="AvailableForChat">Disponible pour clavarder</item>
+ <item name="AvailableForChat">Disponible pour Bavarder</item>
<item name="Available">Disponible</item>
<item name="Busy">Occupé(e)</item>
<item name="Away">Parti(e)</item>
--- a/res/values-fr/strings.xml Fri Jan 15 11:58:04 2010 +0100
+++ b/res/values-fr/strings.xml Fri Jan 15 12:02:29 2010 +0100
@@ -68,9 +68,11 @@
<!-- ChangeStatus class -->
<string name="ChangeStatusActTitle">Beem - Changer mon statut</string>
-
<string name="ChangeStatusType">Mon statut</string>
<string name="ChangeStatusMessage">Mon message personnel</string>
+ <string name="OpenContactList">Ouvrir la liste des contacts</string>
+
+
<string name="MenuAddContact">Ajouter un nouveau contact</string>
<string name="MenuAccountAbout">Beem Project</string>
<string name="MenuAccountCreate">Créer un compte</string>
@@ -117,7 +119,7 @@
<string name="BeemChatManagerNewMessage">Vous avez reçu un nouveau message</string>
<!-- BeemBroadcastReceiver class -->
- <string name="BeemBroadcastReceiverDisconnect">Vous avez été déconnecté(e)</string>
+ <string name="BeemBroadcastReceiverDisconnect">BEEM: Vous avez été déconnecté(e)</string>
<!-- XmppConnectionAdapter class -->
<string name="AcceptContactRequest">%s vient de vous ajouter à sa liste d\'amis.</string>
@@ -170,32 +172,21 @@
<string name="login_login_progress">Connexion en cours. Veuillez patienter...</string>
<string name="login_error_msg">Malheureusement, une erreur est survenu.\n\nDétail
de l\'erreur :\n%s</string>
+ <string name="login_menu_login">Se connecter</string>
+ <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
-->
<string name="settings_menu_create_account">Créer un compte</string>
- <string name="settings_menu_login">Se connecter</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>
-
- <string name="settings_key_account_username">beem_account_username</string>
- <string name="settings_key_account_password">beem_account_password</string>
- <string name="settings_key_xmpp_server">beem_xmpp_server</string>
- <string name="settings_key_xmpp_port">beem_xmpp_port</string>
- <string name="settings_key_xmpp_tls_use">beem_xmpp_tls_use</string>
- <string name="settings_key_proxy_use">beem_xmpp_proxy_use</string>
- <string name="settings_key_proxy_server">beem_xmpp_proxy_server</string>
- <string name="settings_key_proxy_port">beem_xmpp_proxy_port</string>
- <string name="settings_key_proxy_username">beem_xmpp_proxy_username</string>
- <string name="settings_key_proxy_password">beem_xmpp_proxy_password</string>
- <string name="settings_key_proxy_type">beem_xmpp_proxy_type</string>
- <string name="settings_key_hidden_contact">settings_key_hidden_contact</string>
+ <string name="settings_saved_ok">Les paramètres ont été enregistrés avec succès.</string>
<!-- EditSettings Activity Categories -->
<string name="general_preferences">Préférences de l\'application</string>
- <string name="user_preferences">Utilisateur</string>
+ <string name="user_preferences">Utilisateur (obligatoire)</string>
+ <string name="user_preferences_advanced">Utilisateur avancés (facultatif)</string>
<string name="network_preferences">Options réseau</string>
<string name="proxy_proxy_settings">Paramètres du proxy</string>
<string name="proxy_user_settings">Identifiant proxy</string>
@@ -217,6 +208,7 @@
<!-- 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>
@@ -225,7 +217,9 @@
<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">Utiliser SSL/TLS</string>
<string name="settings_reco_delay">Délai de reconnexion</string>
@@ -236,6 +230,7 @@
<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>
@@ -246,7 +241,7 @@
<string name="create_account_err_dialog_title">Créer un compte - Erreur</string>
<string name="create_account_err_dialog_settings_button">Changer mes paramètres</string>
<string name="create_account_close_dialog_button">Fermer</string>
- <string name="create_account_successfull_after">A été créé avec succès</string>
+ <string name="create_account_successfull_after">L\'utilisateur %s a été créé avec succès</string>
<string name="create_account_err_username">Mauvais JabberID</string>
<string name="create_account_err_passwords">Les mots de passe ne correspondent pas</string>
<string name="create_account_username">Nom d\'utilisateur</string>
@@ -267,7 +262,7 @@
-->
<string name="userinfo_label_alias">Alias</string>
<string name="userinfo_label_chg_group">Modifier groupe</string>
- <string name="userinfo_label_re_suscription">Renvoyer l\'invitation</string>
+ <string name="userinfo_label_re_subscription">Renvoyer l\'invitation</string>
<string name="userinfo_label_block">Bloquer</string>
<string name="userinfo_label_delete">Supprimer</string>
<string name="userinfo_resend">Souscription réenvoyée</string>
@@ -287,9 +282,9 @@
<string name="chat_no_more_chats">Aucune conversation en cours</string>
<string name="contact_status_msg_available">Disponible</string>
- <string name="contact_status_msg_available_chat">Disponible pour clavarder</string>
+ <string name="contact_status_msg_available_chat">Disponible pour discuter</string>
<string name="contact_status_msg_dnd">Occupé(e)</string>
- <string name="contact_status_msg_away">Parti(e)</string>
+ <string name="contact_status_msg_away">Absent(e)</string>
<string name="contact_status_msg_xa">Indisponible</string>
<string name="contact_status_msg_offline">Hors ligne</string>
@@ -299,6 +294,12 @@
<string name="privacy_list_create_dialog_title">Créer une liste privée</string>
<string name="privacy_list_create_dialog_list_name_label">Titre</string>
<string name="privacy_list_create_dialog_create_button">Créer</string>
+ <string name="privacy_list_select_dialog_buddies">Contacts</string>
+ <string name="privacy_list_select_dialog_groups">Groupes</string>
+ <string name="privacy_list_select_dialog_delete">Supprimer</string>
+ <string name="privacy_list_delete_dialog_msg">Souhaitez-vous vraiment supprimer la liste privée intitulée \'%s\' ?</string>
+ <string name="privacy_list_delete_dialog_yes">Oui</string>
+ <string name="privacy_list_delete_dialog_no">Non</string>
<string name="UpdateButton">Mettre à jour</string>
</resources>
--- a/res/values/strings.xml Fri Jan 15 11:58:04 2010 +0100
+++ b/res/values/strings.xml Fri Jan 15 12:02:29 2010 +0100
@@ -67,10 +67,12 @@
<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="ChangeStatusActTitle">Beem - Change my status</string>
+
<string name="MenuAddContact">Add new contact</string>
<string name="MenuAccountAbout">Beem Project</string>
<string name="MenuAccountCreate">Create account</string>
@@ -117,7 +119,7 @@
<string name="BeemChatManagerNewMessage">You\'ve a new message</string>
<!-- BeemBroadcastReceiver class -->
- <string name="BeemBroadcastReceiverDisconnect">You have been disconnected</string>
+ <string name="BeemBroadcastReceiverDisconnect">BEEM: You have been disconnected</string>
<!-- XmppConnectionAdapter class -->
<string name="AcceptContactRequest">%s has just added you to his/her buddy list.</string>
@@ -160,29 +162,21 @@
<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>
<!-- EditSettings Activity -->
<string name="settings_menu_create_account">Create an account</string>
- <string name="settings_menu_login">Login</string>
<string name="settings_menu_privacy_lists">Manage my privacy lists</string>
<string name="settings_saved_ok">The settings have been saved successfully.</string>
- <string name="settings_key_account_username">beem_account_username</string>
- <string name="settings_key_account_password">beem_account_password</string>
- <string name="settings_key_xmpp_server">beem_xmpp_server</string>
- <string name="settings_key_xmpp_port">beem_xmpp_port</string>
- <string name="settings_key_xmpp_tls_use">beem_xmpp_tls_use</string>
- <string name="settings_key_proxy_use">beem_xmpp_proxy_use</string>
- <string name="settings_key_proxy_server">beem_xmpp_proxy_server</string>
- <string name="settings_key_proxy_port">beem_xmpp_proxy_port</string>
- <string name="settings_key_proxy_username">beem_xmpp_proxy_username</string>
- <string name="settings_key_proxy_password">beem_xmpp_proxy_password</string>
- <string name="settings_key_proxy_type">beem_xmpp_proxy_type</string>
- <string name="settings_key_hidden_contact">settings_key_hidden_contact</string>
+
<!-- EditSettings Activity Categories -->
<string name="general_preferences">General preferences</string>
- <string name="user_preferences">User settings</string>
+ <string name="user_preferences">User settings (required)</string>
+ <string name="user_preferences_advanced">User settings advanced (optional)</string>
<string name="network_preferences">Network options</string>
<string name="proxy_proxy_settings">Proxy settings</string>
<string name="proxy_user_settings">Proxy settings</string>
@@ -205,6 +199,7 @@
<!-- 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>
@@ -213,9 +208,11 @@
<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>
@@ -223,6 +220,7 @@
<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>
@@ -231,7 +229,7 @@
<string name="create_account_err_dialog_title">Create an account - Error</string>
<string name="create_account_err_dialog_settings_button">Change my settings</string>
<string name="create_account_close_dialog_button">Close</string>
- <string name="create_account_successfull_after">has been created successfully</string>
+ <string name="create_account_successfull_after">account %s has been created successfully</string>
<string name="create_account_err_username">Bad JabberID</string>
<string name="create_account_err_passwords">Passwords do not match.</string>
<string name="create_account_username">Username</string>
@@ -244,10 +242,10 @@
<string name="contact_list_all_contact">All contacts</string>
<string name="contact_list_no_group">No group</string>
- <!-- UserInfo Activity -->
+ <!-- UserInfo dialog -->
<string name="userinfo_label_alias">Alias</string>
<string name="userinfo_label_chg_group">Manage groups</string>
- <string name="userinfo_label_re_suscription">Resend invit</string>
+ <string name="userinfo_label_re_subscription">Resend invit</string>
<string name="userinfo_label_block">Block</string>
<string name="userinfo_label_delete">Delete</string>
<string name="userinfo_resend">Suscription resend</string>
@@ -283,6 +281,9 @@
<string name="privacy_list_select_dialog_buddies">Buddies</string>
<string name="privacy_list_select_dialog_groups">Groups</string>
<string name="privacy_list_select_dialog_delete">Delete</string>
+ <string name="privacy_list_delete_dialog_msg">Do you really want to delete the privacy list entitled \'%s\' ?</string>
+ <string name="privacy_list_delete_dialog_yes">Yes</string>
+ <string name="privacy_list_delete_dialog_no">No</string>
<string name="UpdateButton">Update</string>
</resources>
--- a/src/.what Fri Jan 15 11:58:04 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-This directory will contains the src of the project
--- a/src/com/beem/project/beem/BeemService.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/BeemService.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ BEEM is a videoconference application on the Android Platform.
+
+ Copyright (C) 2009 by Frederic-Charles Barthelery,
+ Jean-Manuel Da Silva,
+ Nikita Kozlov,
+ Philippe Lago,
+ Jean Baptiste Vergely,
+ Vincent Veronis.
+
+ This file is part of BEEM.
+
+ BEEM is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ BEEM is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with BEEM. If not, see <http://www.gnu.org/licenses/>.
+
+ Please send bug reports with examples or suggestions to
+ contact@beem-project.com or http://dev.beem-project.com/
+
+ Epitech, hereby disclaims all copyright interest in the program "Beem"
+ written by Frederic-Charles Barthelery,
+ Jean-Manuel Da Silva,
+ Nikita Kozlov,
+ Philippe Lago,
+ Jean Baptiste Vergely,
+ Vincent Veronis.
+
+ Nicolas Sadirac, November 26, 2009
+ President of Epitech.
+
+ Flavien Astraud, November 26, 2009
+ Head of the EIP Laboratory.
+
+*/
package com.beem.project.beem;
import org.jivesoftware.smack.ConnectionConfiguration;
@@ -39,8 +82,10 @@
import android.app.NotificationManager;
import android.app.Service;
import android.content.Intent;
+import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
+import android.net.ConnectivityManager;
import android.os.IBinder;
import android.os.RemoteException;
import android.preference.PreferenceManager;
@@ -50,6 +95,8 @@
import com.beem.project.beem.service.XmppConnectionAdapter;
import com.beem.project.beem.service.XmppFacade;
import com.beem.project.beem.service.aidl.IXmppFacade;
+import com.beem.project.beem.utils.BeemBroadcastReceiver;
+import com.beem.project.beem.utils.BeemConnectivity;
/**
* This class is for the Beem service. The connection to the xmpp server will be made asynchronously when the service
@@ -58,13 +105,12 @@
*/
public class BeemService extends Service {
- /**
- * The id to use for status notification.
- */
+ /** The id to use for status notification. */
public static final int NOTIFICATION_STATUS_ID = 100;
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 NotificationManager mNotificationManager;
private XmppConnectionAdapter mConnection;
@@ -79,7 +125,8 @@
private ProxyInfo mProxyInfo;
private boolean mUseProxy;
private IXmppFacade.Stub mBind;
- private ProviderManager mProviderManager;
+
+ private BeemBroadcastReceiver mReceiver = new BeemBroadcastReceiver();
/**
* Constructor.
@@ -129,6 +176,9 @@
return mBind;
}
+ /* (non-Javadoc)
+ * @see android.app.Service#onUnbind(android.content.Intent)
+ */
@Override
public boolean onUnbind(Intent intent) {
Log.d(TAG, "ONUNBIND()");
@@ -144,8 +194,8 @@
*/
@Override
public void onCreate() {
-
super.onCreate();
+ registerReceiver(mReceiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
mSettings = PreferenceManager.getDefaultSharedPreferences(this);
String tmpJid = mSettings.getString("settings_key_account_username", "");
mLogin = StringUtils.parseName(tmpJid);
@@ -171,7 +221,7 @@
Roster.setDefaultSubscriptionMode(SubscriptionMode.manual);
mJingle = new JingleService(mConnection.getAdaptee(), this);
- mBind = new XmppFacade(mConnection, this, mJingle);
+ mBind = new XmppFacade(mConnection, mJingle);
Log.d(TAG, "ONCREATE");
}
@@ -181,8 +231,10 @@
@Override
public void onDestroy() {
super.onDestroy();
- mNotificationManager.cancel(NOTIFICATION_STATUS_ID);
- if (mConnection.isAuthentificated())
+ Log.d("Service", "onDestroy");
+ mNotificationManager.cancelAll();
+ unregisterReceiver(mReceiver);
+ if (mConnection.isAuthentificated() && BeemConnectivity.isConnected(this))
mConnection.disconnect();
Log.d(TAG, "ONDESTROY");
}
@@ -223,7 +275,7 @@
*/
public void resetStatus() {
Editor edit = mSettings.edit();
- edit.putInt(getString(R.string.PreferenceStatus), 1);
+ edit.putInt("PreferenceStatus", 1);
edit.commit();
}
@@ -271,12 +323,11 @@
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",
+ 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("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());
@@ -301,6 +352,7 @@
pm.addIQProvider("query", "jabber:iq:version", Class.forName("org.jivesoftware.smackx.packet.Version"));
} catch (ClassNotFoundException e) {
// Not sure what's happening here.
+ Log.w("TestClient", "Can't load class for org.jivesoftware.smackx.packet.Version");
}
// VCard
pm.addIQProvider("vCard", "vcard-temp", new VCardProvider());
@@ -325,16 +377,17 @@
pm.addExtensionProvider("data", "http://jabber.org/protocol/ibb", new IBBProviders.Data());
// Privacy
pm.addIQProvider("query", "jabber:iq:privacy", new PrivacyProvider());
- pm.addIQProvider("command", "http://jabber.org/protocol/commands", new AdHocCommandDataProvider());
- pm.addExtensionProvider("malformed-action", "http://jabber.org/protocol/commands",
+ pm.addIQProvider("command", COMMAND_NAMESPACE, new AdHocCommandDataProvider());
+ pm.addExtensionProvider("malformed-action", COMMAND_NAMESPACE,
new AdHocCommandDataProvider.MalformedActionError());
- pm.addExtensionProvider("bad-locale", "http://jabber.org/protocol/commands",
+ pm.addExtensionProvider("bad-locale", COMMAND_NAMESPACE,
new AdHocCommandDataProvider.BadLocaleError());
- pm.addExtensionProvider("bad-payload", "http://jabber.org/protocol/commands",
+ pm.addExtensionProvider("bad-payload", COMMAND_NAMESPACE,
new AdHocCommandDataProvider.BadPayloadError());
- pm.addExtensionProvider("bad-sessionid", "http://jabber.org/protocol/commands",
+ pm.addExtensionProvider("bad-sessionid", COMMAND_NAMESPACE,
new AdHocCommandDataProvider.BadSessionIDError());
- pm.addExtensionProvider("session-expired", "http://jabber.org/protocol/commands",
+ pm.addExtensionProvider("session-expired", COMMAND_NAMESPACE,
new AdHocCommandDataProvider.SessionExpiredError());
}
}
+
--- a/src/com/beem/project/beem/jingle/JingleService.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/jingle/JingleService.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,6 +1,46 @@
-/**
- *
- */
+/*
+ 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;
import java.util.ArrayList;
@@ -22,6 +62,7 @@
import android.content.Context;
import android.util.Log;
+// TODO: Auto-generated Javadoc
/**
* Beem Jingle Service, manage jingle call.
* @author nikita
--- a/src/com/beem/project/beem/jingle/MicrophoneRTPManager.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/jingle/MicrophoneRTPManager.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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;
import java.util.ArrayList;
@@ -36,17 +79,26 @@
mCtx = ctx;
}
+ /* (non-Javadoc)
+ * @see org.jivesoftware.smackx.jingle.media.JingleMediaManager#createMediaSession(org.jivesoftware.smackx.jingle.media.PayloadType, org.jivesoftware.smackx.jingle.nat.TransportCandidate, org.jivesoftware.smackx.jingle.nat.TransportCandidate, org.jivesoftware.smackx.jingle.JingleSession)
+ */
@Override
public JingleMediaSession createMediaSession(PayloadType payloadType, TransportCandidate remote,
TransportCandidate local, JingleSession jingleSession) {
return new RTPAudioSession(payloadType, remote, local, null, jingleSession, mCtx);
}
+ /* (non-Javadoc)
+ * @see org.jivesoftware.smackx.jingle.media.JingleMediaManager#getName()
+ */
@Override
public String getName() {
return MEDIA_NAME;
}
+ /* (non-Javadoc)
+ * @see org.jivesoftware.smackx.jingle.media.JingleMediaManager#getPayloads()
+ */
@Override
public List<PayloadType> getPayloads() {
return mPayloads;
--- a/src/com/beem/project/beem/jingle/MicrophoneRTPSession.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/jingle/MicrophoneRTPSession.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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;
import org.jivesoftware.smackx.jingle.JingleSession;
@@ -5,6 +48,7 @@
import org.jivesoftware.smackx.jingle.media.PayloadType;
import org.jivesoftware.smackx.jingle.nat.TransportCandidate;
+// TODO: Auto-generated Javadoc
/**
* Manage microphone RTP session.
* @author nikita
@@ -32,26 +76,41 @@
// mReceiver = new MicroRTPReceiver(getLocal().getPort());
}
+ /* (non-Javadoc)
+ * @see org.jivesoftware.smackx.jingle.media.JingleMediaSession#initialize()
+ */
@Override
public void initialize() {
// TODO Auto-generated method stub
}
+ /* (non-Javadoc)
+ * @see org.jivesoftware.smackx.jingle.media.JingleMediaSession#setTrasmit(boolean)
+ */
@Override
public void setTrasmit(boolean active) {
}
+ /* (non-Javadoc)
+ * @see org.jivesoftware.smackx.jingle.media.JingleMediaSession#startReceive()
+ */
@Override
public void startReceive() {
}
+ /* (non-Javadoc)
+ * @see org.jivesoftware.smackx.jingle.media.JingleMediaSession#startTrasmit()
+ */
@Override
public void startTrasmit() {
}
+ /* (non-Javadoc)
+ * @see org.jivesoftware.smackx.jingle.media.JingleMediaSession#stopReceive()
+ */
@Override
public void stopReceive() {
if (mReceiver != null) {
@@ -59,6 +118,9 @@
}
}
+ /* (non-Javadoc)
+ * @see org.jivesoftware.smackx.jingle.media.JingleMediaSession#stopTrasmit()
+ */
@Override
public void stopTrasmit() {
if (mTransmitter != null) {
--- a/src/com/beem/project/beem/jingle/PCMTransmitter.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/jingle/PCMTransmitter.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,9 +1,53 @@
+/*
+ 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;
import android.media.AudioFormat;
import android.media.AudioRecord;
import android.media.MediaRecorder;
+// TODO: Auto-generated Javadoc
/**
* Transmit Microphone data through RTP.
* @author nikita
@@ -23,6 +67,9 @@
super(remoteIP, remotePort);
}
+ /* (non-Javadoc)
+ * @see com.beem.project.beem.jingle.RTPTransmitter#start()
+ */
@Override
void start() {
AudioRecord audRec = new AudioRecord(MediaRecorder.AudioSource.DEFAULT, RATE_IN_HZ,
--- a/src/com/beem/project/beem/jingle/RTPReceiver.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/jingle/RTPReceiver.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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;
import java.net.DatagramSocket;
@@ -7,6 +50,7 @@
import jlibrtp.RTPAppIntf;
import jlibrtp.RTPSession;
+// TODO: Auto-generated Javadoc
/**
* abstract RTP receiver class.
* @author nikita
@@ -34,11 +78,17 @@
mRtpSession.RTPSessionRegister(this, null, null);
}
+ /* (non-Javadoc)
+ * @see org.jlibrtp.jlibrtp.RTPAppIntf#frameSize(int)
+ */
@Override
public int frameSize(int payloadType) {
return 1;
}
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
@Override
public void run() {
start();
@@ -57,6 +107,9 @@
this.setKillme(true);
}
+ /* (non-Javadoc)
+ * @see org.jlibrtp.jlibrtp.RTPAppIntf#userEvent(int, org.jlibrtp.jlibrtp.Participant[])
+ */
@Override
public void userEvent(int arg0, Participant[] arg1) {
// TODO Auto-generated method stub
--- a/src/com/beem/project/beem/jingle/RTPTransmitter.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/jingle/RTPTransmitter.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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;
import java.net.DatagramSocket;
@@ -10,6 +53,7 @@
import com.beem.project.beem.utils.FreePort;
+// TODO: Auto-generated Javadoc
/**
* abstract RTP transmitter class.
* @author nikita
@@ -46,16 +90,25 @@
getRtpSession().addParticipant(new Participant(remoteIP, remotePort, 0));
}
+ /* (non-Javadoc)
+ * @see org.jlibrtp.jlibrtp.RTPAppIntf#frameSize(int)
+ */
@Override
public int frameSize(int payloadType) {
return 1;
}
+ /* (non-Javadoc)
+ * @see org.jlibrtp.jlibrtp.RTPAppIntf#receiveData(org.jlibrtp.jlibrtp.DataFrame, org.jlibrtp.jlibrtp.Participant)
+ */
@Override
public void receiveData(DataFrame frame, Participant participant) {
// On envoie uniquement
}
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
@Override
public void run() {
start();
@@ -73,6 +126,9 @@
mKillme = true;
}
+ /* (non-Javadoc)
+ * @see org.jlibrtp.jlibrtp.RTPAppIntf#userEvent(int, org.jlibrtp.jlibrtp.Participant[])
+ */
@Override
public void userEvent(int type, Participant[] participant) {
// je sais pas ce que c'est
--- a/src/com/beem/project/beem/jingle/package-info.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/jingle/package-info.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,5 +1,45 @@
-/**
- * This package contains the class used by the Beem Jingle process.
- */
+/*
+ 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 Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/package-info.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,5 +1,45 @@
-/**
- * This package contains the main class for the Beem application.
- */
+/*
+ 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;
--- a/src/com/beem/project/beem/provider/Beem.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/provider/Beem.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,8 +1,52 @@
+/*
+ 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.
*/
@@ -13,86 +57,76 @@
*/
public static final class Contacts implements BaseColumns {
- /**
- * The query used to create the table.
- */
+ /** 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.
- */
+ /** 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.
- */
+ /** 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.
- */
+ /** 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.
- */
+ /** 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>
- * .
- */
+ * 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>
- * .
- */
+ * The JabberID of the contact
+ * <P>
+ * Type: INTEGER
+ * </P>
+ * .
+ */
public static final String JID = "jid";
/**
- * The nickname of the contact
- * <P>
- * Type: TEXT
- * </P>
- * .
- */
+ * The nickname of the contact
+ * <P>
+ * Type: TEXT
+ * </P>
+ * .
+ */
public static final String NICKNAME = "nickname";
/**
- * The alias of the contact
- * <P>
- * Type: TEXT
- * </P>
- * .
- */
+ * 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>
- * .
- */
+ * 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>
- * .
- */
+ * The timestamp for when the contact was last modified
+ * <P>
+ * Type: INTEGER (long from System.curentTimeMillis())
+ * </P>
+ * .
+ */
public static final String DATE_MODIFIED = "modified";
}
@@ -102,84 +136,64 @@
*/
public static final class Users implements BaseColumns {
- /**
- * The query used to create the table.
- */
+ /** 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.
- */
+ /** 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.
- */
+ /** 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.
- */
+ /** 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.
- */
+ /** 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>
- * .
- */
+ * 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>
- * .
- */
+ * 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>
- * .
- */
+ * 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.
- */
+ /** AUTHORITY. */
public static final String AUTHORITY = "com.beem.project.provider";
- /**
- * DB Name.
- */
+ /** DB Name. */
public static final String DB_NAME = "beem.db";
- /**
- * DB Version.
- */
+ /** DB Version. */
public static final int DB_VERSION = 2;
- /**
- * Name of the users table.
- */
+ /** Name of the users table. */
public static final String USERS_TABLE_NAME = "users";
- /**
- * Name of the contacts table.
- */
+ /** Name of the contacts table. */
public static final String CONTACTS_TABLE_NAME = "contacts";
/**
--- a/src/com/beem/project/beem/provider/BeemDatabaseHelper.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/provider/BeemDatabaseHelper.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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;
@@ -5,6 +48,7 @@
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
+// TODO: Auto-generated Javadoc
/**
* BeemDatabaseHelper class.
* @author Jamu
@@ -31,11 +75,17 @@
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
--- a/src/com/beem/project/beem/provider/ContactProvider.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/provider/ContactProvider.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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;
@@ -14,6 +57,7 @@
import android.provider.BaseColumns;
import android.text.TextUtils;
+// TODO: Auto-generated Javadoc
/**
* ContactProvider class.
* @author dasilvj
@@ -45,6 +89,9 @@
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();
@@ -69,6 +116,9 @@
return count;
}
+ /* (non-Javadoc)
+ * @see android.content.ContentProvider#getType(android.net.Uri)
+ */
@Override
public String getType(Uri uri) {
switch (S_URI_MATCHER.match(uri)) {
@@ -83,6 +133,9 @@
}
}
+ /* (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
@@ -136,12 +189,18 @@
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();
@@ -180,6 +239,9 @@
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();
--- a/src/com/beem/project/beem/provider/UserProvider.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/provider/UserProvider.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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;
@@ -14,6 +57,7 @@
import android.provider.BaseColumns;
import android.text.TextUtils;
+// TODO: Auto-generated Javadoc
/**
* UserProvider class.
* @author Jamu
@@ -42,6 +86,9 @@
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();
@@ -66,6 +113,9 @@
return count;
}
+ /* (non-Javadoc)
+ * @see android.content.ContentProvider#getType(android.net.Uri)
+ */
@Override
public String getType(Uri uri) {
switch (S_URI_MATCHER.match(uri)) {
@@ -80,6 +130,9 @@
}
}
+ /* (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
@@ -120,12 +173,18 @@
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();
@@ -164,6 +223,9 @@
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();
--- a/src/com/beem/project/beem/provider/package-info.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/provider/package-info.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,5 +1,45 @@
-/**
- * This package contains the class concerning the providers of Beem.
- */
+/*
+ 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;
--- a/src/com/beem/project/beem/service/BeemChatManager.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/service/BeemChatManager.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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 java.util.ArrayList;
@@ -8,11 +51,7 @@
import org.jivesoftware.smack.Chat;
import org.jivesoftware.smack.ChatManager;
import org.jivesoftware.smack.ChatManagerListener;
-import org.jivesoftware.smack.MessageListener;
-import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.util.StringUtils;
-import org.jivesoftware.smackx.ChatState;
-import org.jivesoftware.smackx.ChatStateListener;
import android.app.Notification;
import android.app.PendingIntent;
@@ -39,7 +78,7 @@
* A listener for all the chat creation event that happens on the connection.
* @author darisk
*/
- private class ChatListener implements ChatStateListener, ChatManagerListener, MessageListener {
+ private class ChatListener extends IMessageListener.Stub implements ChatManagerListener {
/**
* Constructor.
@@ -53,20 +92,20 @@
@Override
public void chatCreated(Chat chat, boolean locally) {
IChat newchat = getChat(chat);
- chat.addMessageListener(mChatListener);
- final int n = mRemoteChatCreationListeners.beginBroadcast();
+ try {
+ newchat.addMessageListener(mChatListener);
+ final int n = mRemoteChatCreationListeners.beginBroadcast();
- for (int i = 0; i < n; i++) {
- IChatManagerListener listener = mRemoteChatCreationListeners.getBroadcastItem(i);
- try {
+ for (int i = 0; i < n; i++) {
+ IChatManagerListener listener = mRemoteChatCreationListeners.getBroadcastItem(i);
listener.chatCreated(newchat, locally);
- } 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);
}
+ 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);
}
- mRemoteChatCreationListeners.finishBroadcast();
}
/**
@@ -83,7 +122,7 @@
Log.e(TAG, e.getMessage());
}
PendingIntent contentIntent = PendingIntent.getActivity(mService, 0, chatIntent,
- PendingIntent.FLAG_UPDATE_CURRENT);
+ PendingIntent.FLAG_UPDATE_CURRENT);
return contentIntent;
}
@@ -96,12 +135,12 @@
CharSequence tickerText = mService.getBind().getRoster().getContact(chat.getParticipant().getJID())
.getName();
Notification notification = new Notification(android.R.drawable.stat_notify_chat, tickerText, System
- .currentTimeMillis());
+ .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.hashCode(), notification);
+ .getString(R.string.BeemChatManagerNewMessage), makeChatIntent(chat));
+ mService.sendNotification(chat.getParticipant().getJID().hashCode(), notification);
} catch (RemoteException e) {
Log.e(TAG, e.getMessage());
}
@@ -111,59 +150,28 @@
* {@inheritDoc}
*/
@Override
- public void processMessage(Chat chat, Message message) {
- ChatAdapter newchat = getChat(chat);
+ public void processMessage(IChat chat, Message message) {
try {
- if (message.getBody() != null)
- newchat.addMessage(new com.beem.project.beem.service.Message(message));
- final int n = mRemoteMessageListeners.beginBroadcast();
- for (int i = 0; i < n; i++) {
- IMessageListener listener = mRemoteMessageListeners.getBroadcastItem(i);
- listener.processMessage(newchat, new com.beem.project.beem.service.Message(message));
- }
- mRemoteMessageListeners.finishBroadcast();
- if (!newchat.isOpen() && message.getBody() != null) {
- notifyNewChat(newchat);
+ 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());
}
}
- /**
- * {@inheritDoc}
- */
@Override
- public void stateChanged(Chat chat, ChatState state) {
- IChat newchat = getChat(chat);
- try {
- newchat.setState(state.name());
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- final int n = mRemoteMessageListeners.beginBroadcast();
-
- for (int i = 0; i < n; i++) {
- IMessageListener listener = mRemoteMessageListeners.getBroadcastItem(i);
- try {
- listener.stateChanged(newchat);
- } catch (RemoteException e) {
- Log.w(TAG, e.getMessage());
- }
- }
- mRemoteMessageListeners.finishBroadcast();
- }
+ public void stateChanged(IChat chat) { }
}
- /**
- * Tag to use with log methods.
- */
+ /** Tag to use with log methods. */
public 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<IMessageListener> mRemoteMessageListeners = new RemoteCallbackList<IMessageListener>();
private final BeemService mService;
/**
@@ -182,7 +190,8 @@
*/
@Override
public void addChatCreationListener(IChatManagerListener listener) throws RemoteException {
- mRemoteChatCreationListeners.register(listener);
+ if (listener != null)
+ mRemoteChatCreationListeners.register(listener);
}
/**
@@ -191,6 +200,7 @@
* @param listener listener to use for chat events on this chat session
* @return the chat session
*/
+ @Override
public IChat createChat(Contact contact, IMessageListener listener) {
String jid = contact.getJID();
return createChat(jid, listener);
@@ -203,13 +213,19 @@
* @return the chat session
*/
public IChat createChat(String jid, IMessageListener listener) {
- mRemoteMessageListeners.register(listener);
String key = StringUtils.parseBareAddress(jid);
+ ChatAdapter result;
+ Log.d(TAG, "Get chat key = " + key);
if (mChats.containsKey(key)) {
- return mChats.get(key);
+ result = mChats.get(key);
+ result.addMessageListener(listener);
+ return result;
}
- mAdaptee.createChat(key, mChatListener);
- return mChats.get(key);
+ Chat c = mAdaptee.createChat(key, null);
+ result = new ChatAdapter(c);
+ result.addMessageListener(listener);
+ mChats.put(key, result);
+ return result;
}
/**
@@ -217,16 +233,22 @@
*/
@Override
public void destroyChat(IChat chat) throws RemoteException {
- Log.d(TAG, "BEGIN destroyChat - jid = " + chat.getParticipant().getJID());
- IChat c = mChats.remove(chat.getParticipant().getJID());
- if (c == null)
- Log.w(TAG, "destroyChat - chat = null, jid = " + chat.getParticipant().getJID());
- Log.d(TAG, "END destroyChat - jid = " + chat.getParticipant().getJID());
+ // Can't remove it. otherwise we will lose all futur message in this chat
+ // chat.removeMessageListener(mChatListener);
+ deleteChatNotification(chat);
+ mChats.remove(chat.getParticipant().getJID());
}
+ /**
+ * {@inheritDoc}
+ */
@Override
public void deleteChatNotification(IChat chat) {
- mService.deleteNotification(chat.hashCode());
+ try {
+ mService.deleteNotification(chat.getParticipant().getJID().hashCode());
+ } catch (RemoteException e) {
+ Log.v(TAG, "Remote exception ", e);
+ }
}
/**
@@ -254,8 +276,12 @@
IRoster mRoster = mService.getBind().getRoster();
for (ChatAdapter chat : mChats.values()) {
- if (chat.getMessages().size() > 0) //TODO check plutot le nombre de messages dans l'historique
- openedChats.add(mRoster.getContact(chat.getParticipant().getJID()));
+ if (chat.getMessages().size() > 0) {
+ Contact t = mRoster.getContact(chat.getParticipant().getJID());
+ if (t == null)
+ t = new Contact(chat.getParticipant().getJID());
+ openedChats.add(t);
+ }
}
return openedChats;
}
@@ -265,7 +291,8 @@
*/
@Override
public void removeChatCreationListener(IChatManagerListener listener) throws RemoteException {
- mRemoteChatCreationListeners.unregister(listener);
+ if (listener != null)
+ mRemoteChatCreationListeners.unregister(listener);
}
}
--- a/src/com/beem/project/beem/service/ChatAdapter.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/service/ChatAdapter.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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 java.util.Collections;
@@ -6,10 +49,16 @@
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;
+import android.os.RemoteCallbackList;
import android.os.RemoteException;
+import android.util.Log;
import com.beem.project.beem.service.aidl.IChat;
+import com.beem.project.beem.service.aidl.IMessageListener;
/**
* An adapter for smack's Chat class.
@@ -17,12 +66,15 @@
*/
public class ChatAdapter extends IChat.Stub {
private static final int HISTORY_MAX_SIZE = 50;
+ private static final String TAG = "ChatAdapter";
private final Chat mAdaptee;
private final Contact mParticipant;
private String mState;
private boolean mIsOpen;
private final List<Message> mMessages;
+ private final RemoteCallbackList<IMessageListener> mRemoteListeners = new RemoteCallbackList<IMessageListener>();
+ private final MsgListener mMsgListener = new MsgListener();
/**
* Constructor.
@@ -32,6 +84,7 @@
mAdaptee = chat;
mParticipant = new Contact(chat.getParticipant());
mMessages = new LinkedList<Message>();
+ mAdaptee.addMessageListener(mMsgListener);
}
/**
@@ -68,6 +121,25 @@
* {@inheritDoc}
*/
@Override
+ public void addMessageListener(IMessageListener listen) {
+ if (listen != null)
+ mRemoteListeners.register(listen);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void removeMessageListener(IMessageListener listen) {
+ if (listen != null) {
+ mRemoteListeners.unregister(listen);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
public String getState() throws RemoteException {
return mState;
}
@@ -122,4 +194,51 @@
mMessages.add(msg);
}
+ /**
+ * Listener.
+ */
+ private class MsgListener implements MessageListener, ChatStateListener {
+ /**
+ * Constructor.
+ */
+ public MsgListener() { }
+
+ @Override
+ public void processMessage(Chat chat, org.jivesoftware.smack.packet.Message message) {
+ Message msg = new Message(message);
+ //TODO add que les message pas de type errors
+ ChatAdapter.this.addMessage(msg);
+ final int n = mRemoteListeners.beginBroadcast();
+ for (int i = 0; i < n; i++) {
+ IMessageListener listener = mRemoteListeners.getBroadcastItem(i);
+ try {
+ if (listener != null)
+ listener.processMessage(ChatAdapter.this, msg);
+ } catch (RemoteException e) {
+ Log.w(TAG, "Error while diffusing message to listener", e);
+ }
+ }
+ mRemoteListeners.finishBroadcast();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void stateChanged(Chat chat, ChatState state) {
+ mState = state.name();
+ final int n = mRemoteListeners.beginBroadcast();
+
+ for (int i = 0; i < n; i++) {
+ IMessageListener listener = mRemoteListeners.getBroadcastItem(i);
+ try {
+ listener.stateChanged(ChatAdapter.this);
+ } catch (RemoteException e) {
+ Log.w(TAG, e.getMessage());
+ }
+ }
+ mRemoteListeners.finishBroadcast();
+ }
+ }
}
+
--- a/src/com/beem/project/beem/service/Contact.aidl Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/service/Contact.aidl Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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;
parcelable Contact;
--- a/src/com/beem/project/beem/service/Contact.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/service/Contact.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,6 +1,46 @@
-/**
- *
- */
+/*
+ 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 java.util.ArrayList;
@@ -23,9 +63,7 @@
*/
public class Contact implements Parcelable {
- /**
- * Parcelable.Creator needs by Android.
- */
+ /** Parcelable.Creator needs by Android. */
public static final Parcelable.Creator<Contact> CREATOR = new Parcelable.Creator<Contact>() {
@Override
@@ -70,20 +108,6 @@
}
/**
- * {@inheritDoc}
- */
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeInt(mID);
- dest.writeInt(mStatus);
- dest.writeString(mJID);
- dest.writeString(mName);
- dest.writeString(mMsgState);
- dest.writeStringList(getMRes());
- dest.writeStringList(getGroups());
- }
-
- /**
* Constructor.
* @param jid JID of the contact
*/
@@ -118,6 +142,20 @@
}
/**
+ * {@inheritDoc}
+ */
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeInt(mID);
+ dest.writeInt(mStatus);
+ dest.writeString(mJID);
+ dest.writeString(mName);
+ dest.writeString(mMsgState);
+ dest.writeStringList(getMRes());
+ dest.writeStringList(getGroups());
+ }
+
+ /**
* Add a group for the contact.
* @param group the group
*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/service/LoginAsyncTask.java Fri Jan 15 12:02:29 2010 +0100
@@ -0,0 +1,134 @@
+/*
+ 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 android.os.AsyncTask;
+import android.os.RemoteException;
+import android.util.Log;
+import com.beem.project.beem.service.aidl.IXmppConnection;
+import com.beem.project.beem.service.aidl.IXmppFacade;
+
+/**
+ * This is an asynchronous task that will launch a connection to the XMPP server.
+ * @see android.os.AsyncTask
+ * @author Da Risk <da_risk@elyzion.net>
+ */
+public class LoginAsyncTask extends AsyncTask<IXmppFacade, Integer, Boolean> {
+
+ /**
+ * State of a running connection.
+ */
+ public static final int STATE_CONNECTION_RUNNING = 1;
+ /**
+ * State of an already connected connection but authentication is running.
+ */
+ public static final int STATE_LOGIN_RUNNING = 2;
+ /**
+ * State of a connected and authenticated succesfully.
+ */
+ public static final int STATE_LOGIN_SUCCESS = 3;
+ /**
+ * State of a connected but failed authentication.
+ */
+ public static final int STATE_LOGIN_FAILED = 4;
+
+ private static final String TAG = "BeemLoginTask";
+
+ private IXmppConnection mConnection;
+ private String mErrorMessage;
+
+ /**
+ * Constructor.
+ */
+ public LoginAsyncTask() {
+ }
+
+ @Override
+ protected Boolean doInBackground(IXmppFacade... params) {
+ boolean result = true;
+ IXmppFacade facade = params[0];
+ try {
+ publishProgress(STATE_CONNECTION_RUNNING);
+ mConnection = facade.createConnection();
+ if (!mConnection.connect()) {
+ mErrorMessage = mConnection.getErrorMessage();
+ return false;
+ }
+ publishProgress(STATE_LOGIN_RUNNING);
+
+ if (!mConnection.login()) {
+ mErrorMessage = mConnection.getErrorMessage();
+ publishProgress(STATE_LOGIN_FAILED);
+ return false;
+ }
+ publishProgress(STATE_LOGIN_SUCCESS);
+ } catch (RemoteException e) {
+ mErrorMessage = "Exception during connection :" + e;
+ result = false;
+ }
+ return result;
+ }
+
+ /**
+ * Make sur to call the parent method when overriding this method.
+ */
+ @Override
+ protected void onCancelled() {
+ try {
+ if (mConnection != null && mConnection.isAuthentificated()) {
+ mConnection.disconnect();
+ }
+ } catch (RemoteException e) {
+ Log.d(TAG, "Remote exception", e);
+ }
+ }
+
+ /**
+ * Get the error Message.
+ * @return the error message. null if no error
+ */
+ public String getErrorMessage() {
+ return mErrorMessage;
+ }
+}
--- a/src/com/beem/project/beem/service/Message.aidl Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/service/Message.aidl Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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;
-parcelable Message;
\ No newline at end of file
+parcelable Message;
--- a/src/com/beem/project/beem/service/Message.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/service/Message.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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.packet.XMPPError;
@@ -12,28 +55,19 @@
*/
public class Message implements Parcelable {
- /**
- * Normal message type. Theese messages are like an email, with subject.
- */
+ /** Normal message type. Theese messages are like an email, with subject. */
public static final int MSG_TYPE_NORMAL = 100;
- /**
- * Chat message type.
- */
+ /** Chat message type. */
public static final int MSG_TYPE_CHAT = 200;
- /**
- * Group chat message type.
- */
+ /** Group chat message type. */
public static final int MSG_TYPE_GROUP_CHAT = 300;
- /**
- * Error message type.
- */
+ /** Error message type. */
public static final int MSG_TYPE_ERROR = 400;
- /**
- * Parcelable.Creator needs by Android.
- */
+
+ /** Parcelable.Creator needs by Android. */
public static final Parcelable.Creator<Message> CREATOR = new Parcelable.Creator<Message>() {
@Override
@@ -105,6 +139,7 @@
break;
}
this.mFrom = smackMsg.getFrom();
+ //TODO better handling of error messages
if (mType == MSG_TYPE_ERROR) {
XMPPError er = smackMsg.getError();
String msg = er.getMessage();
--- a/src/com/beem/project/beem/service/PresenceAdapter.aidl Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/service/PresenceAdapter.aidl Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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;
-parcelable PresenceAdapter;
\ No newline at end of file
+parcelable PresenceAdapter;
--- a/src/com/beem/project/beem/service/PresenceAdapter.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/service/PresenceAdapter.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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.packet.Presence;
@@ -14,9 +57,7 @@
*/
public class PresenceAdapter implements Parcelable {
- /**
- * Parcelable.Creator needs by Android.
- */
+ /** Parcelable.Creator needs by Android. */
public static final Parcelable.Creator<PresenceAdapter> CREATOR = new Parcelable.Creator<PresenceAdapter>() {
@Override
@@ -60,6 +101,9 @@
mStatusText = presence.getStatus();
}
+ /* (non-Javadoc)
+ * @see android.os.Parcelable#describeContents()
+ */
@Override
public int describeContents() {
// TODO Auto-generated method stub
@@ -146,6 +190,9 @@
this.mType = type;
}
+ /* (non-Javadoc)
+ * @see android.os.Parcelable#writeToParcel(android.os.Parcel, int)
+ */
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(mType);
--- a/src/com/beem/project/beem/service/PrivacyListItem.aidl Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/service/PrivacyListItem.aidl Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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;
parcelable PrivacyListItem;
--- a/src/com/beem/project/beem/service/PrivacyListItem.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/service/PrivacyListItem.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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 android.os.Parcel;
--- a/src/com/beem/project/beem/service/PrivacyListManagerAdapter.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/service/PrivacyListManagerAdapter.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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 java.util.ArrayList;
@@ -23,9 +66,7 @@
*/
public class PrivacyListManagerAdapter extends IPrivacyListManager.Stub {
- /**
- * Class's Tag.
- */
+ /** Class's Tag. */
public static final String TAG = "PrivacyListManagerAdapter";
private final PrivacyListManager mPrivacyListManager;
@@ -35,17 +76,23 @@
/**
* Constructor.
- * @param connection The XMPP connection that will be used by the PrivacyListManagerAdapter.
+ * @param privacyListManager the privacy list manager
*/
public PrivacyListManagerAdapter(final PrivacyListManager privacyListManager) {
mPrivacyListManager = privacyListManager;
mPrivacyListManager.addListener(mPrivacyListListener);
}
+ /* (non-Javadoc)
+ * @see com.beem.project.beem.service.aidl.IPrivacyListManager#blockUser(java.lang.String, java.lang.String)
+ */
@Override
public void blockUser(String listName, String jid) throws RemoteException {
}
+ /* (non-Javadoc)
+ * @see com.beem.project.beem.service.aidl.IPrivacyListManager#createPrivacyList(java.lang.String, java.util.List)
+ */
@Override
public void createPrivacyList(String listName, List<PrivacyListItem> items) throws RemoteException {
Log.d(TAG, "BEGIN createPrivacyList.");
@@ -63,6 +110,9 @@
Log.d(TAG, "END createPrivacyList.");
}
+ /* (non-Javadoc)
+ * @see com.beem.project.beem.service.aidl.IPrivacyListManager#declineActivePrivacyList()
+ */
@Override
public void declineActivePrivacyList() throws RemoteException {
try {
@@ -72,6 +122,9 @@
}
}
+ /* (non-Javadoc)
+ * @see com.beem.project.beem.service.aidl.IPrivacyListManager#declineDefaultPrivacyList()
+ */
@Override
public void declineDefaultPrivacyList() throws RemoteException {
try {
@@ -81,6 +134,9 @@
}
}
+ /* (non-Javadoc)
+ * @see com.beem.project.beem.service.aidl.IPrivacyListManager#editPrivacyList(java.lang.String, java.util.List)
+ */
@Override
public void editPrivacyList(String listName, List<PrivacyListItem> items) throws RemoteException {
Log.d(TAG, "BEGIN editPrivacyList.");
@@ -92,6 +148,9 @@
Log.d(TAG, "END editPrivacyList.");
}
+ /* (non-Javadoc)
+ * @see com.beem.project.beem.service.aidl.IPrivacyListManager#getActivePrivacyList()
+ */
@Override
public String getActivePrivacyList() throws RemoteException {
try {
@@ -103,6 +162,9 @@
return null;
}
+ /* (non-Javadoc)
+ * @see com.beem.project.beem.service.aidl.IPrivacyListManager#getBlockedGroupsByList(java.lang.String)
+ */
@Override
public List<String> getBlockedGroupsByList(String listName) throws RemoteException {
List<String> blockedGroups = new ArrayList<String>();
@@ -118,6 +180,9 @@
return blockedGroups;
}
+ /* (non-Javadoc)
+ * @see com.beem.project.beem.service.aidl.IPrivacyListManager#getBlockedUsersByList(java.lang.String)
+ */
@Override
public List<String> getBlockedUsersByList(String listName) throws RemoteException {
List<String> blockedUsers = new ArrayList<String>();
@@ -133,6 +198,9 @@
return blockedUsers;
}
+ /* (non-Javadoc)
+ * @see com.beem.project.beem.service.aidl.IPrivacyListManager#getDefaultPrivacyList()
+ */
@Override
public String getDefaultPrivacyList() throws RemoteException {
try {
@@ -144,6 +212,9 @@
return null;
}
+ /* (non-Javadoc)
+ * @see com.beem.project.beem.service.aidl.IPrivacyListManager#removePrivacyList(java.lang.String)
+ */
@Override
public void removePrivacyList(String listName) throws RemoteException {
try {
@@ -153,6 +224,9 @@
}
}
+ /* (non-Javadoc)
+ * @see com.beem.project.beem.service.aidl.IPrivacyListManager#setActivePrivacyList(java.lang.String)
+ */
@Override
public void setActivePrivacyList(String listName) throws RemoteException {
try {
@@ -162,6 +236,9 @@
}
}
+ /* (non-Javadoc)
+ * @see com.beem.project.beem.service.aidl.IPrivacyListManager#setDefaultPrivacyList(java.lang.String)
+ */
@Override
public void setDefaultPrivacyList(String listName) throws RemoteException {
try {
@@ -206,6 +283,10 @@
* @author Jean-Manuel Da Silva <dasilvj at beem-project dot com>
*/
private class PrivacyListListenerAdapter implements PrivacyListListener {
+ /**
+ * Constructor.
+ */
+ public PrivacyListListenerAdapter() { }
@Override
public void setPrivacyList(final String listName, final List<PrivacyItem> listItem) {
@@ -251,6 +332,9 @@
mPrivacyListListeners.unregister(listener);
}
+ /* (non-Javadoc)
+ * @see com.beem.project.beem.service.aidl.IPrivacyListManager#getPrivacyLists()
+ */
@Override
public List<String> getPrivacyLists() throws RemoteException {
Log.d(TAG, "BEGIN getPrivacyLists.");
--- a/src/com/beem/project/beem/service/RosterAdapter.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/service/RosterAdapter.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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 java.util.ArrayList;
@@ -38,7 +81,7 @@
* @param roster The roster to adapt.
* @param context The context of the RosterAdapter.
*/
- public RosterAdapter(final Roster roster, Context context) {
+ public RosterAdapter(final Roster roster, final Context context) {
mAdaptee = roster;
roster.addRosterListener(mRosterListener);
mDefaultStatusMessages = createDefaultStatusMessagesMap(context);
@@ -104,7 +147,7 @@
try {
mAdaptee.createGroup(groupname);
} catch (IllegalArgumentException e) {
- Log.e(TAG, "Error while creating group", e);
+ Log.v(TAG, "Error while creating group", e);
}
}
@@ -133,7 +176,7 @@
}
}
// Because getEntries return duplicated user.
- if (add == true)
+ if (add)
coList.add(getContactFromRosterEntry(entry));
}
return coList;
@@ -169,11 +212,17 @@
mAdaptee.getEntry(jid).setName(name);
}
+ /* (non-Javadoc)
+ * @see com.beem.project.beem.service.aidl.IRoster#getPresence(java.lang.String)
+ */
@Override
public PresenceAdapter getPresence(String jid) throws RemoteException {
return new PresenceAdapter(mAdaptee.getPresence(jid));
}
+ /* (non-Javadoc)
+ * @see com.beem.project.beem.service.aidl.IRoster#addContactToGroup(java.lang.String, java.lang.String)
+ */
@Override
public void addContactToGroup(String groupName, String jid) throws RemoteException {
createGroup(groupName);
@@ -185,6 +234,9 @@
}
}
+ /* (non-Javadoc)
+ * @see com.beem.project.beem.service.aidl.IRoster#removeContactFromGroup(java.lang.String, java.lang.String)
+ */
@Override
public void removeContactFromGroup(String groupName, String jid) throws RemoteException {
RosterGroup group = mAdaptee.getGroup(groupName);
@@ -234,7 +286,7 @@
.getString(R.string.contact_status_msg_offline));
defaultStatusMessages.put(Status.CONTACT_STATUS_UNAVAILABLE, context.getString(R.string.contact_status_msg_xa));
- return (defaultStatusMessages);
+ return defaultStatusMessages;
}
/**
@@ -250,27 +302,6 @@
}
/**
- * Event which is fired when an entry is deleted for a group.
- * @param group the group the entry was.
- * @param jid the jid of the entry which is deleted.
- */
- @SuppressWarnings("unused")
- public void onEntryDeleteFromGroup(final String group, final String jid) {
- // Log.i(TAG, "entry delete listener");
- final int n = mRemoteRosListeners.beginBroadcast();
- for (int i = 0; i < n; i++) {
- IBeemRosterListener listener = mRemoteRosListeners.getBroadcastItem(i);
- try {
- listener.onEntryDeleteFromGroup(group, jid);
- } catch (RemoteException e) {
- Log.w(TAG, "entry delete listener", e);
- }
- }
- mRemoteRosListeners.finishBroadcast();
-
- }
-
- /**
* {@inheritDoc}
*/
@Override
@@ -297,7 +328,7 @@
*/
@Override
public void entriesDeleted(Collection<String> addresses) {
- // Log.i(TAG, "Suppression de l'entry");
+ Log.i(TAG, "Suppression de l'entry");
final int n = mRemoteRosListeners.beginBroadcast();
List<String> tab = new ArrayList<String>();
@@ -318,8 +349,8 @@
*/
@Override
public void entriesUpdated(Collection<String> addresses) {
- // Log.i(TAG, "Update de l'entry " + addresses.size() + " " +
- // addresses.toArray()[0]);
+ Log.i(TAG, "Update de l'entry " + addresses.size() + " " +
+ addresses.toArray()[0]);
final int n = mRemoteRosListeners.beginBroadcast();
List<String> tab = new ArrayList<String>();
--- a/src/com/beem/project/beem/service/XmppConnectionAdapter.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/service/XmppConnectionAdapter.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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.ConnectionConfiguration;
@@ -28,9 +71,9 @@
import com.beem.project.beem.service.aidl.IChatManager;
import com.beem.project.beem.service.aidl.IRoster;
import com.beem.project.beem.service.aidl.IXmppConnection;
+import com.beem.project.beem.ui.ChangeStatus;
import com.beem.project.beem.ui.Subscription;
import com.beem.project.beem.utils.BeemBroadcastReceiver;
-import com.beem.project.beem.ui.ChangeStatus;
import com.beem.project.beem.utils.Status;
/**
@@ -43,19 +86,21 @@
* Beem connection closed Intent name.
*/
+ private static final int SMACK_PRIORITY_MIN = -128;
+ private static final int SMACK_PRIORITY_MAX = 128;
private static final String TAG = "XMPPConnectionAdapter";
- private static final int PRESENCE_PRIORITY = 128;
-
private final XMPPConnection mAdaptee;
private IChatManager mChatManager;
private final String mLogin;
private final String mPassword;
private String mResource;
+ private String mErrorMsg;
private RosterAdapter mRoster;
private int mPreviousPriority;
private PrivacyListManagerAdapter mPrivacyListManager;
private final BeemService mService;
private final RemoteCallbackList<IBeemConnectionListener> mRemoteConnListeners = new RemoteCallbackList<IBeemConnectionListener>();
+ private final SubscribePacketListener mSubscribePacketListener = new SubscribePacketListener();
private final ConnexionListenerAdapter mConListener = new ConnexionListenerAdapter();
@@ -115,11 +160,77 @@
mRemoteConnListeners.register(listen);
}
+ @Override
+ public boolean connect() throws RemoteException {
+ if (mAdaptee.isConnected())
+ return true;
+ else {
+ try {
+ mAdaptee.connect();
+ mAdaptee.addConnectionListener(mConListener);
+ return true;
+ } catch (XMPPException e) {
+ Log.e(TAG, "Error while connecting", e);
+ if (!"".equals(e.getMessage()))
+ mErrorMsg = e.getMessage();
+ else
+ mErrorMsg = e.toString();
+ }
+ return false;
+ }
+ }
+
+ @Override
+ public boolean login() throws RemoteException {
+ if (mAdaptee.isAuthenticated())
+ return true;
+ 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() {
+
+ @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(mSubscribePacketListener, filter);
+
+ mService.resetStatus();
+ mService.initJingle(mAdaptee);
+
+ // triggerAsynchronousConnectEvent();
+ changeStatus(Status.CONTACT_STATUS_AVAILABLE, mService.getServicePreference().getString("status_text", ""));
+ return true;
+ } catch (XMPPException e) {
+ Log.e(TAG, "Error while connecting", e);
+ if (!"".equals(e.getMessage()))
+ mErrorMsg = e.getMessage();
+ else
+ mErrorMsg = e.toString();
+ return false;
+ }
+ }
+
/**
* {@inheritDoc}
*/
@Override
public final void connectAsync() throws RemoteException {
+ if (mAdaptee.isConnected() || mAdaptee.isAuthenticated())
+ return;
Thread t = new Thread(new Runnable() {
@Override
@@ -139,32 +250,8 @@
*/
@Override
public boolean connectSync() throws RemoteException {
- try {
- mAdaptee.connect();
- mAdaptee.addConnectionListener(mConListener);
- 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);
-
- triggerAsynchronousConnectEvent();
- changeStatus(Status.CONTACT_STATUS_AVAILABLE, mService.getServicePreference().getString("status_text", ""));
- return true;
- } catch (XMPPException e) {
- Log.d(TAG, "Error while connecting", e);
- if (e.getXMPPError() != null && e.getXMPPError().getMessage() != null)
- mConListener.connectionFailed(e.getXMPPError().getMessage());
- else if (e.getMessage() != null)
- mConListener.connectionFailed(e.getMessage());
- else
- mConListener.connectionFailed("Error On Connection");
- } catch (IllegalStateException e) {
- mConListener.connectionFailed(e.getMessage());
- }
+ if (connect())
+ return login();
return false;
}
@@ -183,10 +270,11 @@
Presence.Mode mode = Status.getPresenceModeFromStatus(status);
if (mode != null)
pres.setMode(mode);
- // Smack limit : Priority between -128 and 128
int p = priority;
- if (priority < -128) p = -128;
- if (priority > 128) p = 128;
+ if (priority < SMACK_PRIORITY_MIN)
+ p = SMACK_PRIORITY_MIN;
+ if (priority > SMACK_PRIORITY_MAX)
+ p = SMACK_PRIORITY_MAX;
mPreviousPriority = p;
pres.setPriority(p);
mAdaptee.sendPacket(pres);
@@ -224,10 +312,9 @@
mStatusNotification.defaults = Notification.DEFAULT_LIGHTS;
mStatusNotification.flags = Notification.FLAG_NO_CLEAR | Notification.FLAG_ONGOING_EVENT;
- mStatusNotification.setLatestEventInfo(mService, "Beem Status", text, PendingIntent.getActivity(
- mService, 0, new Intent(mService, ChangeStatus.class), 0));
+ mStatusNotification.setLatestEventInfo(mService, "Beem Status", text, PendingIntent.getActivity(mService, 0,
+ new Intent(mService, ChangeStatus.class), 0));
mService.sendNotification(BeemService.NOTIFICATION_STATUS_ID, mStatusNotification);
-
}
/**
@@ -316,7 +403,7 @@
/**
* PrivacyListManagerAdapter mutator.
- * @param privacyList the PrivacyListManager to set
+ * @param privacyListManager the privacy list manager
*/
public void setPrivacyListManager(PrivacyListManagerAdapter privacyListManager) {
this.mPrivacyListManager = privacyListManager;
@@ -331,6 +418,14 @@
}
/**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getErrorMessage() {
+ return mErrorMsg;
+ }
+
+ /**
* Listener for XMPP connection events. It will calls the remote listeners for connection events.
* @author darisk
*/
@@ -414,14 +509,15 @@
@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());
+ 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));
+ 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);
}
@@ -514,14 +610,15 @@
@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());
+ 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));
+ 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);
}
@@ -544,4 +641,38 @@
}
}
+ /**
+ * This PacketListener will set a notification when you got a subscribtion request.
+ * @author Da Risk <da_risk@elyzion.net>
+ */
+ private class SubscribePacketListener implements PacketListener {
+
+ /**
+ * Constructor.
+ */
+ public SubscribePacketListener() {
+ }
+
+ @Override
+ public void processPacket(Packet packet) {
+ if (!(packet instanceof Presence))
+ return;
+ Presence p = (Presence) packet;
+ if (p.getType() != Presence.Type.subscribe)
+ return;
+ String from = p.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 = p.hashCode();
+ mService.sendNotification(id, notif);
+ }
+ }
+
}
--- a/src/com/beem/project/beem/service/XmppFacade.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/service/XmppFacade.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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.XMPPException;
@@ -6,7 +49,6 @@
import android.os.RemoteException;
-import com.beem.project.beem.BeemService;
import com.beem.project.beem.jingle.JingleService;
import com.beem.project.beem.service.aidl.IChatManager;
import com.beem.project.beem.service.aidl.IPrivacyListManager;
@@ -22,18 +64,15 @@
public class XmppFacade extends IXmppFacade.Stub {
private final XmppConnectionAdapter mConnexion;
- private final BeemService mBeemService;
private final JingleService mJingle;
/**
* Constructor for XMPPFacade.
* @param connection the connection use by the facade
- * @param service the service which holds the facade
* @param jingle the jingle session
*/
- public XmppFacade(final XmppConnectionAdapter connection, final BeemService service, final JingleService jingle) {
+ public XmppFacade(final XmppConnectionAdapter connection, final JingleService jingle) {
this.mConnexion = connection;
- this.mBeemService = service;
this.mJingle = jingle;
}
@@ -108,11 +147,17 @@
mConnexion.getAdaptee().sendPacket(presence2);
}
+ /* (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();
--- a/src/com/beem/project/beem/service/aidl/IBeemConnectionListener.aidl Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/service/aidl/IBeemConnectionListener.aidl Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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.aidl;
/**
@@ -5,40 +48,40 @@
* @author Da Risk <barthe_f@epitech.eu>
*/
interface IBeemConnectionListener {
-
+
/**
* Callback to call when the connection is closed
*/
void connectionClosed();
-
+
/**
* Callback to call when the connection occurs
*/
void onConnect();
-
+
//void connectionClosedOnError(in Exception e);
/**
* Callback to call when the connection is closed on error
*/
void connectionClosedOnError();
-
+
/**
* Callback to call when trying to reconnecting
*/
void reconnectingIn(in int seconds);
-
+
/**
* Callback to call when the reconnection has failed
*/
void reconnectionFailed();
-
+
/**
* Callback to call when the reconnection is successfull
- */
+ */
void reconnectionSuccessful();
-
+
/**
* Callback to call when the connection Failed
- */
+ */
void connectionFailed(in String errorMsg);
}
--- a/src/com/beem/project/beem/service/aidl/IBeemRosterListener.aidl Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/service/aidl/IBeemRosterListener.aidl Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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.aidl;
import com.beem.project.beem.service.PresenceAdapter;
@@ -7,5 +50,4 @@
void onEntriesUpdated(in List<String> addresses);
void onEntriesDeleted(in List<String> addresses);
void onPresenceChanged(in PresenceAdapter presence);
- void onEntryDeleteFromGroup(in String group, in String jid);
-}
\ No newline at end of file
+}
--- a/src/com/beem/project/beem/service/aidl/IChat.aidl Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/service/aidl/IChat.aidl Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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.aidl;
import com.beem.project.beem.service.Contact;
@@ -8,27 +51,39 @@
* An aidl interface for Chat session.
*/
interface IChat {
-
+
/**
* Send a message.
* @param message the message to send
*/
void sendMessage(in Message message);
-
+
/**
* Get the participant of the chat
* @return the participant
*/
Contact getParticipant();
-
+
+ /**
+ * Add a message listener.
+ * @param listener the listener to add.
+ */
+ void addMessageListener(in IMessageListener listener);
+
+ /**
+ * Remove a message listener.
+ * @param listener the listener to remove.
+ */
+ void removeMessageListener(in IMessageListener listener);
+
String getState();
-
+
void setOpen(in boolean isOpen);
-
+
boolean isOpen();
-
+
void setState(in String state);
-
+
List<Message> getMessages();
-}
\ No newline at end of file
+}
--- a/src/com/beem/project/beem/service/aidl/IChatManager.aidl Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/service/aidl/IChatManager.aidl Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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.aidl;
import com.beem.project.beem.service.Contact;
@@ -10,9 +53,7 @@
* The chat manager will manage all the chat sessions.
*/
interface IChatManager {
-
- //IChat createChat(in String jid, in IMessageListener listener);
-
+
/**
* Create a chat session with a contact.
* @param contact the contact to chat with
@@ -20,13 +61,13 @@
* @return the chat session
*/
IChat createChat(in Contact contact, in IMessageListener listener);
-
+
/**
* Destroy a chat session with a contact.
* @param chat the chat session
*/
void destroyChat(in IChat chat);
-
+
/**
* @param chat the chat.
*/
@@ -37,7 +78,7 @@
* @param listener the callback to add
*/
void addChatCreationListener(in IChatManagerListener listener);
-
+
/**
* Remove a callback for the creation of new chat session.
* @param listener the callback to remove.
--- a/src/com/beem/project/beem/service/aidl/IChatManagerListener.aidl Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/service/aidl/IChatManagerListener.aidl Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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.aidl;
import com.beem.project.beem.service.aidl.IChat;
@@ -7,12 +50,12 @@
* This listener will execute on events like creation of chat session.
*/
interface IChatManagerListener {
-
+
/**
* Call when a new chat session is created.
* @param chat the created chat session
* @param locally true if the session is create by a chat manager.
*/
void chatCreated(IChat chat, boolean locally);
-
-}
\ No newline at end of file
+
+}
--- a/src/com/beem/project/beem/service/aidl/IContact.aidl Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/service/aidl/IContact.aidl Fri Jan 15 12:02:29 2010 +0100
@@ -1,9 +1,53 @@
+/*
+ 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.aidl;
interface IContact {
String getJID();
-
+
void setJID(String mjid);
-}
\ No newline at end of file
+}
+
--- a/src/com/beem/project/beem/service/aidl/IMessageListener.aidl Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/service/aidl/IMessageListener.aidl Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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.aidl;
import com.beem.project.beem.service.Message;
@@ -6,7 +49,7 @@
interface IMessageListener {
void processMessage(in IChat chat, in Message msg);
-
+
/**
* le chatState se trouve dans le IChat
*/
--- a/src/com/beem/project/beem/service/aidl/IPrivacyListListener.aidl Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/service/aidl/IPrivacyListListener.aidl Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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.aidl;
import com.beem.project.beem.service.PrivacyListItem;
--- a/src/com/beem/project/beem/service/aidl/IPrivacyListManager.aidl Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/service/aidl/IPrivacyListManager.aidl Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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.aidl;
import com.beem.project.beem.service.PrivacyListItem;
@@ -19,4 +62,5 @@
List<String> getBlockedGroupsByList(in String listName);
void addPrivacyListListener(in IPrivacyListListener listener);
void removePrivacyListListener(in IPrivacyListListener listener);
-}
\ No newline at end of file
+}
+
--- a/src/com/beem/project/beem/service/aidl/IRoster.aidl Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/service/aidl/IRoster.aidl Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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.aidl;
import com.beem.project.beem.service.aidl.IBeemRosterListener;
@@ -5,27 +48,27 @@
import com.beem.project.beem.service.PresenceAdapter;
interface IRoster {
-
+
Contact addContact(in String user, in String name, in String[] groups);
-
+
void deleteContact(in Contact contact);
-
+
Contact getContact(in String jid);
void setContactName(in String jid, in String name);
-
+
void createGroup(in String groupname);
-
+
void addContactToGroup(in String groupName, in String jid);
-
+
void removeContactFromGroup(in String groupName, in String jid);
-
+
List<Contact> getContactList();
-
+
List<String> getGroupsNames();
-
+
PresenceAdapter getPresence(in String jid);
-
+
void addRosterListener(in IBeemRosterListener listen);
void removeRosterListener(in IBeemRosterListener listen);
-}
\ No newline at end of file
+}
--- a/src/com/beem/project/beem/service/aidl/IXmppConnection.aidl Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/service/aidl/IXmppConnection.aidl Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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.aidl;
import com.beem.project.beem.service.aidl.IRoster;
@@ -7,6 +50,10 @@
interface IXmppConnection {
+ boolean connect();
+
+ boolean login();
+
boolean connectSync();
void connectAsync();
@@ -27,4 +74,6 @@
void changeStatus(in int status, in String msg);
IPrivacyListManager getPrivacyListManager();
+
+ String getErrorMessage();
}
--- a/src/com/beem/project/beem/service/aidl/IXmppFacade.aidl Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/service/aidl/IXmppFacade.aidl Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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.aidl;
import com.beem.project.beem.service.aidl.IXmppConnection;
@@ -12,22 +55,22 @@
* Get the XmppConnection of the facade.
*/
IXmppConnection createConnection();
-
+
/**
* Get the roster of the user
- */
+ */
IRoster getRoster();
-
+
/**
* Connect and login synchronously on the server.
*/
void connectSync();
-
+
/**
* Connect and login asynchronously on the server.
*/
void connectAsync();
-
+
/**
* Disconnect from the server
*/
@@ -37,14 +80,14 @@
* Get the chat manager.
*/
IChatManager getChatManager();
-
+
/**
* Change the status of the user.
* @param status the status to set
* @param msg the message state to set
*/
void changeStatus(in int status, in String msg);
-
+
void sendPresencePacket(in PresenceAdapter presence);
/**
@@ -52,12 +95,12 @@
* @param jid the receiver id
*/
void call(in String jid);
-
- /**
- * get the user vcard avatar
- * @param jid the user jid
- */
- byte[] getVcardAvatar(in String jid);
-
- IPrivacyListManager getPrivacyListManager();
+
+ /**
+ * get the user vcard avatar
+ * @param jid the user jid
+ */
+ byte[] getVcardAvatar(in String jid);
+
+ IPrivacyListManager getPrivacyListManager();
}
--- a/src/com/beem/project/beem/service/package-info.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/service/package-info.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,5 +1,47 @@
+/*
+ BEEM is a videoconference application on the Android Platform.
+
+ Copyright (C) 2009 by Frederic-Charles Barthelery,
+ Jean-Manuel Da Silva,
+ Nikita Kozlov,
+ Philippe Lago,
+ Jean Baptiste Vergely,
+ Vincent Veronis.
+
+ This file is part of BEEM.
+
+ BEEM is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ BEEM is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with BEEM. If not, see <http://www.gnu.org/licenses/>.
+
+ Please send bug reports with examples or suggestions to
+ contact@beem-project.com or http://dev.beem-project.com/
+
+ Epitech, hereby disclaims all copyright interest in the program "Beem"
+ written by Frederic-Charles Barthelery,
+ Jean-Manuel Da Silva,
+ Nikita Kozlov,
+ Philippe Lago,
+ Jean Baptiste Vergely,
+ Vincent Veronis.
+
+ Nicolas Sadirac, November 26, 2009
+ President of Epitech.
+
+ Flavien Astraud, November 26, 2009
+ Head of the EIP Laboratory.
+*/
/**
- * This package contains the class used by the Beem service process.
+ * This package contains all the class use by the service.
*/
package com.beem.project.beem.service;
--- a/src/com/beem/project/beem/ui/AddContact.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/ui/AddContact.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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;
import java.util.ArrayList;
@@ -35,7 +78,8 @@
private final List<String> mGroup = new ArrayList<String>();
private IXmppFacade mXmppFacade;
private final ServiceConnection mServConn = new BeemServiceConnection();
- private BeemBroadcastReceiver mReceiver;
+ private final BeemBroadcastReceiver mReceiver = new BeemBroadcastReceiver();
+ private final OkListener mOkListener = new OkListener();
static {
SERVICE_INTENT.setComponent(new ComponentName("com.beem.project.beem", "com.beem.project.beem.BeemService"));
@@ -56,13 +100,15 @@
setContentView(R.layout.addcontact);
Button ok = (Button) findViewById(R.id.addc_ok);
ok.setOnClickListener(mOkListener);
- mReceiver = new BeemBroadcastReceiver(mServConn);
+ this.registerReceiver(mReceiver, new IntentFilter(BeemBroadcastReceiver.BEEM_CONNECTION_CLOSED));
}
+ /* (non-Javadoc)
+ * @see android.app.Activity#onStart()
+ */
@Override
protected void onStart() {
super.onStart();
- this.registerReceiver(mReceiver, new IntentFilter(BeemBroadcastReceiver.BEEM_CONNECTION_CLOSED));
}
/**
@@ -71,9 +117,7 @@
@Override
protected void onResume() {
super.onResume();
- this.registerReceiver(mReceiver, new IntentFilter(BeemBroadcastReceiver.BEEM_CONNECTION_CLOSED));
bindService(new Intent(this, BeemService.class), mServConn, BIND_AUTO_CREATE);
- mReceiver.setBinded(true);
}
/**
@@ -82,12 +126,12 @@
@Override
protected void onPause() {
super.onPause();
- if (mReceiver.isBinded()) {
- unbindService(mServConn);
- mReceiver.setBinded(false);
- }
+ unbindService(mServConn);
}
+ /* (non-Javadoc)
+ * @see android.app.Activity#onDestroy()
+ */
@Override
protected void onDestroy() {
super.onDestroy();
@@ -108,7 +152,6 @@
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
mXmppFacade = IXmppFacade.Stub.asInterface(service);
- mReceiver.setBinded(true);
}
@Override
@@ -127,8 +170,17 @@
return widget.getText().toString();
}
- private final OnClickListener mOkListener = new OnClickListener() {
+ /**
+ * Listener.
+ */
+ private class OkListener implements OnClickListener {
+ /**
+ * Constructor.
+ */
+ public OkListener() { }
+
+ @Override
public void onClick(View v) {
String login;
login = getWidgetText(R.id.addc_login);
@@ -148,9 +200,8 @@
mGroup.add(getWidgetText(R.id.addc_group));
try {
if (mXmppFacade != null) {
- if (mXmppFacade.getRoster().getContact(login) != null)
+ if (mXmppFacade.getRoster().getContact(login) != null) {
mGroup.addAll(mXmppFacade.getRoster().getContact(login).getGroups());
- if (mXmppFacade.getRoster().getContact(login) != null) {
Toast.makeText(AddContact.this, getString(R.string.AddCContactAlready), Toast.LENGTH_SHORT)
.show();
return;
--- a/src/com/beem/project/beem/ui/ChangeStatus.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/ui/ChangeStatus.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,47 @@
+/*
+ BEEM is a videoconference application on the Android Platform.
+
+ Copyright (C) 2009 by Frederic-Charles Barthelery,
+ Jean-Manuel Da Silva,
+ Nikita Kozlov,
+ Philippe Lago,
+ Jean Baptiste Vergely,
+ Vincent Veronis.
+
+ This file is part of BEEM.
+
+ BEEM is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ BEEM is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with BEEM. If not, see <http://www.gnu.org/licenses/>.
+
+ Please send bug reports with examples or suggestions to
+ contact@beem-project.com or http://dev.beem-project.com/
+
+ Epitech, hereby disclaims all copyright interest in the program "Beem"
+ written by Frederic-Charles Barthelery,
+ Jean-Manuel Da Silva,
+ Nikita Kozlov,
+ Philippe Lago,
+ Jean Baptiste Vergely,
+ Vincent Veronis.
+
+ Nicolas Sadirac, November 26, 2009
+ President of Epitech.
+
+ Flavien Astraud, November 26, 2009
+ Head of the EIP Laboratory.
+
+*/
+
package com.beem.project.beem.ui;
import android.app.Activity;
@@ -24,6 +68,7 @@
import com.beem.project.beem.R;
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;
/**
@@ -48,6 +93,7 @@
private Toast mToast;
private Button mOk;
private Button mClear;
+ private Button mContact;
private Spinner mSpinner;
private SharedPreferences mSettings;
@@ -55,7 +101,7 @@
private IXmppFacade mXmppFacade;
private final ServiceConnection mServConn = new BeemServiceConnection();
private final OnClickListener mOnClickOk = new MyOnClickListener();
- private BeemBroadcastReceiver mReceiver;
+ private final BeemBroadcastReceiver mReceiver = new BeemBroadcastReceiver();
/**
* Constructor.
@@ -78,6 +124,9 @@
mClear = (Button) findViewById(R.id.ChangeStatusClear);
mClear.setOnClickListener(mOnClickOk);
+ mContact = (Button) findViewById(R.id.OpenContactList);
+ mContact.setOnClickListener(mOnClickOk);
+
mSettings = PreferenceManager.getDefaultSharedPreferences(this);
mStatusMessageEditText = (EditText) findViewById(R.id.ChangeStatusMessage);
mStatusMessageEditText.setText(getPreferenceString(R.string.PreferenceStatusText));
@@ -90,7 +139,6 @@
mToast = Toast.makeText(this, R.string.ChangeStatusOk, Toast.LENGTH_LONG);
mSpinner.setSelection(getPreferenceStatusIndex());
- mReceiver = new BeemBroadcastReceiver(mServConn);
this.registerReceiver(mReceiver, new IntentFilter(BeemBroadcastReceiver.BEEM_CONNECTION_CLOSED));
}
@@ -100,8 +148,12 @@
@Override
protected void onResume() {
super.onResume();
+ if (!BeemConnectivity.isConnected(getApplicationContext())) {
+ Intent i = new Intent(this, Login.class);
+ startActivity(i);
+ finish();
+ }
bindService(new Intent(this, BeemService.class), mServConn, BIND_AUTO_CREATE);
- mReceiver.setBinded(true);
}
/**
@@ -111,12 +163,12 @@
protected void onPause() {
super.onPause();
Log.d("TAG", "pause");
- if (mReceiver.isBinded()) {
- unbindService(mServConn);
- mReceiver.setBinded(false);
- }
+ unbindService(mServConn);
}
+ /* (non-Javadoc)
+ * @see android.app.Activity#onDestroy()
+ */
@Override
protected void onDestroy() {
super.onDestroy();
@@ -128,7 +180,7 @@
* @return the status index from status the settings.
*/
private int getPreferenceStatusIndex() {
- return mSettings.getInt(getString(R.string.PreferenceStatus), 0);
+ return mSettings.getInt("PreferenceStatus", 0);
}
/**
@@ -146,22 +198,31 @@
* @return item position in the array.
*/
private int getStatusForService(String item) {
+ int result;
switch (mAdapter.getPosition(item)) {
case ChangeStatus.DISCONNECTED_IDX:
- return Status.CONTACT_STATUS_DISCONNECT;
+ result = Status.CONTACT_STATUS_DISCONNECT;
+ break;
case ChangeStatus.AVAILABLE_FOR_CHAT_IDX:
- return Status.CONTACT_STATUS_AVAILABLE_FOR_CHAT;
+ result = Status.CONTACT_STATUS_AVAILABLE_FOR_CHAT;
+ break;
case ChangeStatus.AVAILABLE_IDX:
- return Status.CONTACT_STATUS_AVAILABLE;
+ result = Status.CONTACT_STATUS_AVAILABLE;
+ break;
case ChangeStatus.AWAY_IDX:
- return Status.CONTACT_STATUS_AWAY;
+ result = Status.CONTACT_STATUS_AWAY;
+ break;
case ChangeStatus.BUSY_IDX:
- return Status.CONTACT_STATUS_BUSY;
+ result = Status.CONTACT_STATUS_BUSY;
+ break;
case ChangeStatus.UNAVAILABLE_IDX:
- return Status.CONTACT_STATUS_UNAVAILABLE;
+ result = Status.CONTACT_STATUS_UNAVAILABLE;
+ break;
default:
- return Status.CONTACT_STATUS_AVAILABLE;
+ result = Status.CONTACT_STATUS_AVAILABLE;
+ break;
}
+ return result;
}
/**
@@ -231,6 +292,8 @@
ChangeStatus.this.finish();
} else if (v == mClear) {
mStatusMessageEditText.setText(null);
+ } else if (v == mContact) {
+ startActivity(new Intent(ChangeStatus.this, ContactList.class));
}
}
}
--- a/src/com/beem/project/beem/ui/Chat.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/ui/Chat.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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;
import java.util.ArrayList;
@@ -41,7 +84,6 @@
import android.widget.ListView;
import android.widget.TextView;
-import com.beem.project.beem.BeemService;
import com.beem.project.beem.R;
import com.beem.project.beem.service.Contact;
import com.beem.project.beem.service.Message;
@@ -49,7 +91,6 @@
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;
@@ -67,7 +108,7 @@
static {
SERVICE_INTENT.setComponent(new ComponentName("com.beem.project.beem", "com.beem.project.beem.BeemService"));
}
- private Handler mHandler;
+ private Handler mHandler = new Handler();
private IRoster mRoster;
private Contact mContact;
@@ -84,12 +125,13 @@
private IChat mChat;
private IChatManager mChatManager;
- private IChatManagerListener mChatManagerListener;
- private IMessageListener mMessageListener;
- private MessagesListAdapter mMessagesListAdapter;
+ private final IMessageListener mMessageListener = new OnMessageListener();
+ private MessagesListAdapter mMessagesListAdapter = new MessagesListAdapter();
private final ServiceConnection mConn = new BeemServiceConnection();
- private BeemBroadcastReceiver mBroadcastReceiver;
+ private final BeemBroadcastReceiver mBroadcastReceiver = new BeemBroadcastReceiver();
+ private final BeemRosterListener mBeemRosterListener = new BeemRosterListener();
+ private IXmppFacade mXmppFacade;
/**
* Constructor.
@@ -104,18 +146,7 @@
@Override
protected void onCreate(Bundle savedBundle) {
super.onCreate(savedBundle);
-
- Log.v(TAG, "BEGIN onCreate.");
setContentView(R.layout.chat);
- mMessagesListAdapter = new MessagesListAdapter(this);
-
- mHandler = new Handler();
-
- // Listeners
- mMessageListener = new OnMessageListener();
- mChatManagerListener = new OnChatManagerListener();
-
- mBroadcastReceiver = new BeemBroadcastReceiver(mConn);
this.registerReceiver(mBroadcastReceiver, new IntentFilter(BeemBroadcastReceiver.BEEM_CONNECTION_CLOSED));
// UI
@@ -135,8 +166,13 @@
});
prepareIconsStatus();
+ }
- Log.v(TAG, "END onCreate.");
+ @Override
+ protected void onResume() {
+ super.onResume();
+ if (mXmppFacade == null)
+ bindService(SERVICE_INTENT, mConn, BIND_AUTO_CREATE);
}
/**
@@ -145,58 +181,7 @@
@Override
protected void onDestroy() {
super.onDestroy();
-
- Log.v(TAG, "BEGIN onDestroy.");
this.unregisterReceiver(mBroadcastReceiver);
- if (mChatManager != null) {
- try {
- mChatManager.removeChatCreationListener(mChatManagerListener);
- } catch (RemoteException e) {
- Log.e(TAG, e.getMessage());
- }
- }
- Log.v(TAG, "END onDestroy.");
- }
-
- /**
- * {@inheritDoc}.
- */
- @Override
- protected void onStart() {
- super.onStart();
-
- Log.v(TAG, "BEGIN onStart.");
- bindService(new Intent(this, BeemService.class), mConn, BIND_AUTO_CREATE);
- Log.v(TAG, "END onStart.");
- }
-
- /**
- * {@inheritDoc}.
- */
- @Override
- protected void onStop() {
- super.onStop();
-
- Log.v(TAG, "BEGIN onStop.");
- if (mChat != null) {
- try {
- mChat.setOpen(false);
- } catch (RemoteException e) {
- Log.e(TAG, e.getMessage());
- }
- }
- if (mBroadcastReceiver.isBinded()) {
- unbindService(mConn);
- }
- Log.v(TAG, "END onStop.");
- }
-
- /**
- * {@inheritDoc}.
- */
- @Override
- protected void onResume() {
- super.onResume();
}
/**
@@ -205,6 +190,21 @@
@Override
protected void onPause() {
super.onPause();
+ try {
+ if (mChat != null) {
+ mChat.setOpen(false);
+ mChat.removeMessageListener(mMessageListener);
+ }
+ if (mRoster != null)
+ mRoster.removeRosterListener(mBeemRosterListener);
+ } catch (RemoteException e) {
+ Log.e(TAG, e.getMessage());
+ }
+ unbindService(mConn);
+ mXmppFacade = null;
+ mRoster = null;
+ mChat = null;
+ mChatManager = null;
}
/**
@@ -213,15 +213,7 @@
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
-
- Log.v(TAG, "BEGIN onNewIntent.");
- try {
- mContact = new Contact(intent.getData());
- changeCurrentChat(mContact);
- } catch (RemoteException e) {
- Log.e(TAG, e.getMessage());
- }
- Log.v(TAG, "END onNewIntent.");
+ setIntent(intent);
}
/**
@@ -248,7 +240,6 @@
@Override
public final boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
-
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.chat, menu);
return true;
@@ -264,11 +255,10 @@
Intent contactListIntent = new Intent(this, ContactList.class);
contactListIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(contactListIntent);
- return true;
+ break;
case R.id.chat_menu_change_chat:
try {
final List<Contact> openedChats = mChatManager.getOpenedChatList();
-
if (openedChats.size() > 0)
createChatSwitcherDialog(openedChats);
else
@@ -276,7 +266,7 @@
} catch (RemoteException e) {
Log.e(TAG, e.getMessage());
}
- return true;
+ break;
case R.id.chat_menu_close_chat:
try {
mChatManager.destroyChat(mChat);
@@ -284,10 +274,11 @@
Log.e(TAG, e.getMessage());
}
this.finish();
- return true;
+ break;
default:
return false;
}
+ return true;
}
/**
@@ -331,20 +322,21 @@
* @throws RemoteException If a Binder remote-invocation error occurred.
*/
private void changeCurrentChat(Contact contact) throws RemoteException {
- Log.v(TAG, "BEGIN changeCurrentChat.");
- if (mChat != null)
+ if (mChat != null) {
mChat.setOpen(false);
+ mChat.removeMessageListener(mMessageListener);
+ }
mChat = mChatManager.createChat(contact, mMessageListener);
mChat.setOpen(true);
-
mChatManager.deleteChatNotification(mChat);
+ // TODO thecontact isnotnecesarrely ubn the roseter.
+ // this can leadtoa null exception
mContact = mRoster.getContact(contact.getJID());
updateContactInformations();
updateContactStatusIcon();
playRegisteredTranscript();
- Log.v(TAG, "END changeCurrentChat.");
}
/**
@@ -355,35 +347,27 @@
String fromBareJid = null;
String fromName = null;
List<Message> chatMessages = mChat.getMessages();
+ mListMessages.clear();
+ mMessagesListAdapter.notifyDataSetChanged();
+ MessageText lastMessage = null;
- Log.v(TAG, "BEGIN playRegisteredTranscript.");
- mListMessages.clear();
- if (chatMessages.size() > 0) {
- MessageText lastMessage = null;
- for (Message m : chatMessages) {
- fromBareJid = StringUtils.parseBareAddress(m.getFrom());
- fromName = mContact.getName();
-
- if (fromBareJid == null) {
- fromBareJid = getString(R.string.chat_self);
- fromName = getString(R.string.chat_self);
+ for (Message m : chatMessages) {
+ fromBareJid = StringUtils.parseBareAddress(m.getFrom());
+ fromName = mContact.getName();
+ if (fromBareJid == null) {
+ fromBareJid = getString(R.string.chat_self);
+ fromName = getString(R.string.chat_self);
+ }
+ if (m.getBody() != null) {
+ if (lastMessage == null || !lastMessage.getBareJid().equals(fromBareJid)) {
+ lastMessage = new MessageText(fromBareJid, fromName, m.getBody());
+ mListMessages.add(lastMessage);
+ } else {
+ lastMessage.setMessage(lastMessage.getMessage().concat("\n" + m.getBody()));
}
-
- if (lastMessage == null) {
- lastMessage = new MessageText(fromBareJid, fromName, m.getBody());
- continue;
- }
-
- if (!lastMessage.getBareJid().equals(fromBareJid)) {
- mListMessages.add(lastMessage);
- lastMessage = new MessageText(fromBareJid, fromName, m.getBody());
- } else
- lastMessage.setMessage(lastMessage.getMessage().concat("\n" + m.getBody()));
}
- mListMessages.add(lastMessage);
}
mMessagesListAdapter.notifyDataSetChanged();
- Log.v(TAG, "END playRegisteredTranscript.");
}
/**
@@ -391,27 +375,26 @@
*/
private final class BeemServiceConnection implements ServiceConnection {
- private IXmppFacade mXmppFacade;
- private final BeemRosterListener mBeemRosterListener = new BeemRosterListener();
+ /**
+ * Constructor.
+ */
+ public BeemServiceConnection() { }
/**
* {@inheritDoc}.
*/
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
- Log.v(TAG, "BEGIN onServiceConnected.");
mXmppFacade = IXmppFacade.Stub.asInterface(service);
- mBroadcastReceiver.setBinded(true);
try {
- mChatManager = mXmppFacade.getChatManager();
- mRoster = mXmppFacade.getRoster();
- mRoster.addRosterListener(mBeemRosterListener);
+ if ((mRoster = mXmppFacade.getRoster()) != null )
+ mRoster.addRosterListener(mBeemRosterListener);
mContact = new Contact(getIntent().getData());
- changeCurrentChat(mContact);
+ if ((mChatManager = mXmppFacade.getChatManager()) != null)
+ changeCurrentChat(mContact);
} catch (RemoteException e) {
Log.e(TAG, e.getMessage());
}
- Log.v(TAG, "END onServiceConnected.");
}
/**
@@ -419,15 +402,12 @@
*/
@Override
public void onServiceDisconnected(ComponentName name) {
- Log.v(TAG, "BEGIN onServiceDisconnected.");
mXmppFacade = null;
- mBroadcastReceiver.setBinded(false);
try {
mRoster.removeRosterListener(mBeemRosterListener);
} catch (RemoteException e) {
Log.e(TAG, e.getMessage());
}
- Log.v(TAG, "END onServiceDisconnected.");
}
}
@@ -437,12 +417,16 @@
private class BeemRosterListener extends IBeemRosterListener.Stub {
/**
+ * Constructor.
+ */
+ public BeemRosterListener() {
+ }
+
+ /**
* {@inheritDoc}.
*/
@Override
public void onEntriesAdded(List<String> addresses) throws RemoteException {
- Log.v(TAG, "BEGIN onEntriesAdded.");
- Log.v(TAG, "END onEntriesAdded.");
}
/**
@@ -450,8 +434,6 @@
*/
@Override
public void onEntriesDeleted(List<String> addresses) throws RemoteException {
- Log.v(TAG, "BEGIN onEntriesDeleted.");
- Log.v(TAG, "END onEntriesDeleted.");
}
/**
@@ -459,17 +441,6 @@
*/
@Override
public void onEntriesUpdated(List<String> addresses) throws RemoteException {
- Log.v(TAG, "BEGIN onEntriesUpdated.");
- Log.v(TAG, "END onEntriesUpdated.");
- }
-
- /**
- * {@inheritDoc}.
- */
- @Override
- public void onEntryDeleteFromGroup(String group, String jid) throws RemoteException {
- Log.v(TAG, "BEGIN onEntryDeleteFromGroup.");
- Log.v(TAG, "END onEntryDeleteFromGroup.");
}
/**
@@ -477,20 +448,17 @@
*/
@Override
public void onPresenceChanged(final PresenceAdapter presence) throws RemoteException {
- Log.v(TAG, "BEGIN onPresenceChanged.");
if (mContact.getJID().equals(StringUtils.parseBareAddress(presence.getFrom()))) {
mHandler.post(new Runnable() {
@Override
public void run() {
mContact.setStatus(presence.getStatus());
mContact.setMsgState(presence.getStatusText());
-
updateContactInformations();
updateContactStatusIcon();
}
});
}
- Log.v(TAG, "END onPresenceChanged.");
}
}
@@ -500,22 +468,24 @@
private class OnMessageListener extends IMessageListener.Stub {
/**
+ * Constructor.
+ */
+ public OnMessageListener() {
+ }
+
+ /**
* {@inheritDoc}.
*/
@Override
public void processMessage(IChat chat, final Message msg) throws RemoteException {
- Log.v(TAG, "BEGIN processMessage.");
-
final String fromBareJid = StringUtils.parseBareAddress(msg.getFrom());
if (mContact.getJID().equals(fromBareJid)) {
mHandler.post(new Runnable() {
- /**
- * {@inheritDoc}.
- */
@Override
public void run() {
+ //TODO gerer les messages de types error
if (msg.getBody() != null && msg.getType() != Message.MSG_TYPE_ERROR) {
MessageText lastMessage = mListMessages.size() != 0 ? mListMessages.get(mListMessages
.size() - 1) : null;
@@ -523,14 +493,13 @@
if (lastMessage != null && lastMessage.getBareJid().equals(fromBareJid)) {
lastMessage.setMessage(lastMessage.getMessage().concat("\n" + msg.getBody()));
mListMessages.set(mListMessages.size() - 1, lastMessage);
- } else
+ } else if (msg.getBody() != null)
mListMessages.add(new MessageText(fromBareJid, mContact.getName(), msg.getBody()));
mMessagesListAdapter.notifyDataSetChanged();
}
}
});
}
- Log.v(TAG, "END processMessage.");
}
/**
@@ -538,38 +507,7 @@
*/
@Override
public void stateChanged(IChat chat) throws RemoteException {
- Log.v(TAG, "BEGIN stateChanged.");
- mHandler.post(new Runnable() {
-
- /**
- * {@inheritDoc}.
- */
- @Override
- public void run() {
- }
- });
- Log.v(TAG, "END stateChanged.");
- }
- }
-
- /**
- * This class serve to listen on ChatManager events.
- * @author Jean-Manuel Da Silva <dasilvj at beem-project dot com>
- */
- private class OnChatManagerListener extends IChatManagerListener.Stub {
- /**
- * Constructor.
- */
- public OnChatManagerListener() {
- Log.v(TAG, "OnChatManagerListener constructor.");
- }
-
- /**
- * {@inheritDoc}.
- */
- @Override
- public void chatCreated(IChat chat, boolean locally) throws RemoteException {
- Log.i(TAG, "Chat has been created.");
+ //TODO
}
}
@@ -577,7 +515,6 @@
* Update the contact informations.
*/
private void updateContactInformations() {
- Log.v(TAG, "BEGIN updateContactInformations.");
// Check for a contact name update
if (!(mContactNameTextView.getText().toString().equals(mContact.getName())))
mContactNameTextView.setText(mContact.getName());
@@ -588,16 +525,13 @@
mContactStatusMsgTextView.setText(mContact.getMsgState());
Linkify.addLinks(mContactStatusMsgTextView, Linkify.WEB_URLS);
}
- Log.v(TAG, "END updateContactInformations.");
}
/**
* Update the contact status icon.
*/
private void updateContactStatusIcon() {
- Log.v(TAG, "BEGIN updateContactStatusIcon.");
mContactStatusIcon.setImageBitmap(mStatusIconsMap.get(mContact.getStatus()));
- Log.v(TAG, "END updateContactStatusIcon.");
}
/**
@@ -605,15 +539,15 @@
*/
private void prepareIconsStatus() {
mStatusIconsMap.put(Status.CONTACT_STATUS_AVAILABLE, BitmapFactory.decodeResource(getResources(),
- R.drawable.status_available));
+ android.R.drawable.presence_online));
mStatusIconsMap.put(Status.CONTACT_STATUS_AVAILABLE_FOR_CHAT, BitmapFactory.decodeResource(getResources(),
- R.drawable.status_available));
+ android.R.drawable.presence_online));
mStatusIconsMap.put(Status.CONTACT_STATUS_AWAY, BitmapFactory.decodeResource(getResources(),
- R.drawable.status_away));
+ android.R.drawable.presence_away));
mStatusIconsMap.put(Status.CONTACT_STATUS_BUSY, BitmapFactory.decodeResource(getResources(),
- R.drawable.status_dnd));
+ android.R.drawable.presence_busy));
mStatusIconsMap.put(Status.CONTACT_STATUS_DISCONNECT, BitmapFactory.decodeResource(getResources(),
- R.drawable.status_offline));
+ android.R.drawable.presence_offline));
mStatusIconsMap.put(Status.CONTACT_STATUS_UNAVAILABLE, BitmapFactory.decodeResource(getResources(),
R.drawable.status_requested));
}
@@ -623,14 +557,10 @@
*/
private class MessagesListAdapter extends BaseAdapter {
- private final Context mContext;
-
/**
* Constructor.
- * @param context The MessagesListAdapter context.
*/
- public MessagesListAdapter(final Context context) {
- mContext = context;
+ public MessagesListAdapter() {
}
/**
@@ -669,7 +599,7 @@
public View getView(int position, View convertView, ViewGroup parent) {
MessageView sv;
if (convertView == null) {
- sv = new MessageView(mContext, mListMessages.get(position).getName(), mListMessages.get(position)
+ sv = new MessageView(Chat.this, mListMessages.get(position).getName(), mListMessages.get(position)
.getMessage());
} else {
sv = (MessageView) convertView;
@@ -677,6 +607,7 @@
sv.setMessage(mListMessages.get(position).getMessage());
}
+ //TODO Put this in the xml layout
sv.setPadding(2, 2, 2, 4);
sv.mName.setTextSize(16);
@@ -765,6 +696,7 @@
/**
* We will use a MessageView to display each message.
+ * TODO : put this in an xml file
*/
private class MessageView extends LinearLayout {
private final TextView mName;
@@ -783,11 +715,15 @@
mName = new TextView(context);
mName.setText(name);
- addView(mName, new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
+ addView(mName,
+ new LinearLayout.LayoutParams(android.view.ViewGroup.LayoutParams.FILL_PARENT,
+ android.view.ViewGroup.LayoutParams.WRAP_CONTENT));
mMessage = new TextView(context);
mMessage.setText(message);
- addView(mMessage, new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
+ addView(mMessage,
+ new LinearLayout.LayoutParams(android.view.ViewGroup.LayoutParams.FILL_PARENT,
+ android.view.ViewGroup.LayoutParams.WRAP_CONTENT));
}
/**
@@ -812,7 +748,6 @@
*/
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
- Log.d(TAG, "KeyEvent = " + event.getAction());
if (event.getAction() == KeyEvent.ACTION_DOWN) {
switch (keyCode) {
case KeyEvent.KEYCODE_ENTER:
@@ -831,7 +766,6 @@
private void sendMessage() {
final String inputContent = mInputField.getText().toString();
- Log.v(TAG, "BEGIN sendMessage.");
if (!"".equals(inputContent)) {
Message msgToSend = new Message(mContact.getJID(), Message.MSG_TYPE_CHAT);
msgToSend.setBody(inputContent);
@@ -853,6 +787,10 @@
mMessagesListAdapter.notifyDataSetChanged();
mInputField.setText(null);
}
- Log.v(TAG, "END sendMessage.");
+ }
+
+ @Override
+ protected void finalize() {
+ Log.e("CHATFIN", "FINALIZE");
}
}
--- a/src/com/beem/project/beem/ui/ContactDialog.java Fri Jan 15 11:58:04 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,161 +0,0 @@
-package com.beem.project.beem.ui;
-
-import android.app.Activity;
-import android.app.Dialog;
-import android.app.Service;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.content.ServiceConnection;
-import android.os.IBinder;
-import android.os.RemoteException;
-import android.util.Log;
-import android.view.View;
-import android.widget.Button;
-
-import com.beem.project.beem.R;
-import com.beem.project.beem.service.Contact;
-import com.beem.project.beem.service.aidl.IXmppFacade;
-
-/**
- * This activity class provides the view to show dialog when long click on contact list.
- * @author marseille
- */
-public class ContactDialog extends Dialog {
-
- private static final Intent SERVICE_INTENT = new Intent();
- private final Contact mContact;
- private final Context mContext;
- private IXmppFacade mXmppFacade;
- private final ServiceConnection mServConn = new BeemServiceConnection();
-
- static {
- SERVICE_INTENT.setComponent(new ComponentName("com.beem.project.beem", "com.beem.project.beem.BeemService"));
- }
-
- /**
- * Constructor.
- * @param context context where is call the dialog.
- * @param curContact current contact.
- */
- public ContactDialog(final Context context, final Contact curContact) {
- super(context);
- mContext = context;
-
- setContentView(R.layout.contactdialog);
- mContact = curContact;
- setTitle(curContact.getJID());
-
- Button button = (Button) findViewById(R.id.CDChat);
- button.setOnClickListener(new ChatListener());
- button = (Button) findViewById(R.id.CDInfos);
- button.setOnClickListener(new InfosListener());
- button = (Button) findViewById(R.id.CDCall);
- button.setOnClickListener(new CallListener());
- mContext.bindService(SERVICE_INTENT, mServConn, Service.BIND_AUTO_CREATE);
- }
-
- @Override
- protected void onStop() {
- // TODO Auto-generated method stub
- super.onStop();
- mContext.unbindService(mServConn);
- }
-
- @Override
- public void dismiss() {
- super.dismiss();
-
- }
-
- /**
- * Event simple click on call button.
- */
- class CallListener implements View.OnClickListener {
-
- /**
- * Constructor.
- */
- public CallListener() {
- }
-
- @Override
- public void onClick(View v) {
- try {
- // TODO permettre a l'user de choisir a quel ressource il veut
- // faire le call.
- mXmppFacade.call(mContact.getJID() + "/Beem");
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- }
- }
-
- /**
- * Event simple click on chat button.
- */
- class ChatListener implements View.OnClickListener {
-
- /**
- * Constructor.
- */
- public ChatListener() {
- }
-
- @Override
- public void onClick(View v) {
- Activity a = ContactDialog.this.getOwnerActivity();
- Intent i = new Intent(mContext, Chat.class);
- i.setData(mContact.toUri());
- a.startActivity(i);
- dismiss();
- }
-
- }
-
- /**
- * Event simple click on info button.
- */
- class InfosListener implements View.OnClickListener {
-
- /**
- * Constructor.
- */
- public InfosListener() {
- }
-
- @Override
- public void onClick(View v) {
- Activity a = ContactDialog.this.getOwnerActivity();
- Intent i = new Intent(mContext, UserInfo.class);
- Log.i("OOO", mContact.getJID());
- i.putExtra("contact_contactdialog", mContact.getJID());
- a.startActivity(i);
- dismiss();
- }
-
- }
-
- /**
- * 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);
- }
-
- @Override
- public void onServiceDisconnected(ComponentName name) {
- mXmppFacade = null;
- }
- }
-
-}
--- a/src/com/beem/project/beem/ui/ContactList.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/ui/ContactList.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,45 @@
+/*
+ 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
+
+*/
package com.beem.project.beem.ui;
import java.util.ArrayList;
@@ -10,19 +52,20 @@
import org.jivesoftware.smack.util.StringUtils;
import android.app.Activity;
+import android.app.Dialog;
import android.content.ComponentName;
-import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.ServiceConnection;
import android.content.SharedPreferences;
-import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.RemoteException;
import android.preference.PreferenceManager;
+import android.util.Log;
+import android.view.ContextMenu;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
@@ -32,11 +75,11 @@
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.Gallery;
-import android.widget.ImageView;
+import android.widget.TextView;
import android.widget.ListView;
-import android.widget.TextView;
+import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.AdapterView.OnItemClickListener;
-import android.widget.AdapterView.OnItemLongClickListener;
+import android.graphics.drawable.BitmapDrawable;
import com.beem.project.beem.R;
import com.beem.project.beem.service.Contact;
@@ -44,6 +87,9 @@
import com.beem.project.beem.service.aidl.IBeemRosterListener;
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.DeleteContact;
+import com.beem.project.beem.ui.dialogs.builders.ResendSubscription;
import com.beem.project.beem.utils.BeemBroadcastReceiver;
import com.beem.project.beem.utils.Status;
@@ -54,27 +100,32 @@
// private static final String TAG = "CONTACTLIST_ACT";
private static final Intent SERVICE_INTENT = new Intent();
- private static final int REQUEST_CODE = 1;
- private BeemContactList mAdapterContactList;
- private BeemBanner mAdapterBanner;
- private IRoster mRoster;
- private List<Contact> mListContact = new ArrayList<Contact>();
- private final List<String> mListGroup = new ArrayList<String>();
- private final Map<String, List<Contact>> mContactOnGroup = new HashMap<String, List<Contact>>();
- private String mCurGroup;
- private Handler mHandler;
- private IXmppFacade mXmppFacade;
- private SharedPreferences mSettings;
- private final ServiceConnection mServConn = new BeemServiceConnection();
- private BeemBroadcastReceiver mReceiver;
- private final Map<Integer, Bitmap> mIconsMap = new HashMap<Integer, Bitmap>();
- private LayoutInflater mInflater;
- private ContactDialog mContactDialog;
-
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>();
+ private final Map<String, List<Contact>> mContactOnGroup = new HashMap<String, List<Contact>>();
+ 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 IRoster mRoster;
+ private String mCurGroup;
+ private Contact mContact;
+ private IXmppFacade mXmppFacade;
+ private SharedPreferences mSettings;
+ private LayoutInflater mInflater;
+
/**
* Constructor.
*/
@@ -83,23 +134,6 @@
}
/**
- * {@inheritDoc}
- */
- @Override
- protected void onCreate(Bundle saveBundle) {
- super.onCreate(saveBundle);
- mSettings = PreferenceManager.getDefaultSharedPreferences(this);
- setContentView(R.layout.contactlist);
- mAdapterContactList = new BeemContactList(this);
- mAdapterBanner = new BeemBanner(this);
- mHandler = new Handler();
- mReceiver = new BeemBroadcastReceiver(mServConn);
- this.registerReceiver(mReceiver, new IntentFilter(BeemBroadcastReceiver.BEEM_CONNECTION_CLOSED));
- mInflater = LayoutInflater.from(this);
- prepareIconsStatus();
- }
-
- /**
* Callback for menu creation.
* @param menu the menu created
* @return true on success, false otherwise
@@ -131,6 +165,89 @@
}
}
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
+ super.onCreateContextMenu(menu, v, menuInfo);
+ MenuInflater inflater = getMenuInflater();
+ inflater.inflate(R.menu.contactlist_context, menu);
+ AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo;
+ Contact c = mListContact.get(info.position);
+ try {
+ mContact = mRoster.getContact(c.getJID());
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ menu.setHeaderTitle(mContact.getJID());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean onContextItemSelected(MenuItem item) {
+ Intent in;
+ boolean result;
+ if (mContact != 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);
+ result = true;
+ break;
+ case R.id.contact_list_context_menu_call_item:
+ try {
+ mXmppFacade.call(mContact.getJID() + "/psi");
+ result = true;
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ result = true;
+ break;
+ case R.id.contact_list_context_menu_user_info:
+ item.getSubMenu().setHeaderTitle(mContact.getJID());
+ result = true;
+ break;
+ case R.id.contact_list_context_menu_userinfo_alias:
+ Dialog alias = new Alias(ContactList.this, mRoster, mContact).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);
+ startActivity(in);
+ result = true;
+ break;
+ case R.id.contact_list_context_menu_userinfo_subscription:
+ Dialog subscription = new ResendSubscription(ContactList.this, mXmppFacade, mContact).create();
+ subscription.show();
+ result = true;
+ break;
+ case R.id.contact_list_context_menu_userinfo_block:
+ result = true;
+ break;
+ case R.id.contact_list_context_menu_userinfo_delete:
+ Dialog delete = new DeleteContact(ContactList.this, mRoster, mContact).create();
+ delete.show();
+ result = true;
+ break;
+ default:
+ result = super.onContextItemSelected(item);
+ 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);
@@ -139,7 +256,6 @@
mListContact.clear();
stopService(SERVICE_INTENT);
finish();
- startActivity(new Intent(this, Login.class));
}
}
}
@@ -148,38 +264,69 @@
* {@inheritDoc}
*/
@Override
- protected void onStart() {
- super.onStart();
- bindService(SERVICE_INTENT, mServConn, BIND_AUTO_CREATE);
+ protected void onCreate(Bundle saveBundle) {
+ super.onCreate(saveBundle);
+ mSettings = PreferenceManager.getDefaultSharedPreferences(this);
+ setContentView(R.layout.contactlist);
+
+ this.registerReceiver(mReceiver, new IntentFilter(BeemBroadcastReceiver.BEEM_CONNECTION_CLOSED));
+
+ mInflater = getLayoutInflater();
+ prepareIconsStatus();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void onResume() {
+ super.onResume();
+ if (mXmppFacade == null)
+ bindService(SERVICE_INTENT, mServConn, BIND_AUTO_CREATE);
+ else {
+ buildContactList();
+ buildBanner();
+ }
}
/**
* {@inheritDoc}
*/
@Override
- protected void onStop() {
- super.onStop();
- if (mContactDialog != null)
- mContactDialog.dismiss();
- if (mReceiver.isBinded())
- unbindService(mServConn);
+ protected void onPause() {
+ super.onPause();
+ try {
+ if (mRoster != null) {
+ mRoster.removeRosterListener(mBeemRosterListener);
+ mRoster = null;
+ }
+ } catch (RemoteException e) {
+ Log.d("ContactList", "Remote exception", e);
+ }
+ unbindService(mServConn);
+ mXmppFacade = null;
}
+ /*
+ * (non-Javadoc)
+ * @see android.app.Activity#onDestroy()
+ */
@Override
protected void onDestroy() {
super.onDestroy();
this.unregisterReceiver(mReceiver);
+ Log.e(TAG, "onDestroy activity");
}
/**
* Comparator Contact by Name.
*/
- class ComparatorContactListByName<T> implements Comparator<T> {
+ @SuppressWarnings("unused")
+ private class ComparatorContactListByName<T> implements Comparator<T> {
/**
* Constructor.
*/
public ComparatorContactListByName() {
-
}
/**
@@ -194,12 +341,11 @@
/**
* Comparator Contact by status and name.
*/
- class ComparatorContactListByStatusAndName<T> implements Comparator<T> {
+ private class ComparatorContactListByStatusAndName<T> implements Comparator<T> {
/**
* Constructor.
*/
public ComparatorContactListByStatusAndName() {
-
}
/**
@@ -226,7 +372,7 @@
sortBeemContactList();
ListView listView = (ListView) findViewById(R.id.contactlist);
listView.setOnItemClickListener(new BeemContactListOnClick());
- listView.setOnItemLongClickListener(new BeemContactListOnLongClick());
+ registerForContextMenu(listView);
listView.setAdapter(mAdapterContactList);
}
@@ -242,12 +388,11 @@
/**
* Event simple click on item of the contact list.
*/
- public class BeemContactListOnClick implements OnItemClickListener {
+ private class BeemContactListOnClick implements OnItemClickListener {
/**
* Constructor.
*/
public BeemContactListOnClick() {
-
}
/**
@@ -263,30 +408,6 @@
}
/**
- * Event long click on item of the contact list.
- */
- public class BeemContactListOnLongClick implements OnItemLongClickListener {
- /**
- * Constructor.
- */
- public BeemContactListOnLongClick() {
-
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean onItemLongClick(AdapterView<?> arg0, View v, int pos, long lpos) {
- Contact c = mListContact.get(pos);
- mContactDialog = new ContactDialog(ContactList.this, c);
- mContactDialog.setOwnerActivity(ContactList.this);
- mContactDialog.show();
- return true;
- }
- }
-
- /**
* Event simple click on middle groupe name.
*/
private class OnItemClickGroupName implements OnItemClickListener {
@@ -308,24 +429,25 @@
* Prepare Bitmap Map.
*/
private void prepareIconsStatus() {
- mIconsMap.put(Status.CONTACT_STATUS_AVAILABLE, BitmapFactory.decodeResource(getResources(),
- R.drawable.status_available));
- mIconsMap.put(Status.CONTACT_STATUS_AVAILABLE_FOR_CHAT, BitmapFactory.decodeResource(getResources(),
- R.drawable.status_available));
- mIconsMap
- .put(Status.CONTACT_STATUS_AWAY, BitmapFactory.decodeResource(getResources(), R.drawable.status_away));
- mIconsMap.put(Status.CONTACT_STATUS_BUSY, BitmapFactory.decodeResource(getResources(), R.drawable.status_dnd));
- mIconsMap.put(Status.CONTACT_STATUS_DISCONNECT, BitmapFactory.decodeResource(getResources(),
- R.drawable.status_offline));
- mIconsMap.put(Status.CONTACT_STATUS_UNAVAILABLE, BitmapFactory.decodeResource(getResources(),
- R.drawable.status_requested));
+ 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, new ComparatorContactListByStatusAndName<Contact>());
+ Collections.sort(mListContact, mComparator);
}
/**
@@ -336,7 +458,6 @@
* Constructor.
*/
public BeemRosterListener() {
-
}
/**
@@ -395,18 +516,19 @@
for (String cToDelete : addresses) {
for (Contact c : mListContact) {
if (c.getJID().equals(cToDelete)) {
- mListContact.remove(c);
for (String group : mListGroup) {
mContactOnGroup.get(group).remove(c);
if (mContactOnGroup.get(group).size() == 0) {
- mListGroup.remove(group);
- mListContact = mContactOnGroup.get(getString(R.string.contact_list_all_contact));
+ //mContactOnGroup.remove(group);
+ //mListGroup.remove(group);
}
}
+ mListContact.remove(c);
break;
}
}
}
+ mListContact = mContactOnGroup.get(getString(R.string.contact_list_all_contact));
mHandler.post(new RunnableChange());
}
@@ -426,29 +548,6 @@
mHandler.post(new RunnableChange());
}
- @Override
- public void onEntryDeleteFromGroup(String group, String jid) throws RemoteException {
- List<Contact> tmpContactList = mContactOnGroup.get(group);
- Contact curContact = null;
- for (Contact c : tmpContactList) {
- if (jid.equals(c.getJID())) {
- curContact = c;
- tmpContactList.remove(c);
- c.getGroups().remove(group);
- if (mContactOnGroup.get(group).size() == 0) {
- mContactOnGroup.remove(group);
- mListGroup.remove(group);
- mListContact = mContactOnGroup.get(getString(R.string.contact_list_all_contact));
- }
- break;
- }
- }
- if (curContact != null && curContact.getGroups().size() == 0) {
- mContactOnGroup.get(getString(R.string.contact_list_no_group)).add(curContact);
- }
- mHandler.post(new RunnableChange());
- }
-
/**
* {@inheritDoc}
*/
@@ -485,9 +584,8 @@
/**
* Constructor.
- * @param context context activity.
*/
- public BeemContactList(final Context context) {
+ public BeemContactList() {
}
/**
@@ -495,7 +593,7 @@
*/
@Override
public int getCount() {
- if (mSettings.getBoolean("settings_key_hidden_contact", false)) {
+ if (mSettings.getBoolean(SETTINGS_HIDDEN_CONTACT, false)) {
int res = 0;
for (Contact c : mListContact) {
if (Status.statusOnline(c.getStatus()))
@@ -512,7 +610,20 @@
*/
@Override
public Object getItem(int position) {
- return 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;
}
/**
@@ -533,7 +644,7 @@
v = mInflater.inflate(R.layout.contactlistcontact, null);
}
Contact c = null;
- if (mSettings.getBoolean("settings_key_hidden_contact", false)) {
+ if (mSettings.getBoolean(SETTINGS_HIDDEN_CONTACT, false)) {
int res = 0;
for (Contact cur : mListContact) {
if (res == position) {
@@ -552,7 +663,7 @@
e.printStackTrace();
}
}
- if (mSettings.getBoolean("settings_key_hidden_contact", false) && !Status.statusOnline(c.getStatus())) {
+ if (mSettings.getBoolean(SETTINGS_HIDDEN_CONTACT, false) && !Status.statusOnline(c.getStatus())) {
v.setVisibility(View.GONE);
} else {
bindView(v, c);
@@ -568,9 +679,8 @@
private void bindView(View view, Contact curContact) {
if (curContact != null) {
- ImageView imgV = (ImageView) view.findViewById(R.id.contactliststatus);
TextView v = (TextView) view.findViewById(R.id.contactlistpseudo);
- imgV.setImageBitmap(mIconsMap.get(curContact.getStatus()));
+ v.setCompoundDrawablesWithIntrinsicBounds(mIconsMap.get(curContact.getStatus()), null, null, null);
v.setText(curContact.getName());
v = (TextView) view.findViewById(R.id.contactlistmsgperso);
v.setText(curContact.getMsgState());
@@ -581,12 +691,11 @@
/**
* Adapter banner list.
*/
- public class BeemBanner extends BaseAdapter {
+ private class BeemBanner extends BaseAdapter {
/**
* Constructor.
- * @param c context activity.
*/
- public BeemBanner(final Context c) {
+ public BeemBanner() {
}
/**
@@ -602,7 +711,7 @@
*/
@Override
public Object getItem(int position) {
- return position;
+ return mListGroup.get(position);
}
/**
@@ -629,10 +738,13 @@
}
/**
+ * Create dialog resend subscription.
+ */
+
+ /**
* The service connection used to connect to the Beem service.
*/
private class BeemServiceConnection implements ServiceConnection {
- private final BeemRosterListener mBeemRosterListener = new BeemRosterListener();
/**
* Constructor.
@@ -643,7 +755,6 @@
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
mXmppFacade = IXmppFacade.Stub.asInterface(service);
- mReceiver.setBinded(true);
try {
mRoster = mXmppFacade.getRoster();
if (mRoster != null) {
@@ -681,7 +792,6 @@
} catch (RemoteException e) {
e.printStackTrace();
}
-
}
@Override
@@ -696,7 +806,11 @@
mListContact.clear();
mListGroup.clear();
mContactOnGroup.clear();
- mReceiver.setBinded(false);
}
}
+
+ @Override
+ protected void finalize() {
+ Log.e(TAG, "FINALIZE");
+ }
}
--- a/src/com/beem/project/beem/ui/CreateAccount.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/ui/CreateAccount.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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;
import java.util.regex.Pattern;
@@ -15,7 +58,6 @@
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
-import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
@@ -32,7 +74,6 @@
private static final boolean DEFAULT_BOOLEAN_VALUE = false;
private static final String DEFAULT_STRING_VALUE = "";
- private static final int DEFAULT_INT_VALUE = 0;
private static final int DEFAULT_XMPP_PORT = 5222;
private static final int NOTIFICATION_DURATION = Toast.LENGTH_SHORT;
@@ -66,12 +107,11 @@
private boolean createAccount(String username, String password) {
XMPPConnection xmppConnection = null;
ConnectionConfiguration connectionConfiguration = null;
-
- if (getRegisteredProxy() != null) {
- connectionConfiguration = new ConnectionConfiguration(getXMPPServer(), DEFAULT_XMPP_PORT,
- getRegisteredProxy());
+ ProxyInfo pi = getRegisteredProxy();
+ if (pi != null) {
+ connectionConfiguration = new ConnectionConfiguration(getXMPPServer(), getXMPPPort(), pi);
} else {
- connectionConfiguration = new ConnectionConfiguration(getXMPPServer(), DEFAULT_XMPP_PORT);
+ connectionConfiguration = new ConnectionConfiguration(getXMPPServer(), getXMPPPort());
}
if (getRegisteredXMPPTLSUse())
connectionConfiguration.setSecurityMode(ConnectionConfiguration.SecurityMode.required);
@@ -81,11 +121,10 @@
xmppConnection.connect();
AccountManager accountManager = new AccountManager(xmppConnection);
accountManager.createAccount(username, password);
- Toast toast = Toast.makeText(getApplicationContext(), "Account " + username + " "
- + getString(R.string.create_account_successfull_after), NOTIFICATION_DURATION);
+ Toast toast = Toast.makeText(getApplicationContext(), String.format(
+ getString(R.string.create_account_successfull_after), username), NOTIFICATION_DURATION);
toast.show();
} catch (XMPPException e) {
- Log.e(getString(R.string.create_account_tag), e.getMessage());
createErrorDialog(e.getMessage());
return false;
}
@@ -98,9 +137,11 @@
* @param errMsg the error message
*/
private void createErrorDialog(String errMsg) {
- Log.v(getString(R.string.create_account_tag), errMsg);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.setTitle(R.string.create_account_err_dialog_title).setMessage(errMsg).setCancelable(false);
+ builder.setTitle(R.string.create_account_err_dialog_title)
+ .setMessage(errMsg)
+ .setCancelable(false)
+ .setIcon(android.R.drawable.ic_dialog_alert);
builder.setNeutralButton(R.string.create_account_close_dialog_button, new DialogInterface.OnClickListener() {
@Override
@@ -130,7 +171,7 @@
* @return Registered proxy password
*/
private String getRegisteredProxyPassword() {
- return mSettings.getString(getString(R.string.settings_key_proxy_password), DEFAULT_STRING_VALUE);
+ return mSettings.getString("settings_key_proxy_password", DEFAULT_STRING_VALUE);
}
/**
@@ -138,8 +179,7 @@
* @return Registered proxy port
*/
private int getRegisteredProxyPort() {
- return Integer
- .parseInt(mSettings.getString(getString(R.string.settings_key_proxy_port), DEFAULT_STRING_VALUE));
+ return Integer.parseInt(mSettings.getString("settings_key_proxy_port", DEFAULT_STRING_VALUE));
}
/**
@@ -147,7 +187,7 @@
* @return Registered proxy server
*/
private String getRegisteredProxyServer() {
- return mSettings.getString(getString(R.string.settings_key_proxy_server), DEFAULT_STRING_VALUE);
+ return mSettings.getString("settings_key_proxy_server", DEFAULT_STRING_VALUE);
}
/**
@@ -155,21 +195,17 @@
* @return Registered proxy type
*/
private ProxyInfo.ProxyType getRegisteredProxyType() {
- ProxyInfo.ProxyType result;
- switch (mSettings.getInt(getString(R.string.settings_key_proxy_type), DEFAULT_INT_VALUE)) {
- case 0:
+ ProxyInfo.ProxyType result = ProxyInfo.ProxyType.NONE;
+ if (mSettings.getBoolean("settings_key_proxy_use", false)) {
+ String type = mSettings.getString("settings_key_proxy_type", "none");
+ if ("HTTP".equals(type))
result = ProxyInfo.ProxyType.HTTP;
- break;
- case 1:
+ else if ("SOCKS4".equals(type))
result = ProxyInfo.ProxyType.SOCKS4;
- break;
- case 2:
- Log.i(getString(R.string.create_account_tag), "SOCKS5 PROXY");
+ else if ("SOCKS5".equals(type))
result = ProxyInfo.ProxyType.SOCKS5;
- break;
- default:
+ else
result = ProxyInfo.ProxyType.NONE;
- break;
}
return result;
}
@@ -179,7 +215,7 @@
* @return Registered proxy use
*/
private boolean getRegisteredProxyUse() {
- return mSettings.getBoolean(getString(R.string.settings_key_proxy_use), DEFAULT_BOOLEAN_VALUE);
+ return mSettings.getBoolean("settings_key_proxy_use", DEFAULT_BOOLEAN_VALUE);
}
/**
@@ -187,7 +223,18 @@
* @return Registered proxy username
*/
private String getRegisteredProxyUsername() {
- return mSettings.getString(getString(R.string.settings_key_proxy_username), DEFAULT_STRING_VALUE);
+ return mSettings.getString("settings_key_proxy_username", DEFAULT_STRING_VALUE);
+ }
+
+ /**
+ * Retrieve xmpp port from the preferences.
+ * @return Registered xmpp port
+ */
+ private int getXMPPPort() {
+ int port = DEFAULT_XMPP_PORT;
+ if (mSettings.getBoolean("settings_key_specific_server", false))
+ port = Integer.parseInt(mSettings.getString("settings_key_xmpp_port", "5222"));
+ return port;
}
/**
@@ -196,7 +243,11 @@
*/
private String getXMPPServer() {
TextView xmppServerTextView = (TextView) findViewById(R.id.create_account_username);
- String xmppServer = StringUtils.parseServer(xmppServerTextView.getText().toString());
+ String xmppServer = "";
+ if (mSettings.getBoolean("settings_key_specific_server", false))
+ xmppServer = mSettings.getString("settings_key_xmpp_server", "");
+ else
+ xmppServer = StringUtils.parseServer(xmppServerTextView.getText().toString());
return xmppServer;
}
@@ -205,7 +256,7 @@
* @return Registered TLS use
*/
private boolean getRegisteredXMPPTLSUse() {
- return mSettings.getBoolean(getString(R.string.settings_key_xmpp_tls_use), DEFAULT_BOOLEAN_VALUE);
+ return mSettings.getBoolean("settings_key_xmpp_tls_use", DEFAULT_BOOLEAN_VALUE);
}
/**
@@ -217,7 +268,7 @@
final String passwordConfirmFielddValue = ((EditText) findViewById(R.id.create_account_confirm_password))
.getText().toString();
- return passwordFieldValue.equals(passwordConfirmFielddValue);
+ return passwordFieldValue.equals(passwordConfirmFielddValue) && !"".equals(passwordConfirmFielddValue);
}
/**
@@ -267,11 +318,10 @@
else {
if (createAccount(username, passwordFieldValue)) {
SharedPreferences.Editor settingsEditor = mSettings.edit();
- settingsEditor
- .putString(getString(R.string.settings_key_account_username), usernameFieldValue);
- settingsEditor
- .putString(getString(R.string.settings_key_account_password), passwordFieldValue);
- settingsEditor.putBoolean(getString(R.string.PreferenceIsConfigured), true);
+ settingsEditor.putString("settings_key_account_username", usernameFieldValue);
+ settingsEditor.putString("settings_key_account_password", passwordFieldValue);
+ settingsEditor.putBoolean("settings_key_gmail", false);
+ settingsEditor.putBoolean("PreferenceIsConfigured", true);
settingsEditor.commit();
finish();
}
--- a/src/com/beem/project/beem/ui/GroupList.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/ui/GroupList.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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;
import java.util.ArrayList;
@@ -37,7 +80,7 @@
private static final Intent SERVICE_INTENT = new Intent();
private final ServiceConnection mServConn = new BeemServiceConnection();
- private BeemBroadcastReceiver mReceiver;
+ private final BeemBroadcastReceiver mReceiver = new BeemBroadcastReceiver();
private IXmppFacade mXmppFacade;
private IRoster mRoster;
private String mJID;
@@ -56,11 +99,13 @@
public GroupList() {
}
+ /* (non-Javadoc)
+ * @see android.app.Activity#onCreate(android.os.Bundle)
+ */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.group_list);
- mReceiver = new BeemBroadcastReceiver(mServConn);
mContact = getIntent().getParcelableExtra("contact");
mJID = mContact.getJID();
final ListView listView = getListView();
@@ -81,7 +126,6 @@
protected void onResume() {
super.onResume();
bindService(new Intent(this, BeemService.class), mServConn, BIND_AUTO_CREATE);
- mReceiver.setBinded(true);
}
/**
@@ -90,12 +134,12 @@
@Override
protected void onPause() {
super.onPause();
- if (mReceiver.isBinded()) {
- unbindService(mServConn);
- mReceiver.setBinded(false);
- }
+ unbindService(mServConn);
}
+ /* (non-Javadoc)
+ * @see android.app.Activity#onDestroy()
+ */
@Override
protected void onDestroy() {
super.onDestroy();
@@ -201,7 +245,6 @@
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
mXmppFacade = IXmppFacade.Stub.asInterface(service);
- mReceiver.setBinded(true);
try {
mRoster = mXmppFacade.getRoster();
setAdapter();
--- a/src/com/beem/project/beem/ui/Login.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/ui/Login.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,20 +1,55 @@
+/*
+ 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;
import android.app.Activity;
import android.app.AlertDialog;
-import android.app.ProgressDialog;
-import android.content.ComponentName;
import android.content.DialogInterface;
import android.content.Intent;
-import android.content.ServiceConnection;
import android.content.SharedPreferences;
import android.os.Bundle;
-import android.os.Handler;
-import android.os.IBinder;
-import android.os.RemoteException;
-import android.os.SystemClock;
import android.preference.PreferenceManager;
-import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
@@ -22,36 +57,19 @@
import android.widget.Toast;
import com.beem.project.beem.R;
-import com.beem.project.beem.service.aidl.IBeemConnectionListener;
-import com.beem.project.beem.service.aidl.IXmppConnection;
-import com.beem.project.beem.service.aidl.IXmppFacade;
-import com.beem.project.beem.utils.Status;
+import com.beem.project.beem.utils.BeemConnectivity;
/**
- * This class represents an activity which allows the user to connect to an XMPP server with his username/password.
- * @author Jean-Manuel Da Silva <dasilvj at beem-project dot com>
+ * This class is the main Activity for the Beem project.
+ * @author Da Risk <darisk972@gmai.com>
*/
public class Login extends Activity {
- private static final String TAG = "Login";
- private static final int REQUEST_CODE = 1;
- private static final Intent SERVICE_INTENT = new Intent();
- static {
- SERVICE_INTENT.setComponent(new ComponentName("com.beem.project.beem", "com.beem.project.beem.BeemService"));
- }
-
- private final Handler mConnectionHandler = new Handler();
- private final ConnectionRunnable mConnectionRunnable = new ConnectionRunnable();
- private ProgressDialog mProgressDialog;
-
- private boolean mIsConnectedService;
- private final ServiceConnection mServConn = new BeemServiceConnection();
- private IXmppFacade mXmppFacade;
-
+ private static final int LOGIN_REQUEST_CODE = 1;
private SharedPreferences mSettings;
+ private TextView mTextView;
private boolean mIsConfigured;
- private int mRetry;
- private IXmppConnection mXmppConnection;
+ private boolean mIsResult;
/**
* Constructor.
@@ -59,10 +77,97 @@
public Login() {
}
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ 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())) {
+ mTextView.setText("");
+ Intent i = new Intent(this, LoginAnim.class);
+ startActivityForResult(i, LOGIN_REQUEST_CODE);
+ mIsResult = false;
+ } else {
+ mTextView.setText(R.string.login_start_msg);
+ }
+ }
+
+ @Override
+ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+ if (requestCode == LOGIN_REQUEST_CODE) {
+ mIsResult = true;
+ if (resultCode == Activity.RESULT_OK) {
+ startActivity(new Intent(this, ContactList.class));
+ finish();
+ } else if (resultCode == Activity.RESULT_CANCELED) {
+ if (data != null) {
+ String tmp = data.getExtras().getString("message");
+ Toast.makeText(Login.this, tmp, Toast.LENGTH_SHORT).show();
+ mTextView.setText(tmp);
+ }
+ }
+ }
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ super.onCreateOptionsMenu(menu);
+ MenuInflater inflater = getMenuInflater();
+ inflater.inflate(R.menu.login, menu);
+ return true;
+ }
+
+ @Override
+ public final boolean onOptionsItemSelected(MenuItem item) {
+ boolean result;
+ switch (item.getItemId()) {
+ case R.id.login_menu_settings:
+ mTextView.setText("");
+ startActivity(new Intent(Login.this, Settings.class));
+ result = true;
+ break;
+ case R.id.login_menu_about:
+ createAboutDialog();
+ result = true;
+ break;
+ case R.id.login_menu_login:
+ if (testConnectivity()) {
+ Intent i = new Intent(this, LoginAnim.class);
+ startActivityForResult(i, LOGIN_REQUEST_CODE);
+ }
+ result = true;
+ break;
+ default:
+ result = false;
+ break;
+ }
+ return result;
+ }
+
+ /**
+ * 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.
*/
- public void createAboutDialog() {
+ private void createAboutDialog() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.login_about_title).setMessage(R.string.login_about_msg).setCancelable(false);
builder.setNeutralButton(R.string.login_about_button, new DialogInterface.OnClickListener() {
@@ -74,320 +179,4 @@
AlertDialog aboutDialog = builder.create();
aboutDialog.show();
}
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- Log.d(TAG, "BEGIN onCreate.");
- mSettings = PreferenceManager.getDefaultSharedPreferences(this);
- setContentView(R.layout.login);
- mProgressDialog = new ProgressDialog(this);
- Log.d(TAG, "END onCreate.");
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void onStop() {
- super.onStop();
- Log.d(TAG, "BEGIN onStop.");
- if (mIsConfigured && (mIsConnectedService || mXmppFacade != null)) {
- boolean isConnected = false;
- if (mXmppConnection != null) {
- try {
- isConnected = mXmppConnection.isAuthentificated();
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- }
- unbindService(mServConn);
- if (!isConnected) {
- stopService(SERVICE_INTENT);
- }
- mXmppFacade = null;
- }
- Log.d(TAG, "END onStop.");
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void onPause() {
- super.onPause();
- Log.d(TAG, "BEGIN onPause.");
- mConnectionHandler.removeCallbacks(mConnectionRunnable);
- mProgressDialog.dismiss();
- Log.d(TAG, "END onPause.");
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void onResume() {
- super.onResume();
- Log.d(TAG, "BEGIN onResume.");
- Log.d(TAG, "END onResume.");
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void onStart() {
- super.onStart();
- Log.d(TAG, "BEGIN onStart.");
- mIsConfigured = mSettings.getBoolean("PreferenceIsConfigured", false);
- if (mIsConfigured && !mIsConnectedService) {
- try {
- Thread.sleep(1000); // HACK: Pour éviter de rebinder un service
- // pas encore arreter.
- } catch (InterruptedException e) {
- Log.e(TAG, e.getMessage());
- }
- bindService(Login.SERVICE_INTENT, mServConn, BIND_AUTO_CREATE);
- mIsConnectedService = true;
- }
- Log.d(TAG, "END onStart.");
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void onActivityResult(int requestCode, int resultCode, Intent data) {
- super.onActivityResult(requestCode, resultCode, data);
- if (requestCode == REQUEST_CODE) {
- if (resultCode == RESULT_OK) {
- stopService(SERVICE_INTENT);
- }
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- super.onCreateOptionsMenu(menu);
- MenuInflater inflater = getMenuInflater();
- inflater.inflate(R.menu.login, menu);
- 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.login_menu_settings:
- startActivity(new Intent(Login.this, Settings.class));
- return true;
- case R.id.login_menu_about:
- createAboutDialog();
- return true;
- default:
- return false;
- }
- }
-
- /**
- * Connection runnable.
- * @author nikita
- */
- private class ConnectionRunnable implements Runnable {
-
- /**
- * Constructor.
- */
- public ConnectionRunnable() {
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void run() {
- if (mRetry++ > 3) {
- Toast.makeText(Login.this, R.string.login_max_retry, Toast.LENGTH_LONG).show();
- mConnectionHandler.removeCallbacks(mConnectionRunnable);
- } else {
- mIsConfigured = mSettings.getBoolean("PreferenceIsConfigured", false);
- if (mIsConfigured) {
- bindService(Login.SERVICE_INTENT, mServConn, BIND_AUTO_CREATE);
- }
- }
-
- }
- }
-
- /**
- * Listener use to check the state of the connection with the server.
- */
- private class BeemConnectionListener extends IBeemConnectionListener.Stub {
-
- /**
- * Constructor.
- */
- public BeemConnectionListener() {
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void connectionClosed() throws RemoteException {
- Log.d(TAG, "BEGIN connectionClosed.");
- if (mXmppFacade != null) {
- launchReconnectionHandler();
- mXmppFacade = null;
- }
- Log.d(TAG, "END connectionClosed.");
- }
-
- @Override
- public void connectionClosedOnError() throws RemoteException {
- Log.d(TAG, "BEGIN connectionClosedOnError.");
- if (mXmppFacade != null) {
- launchReconnectionHandler();
- mXmppFacade = null;
- }
- Log.d(TAG, "END connectionClosedOnError.");
- }
-
- @Override
- public void connectionFailed(String errorMsg) throws RemoteException {
- Log.d(TAG, "BEGIN connectionFailed.");
- if (mXmppFacade != null) {
- Login.this.unbindService(mServConn);
- Login.this.stopService(SERVICE_INTENT);
- mIsConnectedService = false;
- mXmppFacade = null;
- }
- dismissProgressDialog();
- showToast(errorMsg);
- launchReconnectionHandler();
- Log.d(TAG, "END connectionFailed.");
- }
-
- /**
- * launch reconnection handler.
- */
- private void launchReconnectionHandler() {
- mConnectionHandler.postAtTime(mConnectionRunnable, Integer.parseInt(mSettings.getString(
- "settings_key_reco_delay", "10"))
- * 1000 + SystemClock.uptimeMillis());
- }
-
- /**
- * Show an error message with a toast.
- * @param errorMsg The message to display.
- */
- private void showToast(final String errorMsg) {
- mConnectionHandler.post(new Runnable() {
- /**
- * @{inheritDoc
- */
- @Override
- public void run() {
- Toast.makeText(Login.this, errorMsg, Toast.LENGTH_LONG).show();
- TextView labelError = (TextView) findViewById(R.id.log_as_msg);
- labelError.setText(getString(R.string.login_error_msg, errorMsg));
- }
- });
- }
-
- /**
- * Dismiss the progress dialog.
- */
- private void dismissProgressDialog() {
- mConnectionHandler.post(new Runnable() {
-
- /**
- * @{inheritDoc
- */
- @Override
- public void run() {
- mProgressDialog.dismiss();
- }
- });
- }
-
- @Override
- public void onConnect() throws RemoteException {
- Log.d(TAG, "BEGIN onConnect.");
- dismissProgressDialog();
- mXmppFacade.changeStatus(Status.CONTACT_STATUS_AVAILABLE, null);
- mRetry = 0;
- startActivity(new Intent(Login.this, ContactList.class));
- finish();
- Log.d(TAG, "END onConnect.");
- }
-
- @Override
- public void reconnectingIn(int seconds) throws RemoteException {
- }
-
- @Override
- public void reconnectionFailed() throws RemoteException {
- }
-
- @Override
- public void reconnectionSuccessful() throws RemoteException {
- }
- }
-
- /**
- * ServiceConnection use to connect to the Beem Service.
- */
- private class BeemServiceConnection implements ServiceConnection {
- /**
- * Constructor.
- */
- public BeemServiceConnection() {
- }
-
- @Override
- public void onServiceConnected(ComponentName name, IBinder service) {
- Log.d(TAG, "BEGIN onServiceConnected.");
- mXmppFacade = IXmppFacade.Stub.asInterface(service);
- mIsConnectedService = true;
- try {
- mXmppConnection = mXmppFacade.createConnection();
- mXmppConnection.addConnectionListener(new BeemConnectionListener());
- if (!mXmppConnection.isAuthentificated()) {
- mConnectionHandler.post(new Runnable() {
- @Override
- public void run() {
- mProgressDialog.setMessage(getString(R.string.login_login_progress));
- mProgressDialog.show();
- }
- });
- Login.this.startService(Login.SERVICE_INTENT);
- } else {
- startActivity(new Intent(Login.this, ContactList.class));
- finish();
- }
- } catch (RemoteException e) {
- Log.e(TAG, e.getMessage());
- }
- Log.d(TAG, "END onServiceConnected.");
- }
-
- @Override
- public void onServiceDisconnected(ComponentName name) {
- Log.d(TAG, "BEGIN onServiceDisconnected.");
- mIsConnectedService = false;
- mXmppFacade = null;
- Log.d(TAG, "END onServiceDisconnected.");
- }
- }
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/ui/LoginAnim.java Fri Jan 15 12:02:29 2010 +0100
@@ -0,0 +1,246 @@
+/*
+ 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;
+
+import android.app.Activity;
+import android.content.ComponentName;
+import android.content.Intent;
+import android.content.ServiceConnection;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.os.IBinder;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
+import android.widget.Button;
+import android.widget.ImageView;
+
+import com.beem.project.beem.R;
+import com.beem.project.beem.service.aidl.IXmppFacade;
+import com.beem.project.beem.service.LoginAsyncTask;
+
+/**
+ * This class is an activity which display an animation during the connection with the server.
+ * @author Da Risk <darisk972@gmail.com>
+ */
+public class LoginAnim extends Activity {
+
+ private static final String TAG = "LoginAnim";
+ private static final Intent SERVICE_INTENT = new Intent();
+ static {
+ SERVICE_INTENT.setComponent(new ComponentName("com.beem.project.beem", "com.beem.project.beem.BeemService"));
+ }
+ private ImageView mLogo;
+ private Animation mRotateAnim;
+ private final ServiceConnection mServConn = new LoginServiceConnection();
+ private IXmppFacade mXmppFacade;
+ private AsyncTask<IXmppFacade, Integer, Boolean> mTask;
+ private Button mCancelBt;
+
+ /**
+ * Constructor.
+ */
+ public LoginAnim() {
+ }
+
+ /* (non-Javadoc)
+ * @see android.app.Activity#onCreate(android.os.Bundle)
+ */
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.login_anim);
+ mLogo = (ImageView) findViewById(R.id.loginanim_logo_anim);
+ mRotateAnim = AnimationUtils.loadAnimation(this, R.anim.rotate_and_scale);
+ mCancelBt = (Button) findViewById(R.id.loginanim_cancel_button);
+ mCancelBt.setOnClickListener(new ClickListener());
+ }
+
+ /* (non-Javadoc)
+ * @see android.app.Activity#onStart()
+ */
+ @Override
+ protected void onStart() {
+ super.onStart();
+ mLogo.startAnimation(mRotateAnim);
+ }
+
+ /* (non-Javadoc)
+ * @see android.app.Activity#onResume()
+ */
+ @Override
+ protected void onResume() {
+ super.onResume();
+ if (mTask == null)
+ mTask = new LoginTask();
+ if (mXmppFacade == null)
+ bindService(LoginAnim.SERVICE_INTENT, mServConn, BIND_AUTO_CREATE);
+ }
+
+ /* (non-Javadoc)
+ * @see android.app.Activity#onPause()
+ */
+ @Override
+ protected void onPause() {
+ super.onPause();
+ if (mXmppFacade != null) { // and async task not en cours
+ unbindService(mServConn);
+ mXmppFacade = null;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see android.app.Activity#onKeyDown(int, android.view.KeyEvent)
+ */
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ // TODO use onBackPressed on Eclair (2.0)
+ if (keyCode == KeyEvent.KEYCODE_BACK && mTask.getStatus() != AsyncTask.Status.FINISHED) {
+ if (!mTask.cancel(true)) {
+ Log.d(TAG, "Can't interrupt the connection");
+ }
+ setResult(Activity.RESULT_CANCELED);
+ }
+ return super.onKeyDown(keyCode, event);
+ }
+
+ /**
+ * Click event listener on cancel button.
+ */
+ private class ClickListener implements OnClickListener {
+
+ /**
+ * Constructor.
+ */
+ ClickListener() {
+ }
+
+ @Override
+ public void onClick(View v) {
+ if (v == mCancelBt) {
+ if (!mTask.cancel(true)) {
+ Log.d(TAG, "Can't interrupt the connection");
+ }
+ setResult(Activity.RESULT_CANCELED);
+ finish();
+ }
+ }
+ }
+
+ /**
+ * Asynchronous class for connection.
+ */
+ private class LoginTask extends LoginAsyncTask{
+
+ /**
+ * Constructor.
+ */
+ LoginTask() {
+ }
+
+ /* (non-Javadoc)
+ * @see android.os.AsyncTask#onPostExecute(java.lang.Object)
+ */
+ @Override
+ protected void onPostExecute(Boolean result) {
+
+ if (result == null || !result) { // Task cancelled or exception
+ if (!result) {
+ Intent i = new Intent();
+ i.putExtra("message", getErrorMessage());
+ LoginAnim.this.setResult(Activity.RESULT_CANCELED, i);
+ } else
+ LoginAnim.this.setResult(Activity.RESULT_CANCELED);
+ LoginAnim.this.finish();
+ } else {
+ mCancelBt.setEnabled(false);
+ LoginAnim.this.startService(LoginAnim.SERVICE_INTENT);
+ LoginAnim.this.setResult(Activity.RESULT_OK);
+ LoginAnim.this.finish();
+ }
+ }
+
+ @Override
+ protected void onProgressUpdate(Integer ... values) {
+ Log.d(TAG, "onProgress " + values[0]);
+ }
+
+ /* (non-Javadoc)
+ * @see android.os.AsyncTask#onCancelled()
+ */
+ @Override
+ protected void onCancelled() {
+ super.onCancelled();
+ LoginAnim.this.stopService(LoginAnim.SERVICE_INTENT);
+ }
+
+ }
+
+ /**
+ * The service connection used to connect to the Beem service.
+ */
+ private class LoginServiceConnection implements ServiceConnection {
+
+ /**
+ * Constructor.
+ */
+ public LoginServiceConnection() {
+ }
+
+ @Override
+ public void onServiceConnected(ComponentName name, IBinder service) {
+ mXmppFacade = IXmppFacade.Stub.asInterface(service);
+ if (mTask.getStatus() == AsyncTask.Status.PENDING)
+ mTask = mTask.execute(mXmppFacade);
+ }
+
+ @Override
+ public void onServiceDisconnected(ComponentName name) {
+ mXmppFacade = null;
+ }
+ }
+}
--- a/src/com/beem/project/beem/ui/PrivacyList.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/ui/PrivacyList.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,9 +1,51 @@
+/*
+ BEEM is a videoconference application on the Android Platform.
+
+ Copyright (C) 2009 by Frederic-Charles Barthelery,
+ Jean-Manuel Da Silva,
+ Nikita Kozlov,
+ Philippe Lago,
+ Jean Baptiste Vergely,
+ Vincent Veronis.
+
+ This file is part of BEEM.
+
+ BEEM is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ BEEM is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with BEEM. If not, see <http://www.gnu.org/licenses/>.
+
+ Please send bug reports with examples or suggestions to
+ contact@beem-project.com or http://dev.beem-project.com/
+
+ Epitech, hereby disclaims all copyright interest in the program "Beem"
+ written by Frederic-Charles Barthelery,
+ Jean-Manuel Da Silva,
+ Nikita Kozlov,
+ Philippe Lago,
+ Jean Baptiste Vergely,
+ Vincent Veronis.
+
+ Nicolas Sadirac, November 26, 2009
+ President of Epitech.
+
+ Flavien Astraud, November 26, 2009
+ Head of the EIP Laboratory.
+
+*/
package com.beem.project.beem.ui;
import java.util.ArrayList;
import java.util.List;
-import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ListActivity;
import android.content.ComponentName;
@@ -11,26 +53,27 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.content.ServiceConnection;
+import android.content.DialogInterface.OnDismissListener;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Log;
-import android.view.LayoutInflater;
+import android.view.ContextMenu;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
+import android.widget.AdapterView;
import android.widget.ArrayAdapter;
-import android.widget.EditText;
-import android.widget.ListView;
-import com.beem.project.beem.BeemService;
import com.beem.project.beem.R;
import com.beem.project.beem.service.PrivacyListItem;
import com.beem.project.beem.service.aidl.IPrivacyListListener;
import com.beem.project.beem.service.aidl.IPrivacyListManager;
import com.beem.project.beem.service.aidl.IXmppFacade;
+import com.beem.project.beem.ui.dialogs.builders.CreatePrivacyList;
+import com.beem.project.beem.ui.dialogs.builders.DeletePrivacyList;
import com.beem.project.beem.utils.BeemBroadcastReceiver;
/**
@@ -44,20 +87,22 @@
static {
SERVICE_INTENT.setComponent(new ComponentName("com.beem.project.beem", "com.beem.project.beem.BeemService"));
}
- private static final int DIALOG_PRIVACY_LIST_ITEM = 1;
- private static final int DIALOG_CREATE_PRIVACY_LIST = 2;
+
+ private static final int DIALOG_CREATE = 0;
+ private static final int DIALOG_UPDATE_BUDDIES = 1;
+ private static final int DIALOG_UPDATE_GROUPS = 2;
+ private static final int DIALOG_DELETE = 3;
private static final String SAVED_INSTANCE_KEY_PRIVACY_LISTS = "PRIVACY_LISTS";
- private static final String SAVED_INSTANCE_KEY_LAST_CLICKED_ITEM = "LAST_CLICKED_ITEM";
private Handler mHandler = new Handler();
private ArrayAdapter<String> mAdapter;
private final List<String> mPrivacyListNames = new ArrayList<String>();
- private int mPosLastClickedItem;
+ private String mCurrPrivacyListName;
private final ServiceConnection mConn = new BeemServiceConnection();
- private BeemBroadcastReceiver mBroadcastReceiver;
+ private final BeemBroadcastReceiver mBroadcastReceiver = new BeemBroadcastReceiver();
private IPrivacyListManager mPrivacyListManager;
private IPrivacyListListener mPrivacyListListener;
@@ -76,7 +121,6 @@
protected void onSaveInstanceState(Bundle savedInstanceState) {
Log.d(TAG, "BEGIN onSaveInstanceState.");
savedInstanceState.putStringArrayList(SAVED_INSTANCE_KEY_PRIVACY_LISTS, (ArrayList<String>) mPrivacyListNames);
- savedInstanceState.putInt(SAVED_INSTANCE_KEY_LAST_CLICKED_ITEM, mPosLastClickedItem);
Log.d(TAG, "END onSaveInstanceState.");
super.onSaveInstanceState(savedInstanceState);
}
@@ -88,20 +132,22 @@
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.d(TAG, "BEGIN onCreate.");
+
setContentView(R.layout.privacy_list);
+ registerForContextMenu(this.getListView());
mHandler = new Handler();
if (savedInstanceState != null && !savedInstanceState.isEmpty()) {
mPrivacyListNames.addAll(savedInstanceState.getStringArrayList(SAVED_INSTANCE_KEY_PRIVACY_LISTS));
- mPosLastClickedItem = savedInstanceState.getInt(SAVED_INSTANCE_KEY_LAST_CLICKED_ITEM);
}
mAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, mPrivacyListNames);
setListAdapter(mAdapter);
+ bindService(SERVICE_INTENT, mConn, BIND_AUTO_CREATE);
+
mPrivacyListListener = new PrivacyListListener();
- mBroadcastReceiver = new BeemBroadcastReceiver(mConn);
this.registerReceiver(mBroadcastReceiver, new IntentFilter(BeemBroadcastReceiver.BEEM_CONNECTION_CLOSED));
Log.d(TAG, "END onCreate.");
@@ -111,76 +157,11 @@
* {@inheritDoc}.
*/
@Override
- protected void onPrepareDialog(int id, Dialog dialog) {
- Log.d(TAG, "BEGIN onPrepareDialog.");
- switch (id) {
- case DIALOG_PRIVACY_LIST_ITEM:
- String dialogTitle = (mPosLastClickedItem > mPrivacyListNames.size() ? "" : mPrivacyListNames
- .get(mPosLastClickedItem));
- dialog.setTitle(dialogTitle);
- }
- Log.d(TAG, "END onPrepareDialog.");
- }
-
- /**
- * {@inheritDoc}.
- */
- @Override
- protected Dialog onCreateDialog(int id) {
- Log.d(TAG, "BEGIN onCreateDialog.");
- switch (id) {
- case DIALOG_PRIVACY_LIST_ITEM:
- return new AlertDialog.Builder(this).setTitle("X").setItems(R.array.privacy_list_select_dialog,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- String[] items = getResources().getStringArray(R.array.privacy_list_select_dialog);
- if (items[which].equals(getResources().getString(
- R.string.privacy_list_select_dialog_delete))) {
- try {
- mPrivacyListManager.removePrivacyList(mPrivacyListNames.get(mPosLastClickedItem));
- } catch (RemoteException e) {
- Log.e(TAG, e.getMessage());
- }
- dismissDialog(DIALOG_PRIVACY_LIST_ITEM);
- }
- }
- }).create();
-
- case DIALOG_CREATE_PRIVACY_LIST:
- LayoutInflater factory = LayoutInflater.from(this);
- final View textEntryView = factory.inflate(R.layout.privacy_list_create_dialog, null);
-
- return new AlertDialog.Builder(this).setTitle(R.string.privacy_list_create_dialog_title).setView(
- textEntryView).setPositiveButton(R.string.privacy_list_create_dialog_create_button,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int whichButton) {
- EditText listNameField = (EditText) textEntryView
- .findViewById(R.id.privacy_list_create_dialog_list_name);
- try {
- mPrivacyListManager.createPrivacyList(listNameField.getText().toString(),
- new ArrayList<PrivacyListItem>());
- } catch (RemoteException e) {
- Log.e(TAG, e.getMessage());
- }
- }
- }).setNegativeButton(R.string.CancelButton, new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int whichButton) {
- }
- }).create();
- }
- Log.d(TAG, "END onCreateDialog.");
- return null;
- }
-
- /**
- * {@inheritDoc}.
- */
- @Override
protected void onDestroy() {
super.onDestroy();
Log.v(TAG, "BEGIN onDestroy.");
- this.unregisterReceiver(mBroadcastReceiver);
+
if (mPrivacyListManager != null) {
try {
mPrivacyListManager.removePrivacyListListener(mPrivacyListListener);
@@ -188,6 +169,10 @@
Log.e(TAG, e.getMessage());
}
}
+
+ this.unregisterReceiver(mBroadcastReceiver);
+ unbindService(mConn);
+
Log.v(TAG, "END onDestroy.");
}
@@ -199,7 +184,6 @@
super.onStart();
Log.v(TAG, "BEGIN onStart.");
- bindService(new Intent(this, BeemService.class), mConn, BIND_AUTO_CREATE);
Log.v(TAG, "END onStart.");
}
@@ -211,10 +195,41 @@
super.onStop();
Log.v(TAG, "BEGIN onStop.");
- if (mBroadcastReceiver.isBinded()) {
- unbindService(mConn);
+ Log.v(TAG, "END onStop.");
+ }
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Override
+ protected Dialog onCreateDialog(int id) {
+ Dialog dialog;
+ switch (id) {
+ case DIALOG_CREATE:
+ dialog = new CreatePrivacyList(PrivacyList.this, mPrivacyListManager).create();
+ dialog.setOnDismissListener(new OnDismissListener() {
+
+ @Override
+ public void onDismiss(DialogInterface dialog) {
+ PrivacyList.this.removeDialog(DIALOG_CREATE);
+ }
+ });
+ break;
+ case DIALOG_DELETE:
+ dialog = new DeletePrivacyList(PrivacyList.this, mPrivacyListManager, mCurrPrivacyListName).create();
+ dialog.setOnDismissListener(new OnDismissListener() {
+
+ @Override
+ public void onDismiss(DialogInterface dialog) {
+ PrivacyList.this.removeDialog(DIALOG_DELETE);
+ }
+
+ });
+ break;
+ default:
+ dialog = null;
}
- Log.v(TAG, "END onStop.");
+ return dialog;
}
/**
@@ -230,12 +245,33 @@
}
/**
- * {@inheritDoc}.
+ * {@inheritDoc}
*/
@Override
- public void onListItemClick(ListView l, View v, int position, long id) {
- mPosLastClickedItem = position;
- showDialog(DIALOG_PRIVACY_LIST_ITEM);
+ public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
+ super.onCreateContextMenu(menu, v, menuInfo);
+ MenuInflater inflater = getMenuInflater();
+ inflater.inflate(R.menu.privacy_list_context, menu);
+ mCurrPrivacyListName = mPrivacyListNames.get(((AdapterView.AdapterContextMenuInfo) menuInfo).position);
+ menu.setHeaderTitle(mCurrPrivacyListName);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean onContextItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case R.id.privacy_list_context_menu_buddies_item:
+ return true;
+ case R.id.privacy_list_context_menu_groups_item:
+ return true;
+ case R.id.privacy_list_context_menu_delete_item:
+ showDialog(DIALOG_DELETE);
+ return true;
+ default:
+ return super.onContextItemSelected(item);
+ }
}
/**
@@ -245,13 +281,17 @@
public final boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.privacy_list_menu_create:
- showDialog(DIALOG_CREATE_PRIVACY_LIST);
+ showDialog(DIALOG_CREATE);
return true;
default:
return false;
}
}
+ /**
+ * Service connection.
+ * @author jamu
+ */
private final class BeemServiceConnection implements ServiceConnection {
private IXmppFacade mXmppFacade;
@@ -260,7 +300,6 @@
public void onServiceConnected(ComponentName name, IBinder service) {
Log.v(TAG, "BEGIN onServiceConnected.");
mXmppFacade = IXmppFacade.Stub.asInterface(service);
- mBroadcastReceiver.setBinded(true);
try {
mPrivacyListManager = mXmppFacade.getPrivacyListManager();
mPrivacyListManager.addPrivacyListListener(mPrivacyListListener);
@@ -277,7 +316,6 @@
public void onServiceDisconnected(ComponentName name) {
Log.v(TAG, "BEGIN onServiceDisconnected.");
mXmppFacade = null;
- mBroadcastReceiver.setBinded(false);
try {
mPrivacyListManager.removePrivacyListListener(mPrivacyListListener);
} catch (RemoteException e) {
@@ -287,6 +325,10 @@
}
}
+ /**
+ * Listener.
+ * @author jamu
+ */
private class PrivacyListListener extends IPrivacyListListener.Stub {
@Override
--- a/src/com/beem/project/beem/ui/Settings.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/ui/Settings.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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;
import android.content.BroadcastReceiver;
@@ -33,6 +76,9 @@
public Settings() {
}
+ /* (non-Javadoc)
+ * @see android.preference.PreferenceActivity#onCreate(android.os.Bundle)
+ */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -92,20 +138,9 @@
i = new Intent(this, CreateAccount.class);
startActivity(i);
return true;
- case R.id.settings_menu_login:
- setResult(RESULT_OK);
- SharedPreferences settings = getPreferenceManager().getSharedPreferences();
- settings.edit().putBoolean(
- "PreferenceIsConfigured",
- !"".equals(settings.getString("settings_key_account_username", ""))
- || !"".equals(settings.getString("settings_key_account_password", ""))).commit();
- this.stopService(SERVICE_INTENT);
- finish();
- return true;
case R.id.settings_menu_privacy_lists:
- /*
- * i = new Intent(this, PrivacyList.class); startActivity(i);
- */
+ i = new Intent(this, PrivacyList.class);
+ startActivity(i);
return true;
default:
return false;
--- a/src/com/beem/project/beem/ui/Subscription.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/ui/Subscription.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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;
import org.jivesoftware.smack.packet.Presence;
@@ -32,7 +75,7 @@
private IXmppFacade mService;
private String mContact;
private ServiceConnection mServConn = new BeemServiceConnection();
- private BeemBroadcastReceiver mReceiver;
+ private final BeemBroadcastReceiver mReceiver = new BeemBroadcastReceiver();
private MyOnClickListener mClickListener = new MyOnClickListener();
static {
@@ -45,11 +88,13 @@
public Subscription() {
}
+ /* (non-Javadoc)
+ * @see android.app.Activity#onCreate(android.os.Bundle)
+ */
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.subscription);
- mReceiver = new BeemBroadcastReceiver(mServConn);
findViewById(R.id.SubscriptionAccept).setOnClickListener(mClickListener);
findViewById(R.id.SubscriptionRefuse).setOnClickListener(mClickListener);
mContact = getIntent().getStringExtra("from");
@@ -59,22 +104,27 @@
this.registerReceiver(mReceiver, new IntentFilter(BeemBroadcastReceiver.BEEM_CONNECTION_CLOSED));
}
+ /* (non-Javadoc)
+ * @see android.app.Activity#onResume()
+ */
@Override
protected void onResume() {
super.onResume();
bindService(new Intent(this, BeemService.class), mServConn, BIND_AUTO_CREATE);
- mReceiver.setBinded(true);
}
+ /* (non-Javadoc)
+ * @see android.app.Activity#onPause()
+ */
@Override
protected void onPause() {
super.onPause();
- if (mReceiver.isBinded()) {
- unbindService(mServConn);
- mReceiver.setBinded(false);
- }
+ unbindService(mServConn);
}
+ /* (non-Javadoc)
+ * @see android.app.Activity#onDestroy()
+ */
@Override
protected void onDestroy() {
super.onDestroy();
@@ -134,7 +184,6 @@
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
mService = IXmppFacade.Stub.asInterface(service);
- mReceiver.setBinded(true);
}
@Override
--- a/src/com/beem/project/beem/ui/UserInfo.java Fri Jan 15 11:58:04 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,370 +0,0 @@
-package com.beem.project.beem.ui;
-
-import java.util.List;
-
-import org.jivesoftware.smack.packet.Presence;
-
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.app.Dialog;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.content.ServiceConnection;
-import android.os.Bundle;
-import android.os.IBinder;
-import android.os.RemoteException;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.BaseAdapter;
-import android.widget.Button;
-import android.widget.EditText;
-import android.widget.Gallery;
-import android.widget.TextView;
-import android.widget.Toast;
-
-import com.beem.project.beem.BeemService;
-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.IRoster;
-import com.beem.project.beem.service.aidl.IXmppFacade;
-import com.beem.project.beem.utils.BeemBroadcastReceiver;
-
-/**
- * This activity class provides the view for user infos after long click on a correspondant.
- * @author marseille
- */
-public class UserInfo extends Activity {
-
- private static final Intent SERVICE_INTENT = new Intent();
- private final ServiceConnection mServConn = new BeemServiceConnection();
- private TextView mTextAlias;
- private Gallery mGalleryGroups;
- private Contact mContact;
- private IXmppFacade mXmppFacade;
- private BeemBroadcastReceiver mReceiver;
- private String mJID;
- private IRoster mRoster;
-
- static {
- SERVICE_INTENT.setComponent(new ComponentName("com.beem.project.beem", "com.beem.project.beem.BeemService"));
- }
-
- /**
- * Constructor.
- */
- public UserInfo() {
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.userinfo);
- View v = (View) findViewById(R.id.userinfo_layout_alias);
- v.setOnClickListener(new AliasListener());
- v = findViewById(R.id.userinfo_layout_delete);
- v.setOnClickListener(new DeleteListener());
- v = findViewById(R.id.userinfo_layout_chg_group);
- v.setOnClickListener(new GroupListener());
- v = findViewById(R.id.userinfo_layout_re_suscription);
- v.setOnClickListener(new ResendListener());
- mTextAlias = (TextView) findViewById(R.id.userinfo_alias);
- mGalleryGroups = (Gallery) findViewById(R.id.userinfo_groups);
- mReceiver = new BeemBroadcastReceiver(mServConn);
- this.registerReceiver(mReceiver, new IntentFilter(BeemBroadcastReceiver.BEEM_CONNECTION_CLOSED));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void onResume() {
- super.onResume();
- bindService(new Intent(this, BeemService.class), mServConn, BIND_AUTO_CREATE);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void onPause() {
- super.onPause();
- if (mReceiver.isBinded()) {
- unbindService(mServConn);
- mReceiver.setBinded(false);
- }
- }
-
- @Override
- protected void onDestroy() {
- super.onDestroy();
- this.unregisterReceiver(mReceiver);
- }
-
- /**
- * Event simple click on layout alias.
- */
- private class AliasListener implements View.OnClickListener {
- /**
- * Constructor.
- */
- public AliasListener() {
- }
-
- @Override
- public void onClick(View v) {
- Dialog d = new DialogAlias();
- d.show();
- }
- }
-
- /**
- * Event simple click on layout group.
- */
- private class GroupListener implements View.OnClickListener {
- /**
- * Constructor.
- */
- public GroupListener() {
- }
-
- @Override
- public void onClick(View v) {
- Intent i = new Intent(UserInfo.this, GroupList.class);
- i.putExtra("contact", mContact);
- startActivity(i);
- }
-
- }
-
- /**
- * Create dialog alias.
- */
- public class DialogAlias extends Dialog {
-
- /**
- * Constructor.
- */
- public DialogAlias() {
- super(UserInfo.this);
- setContentView(R.layout.contactdialogaliasdialog);
- setTitle(mContact.getJID());
- EditText nameText = (EditText) findViewById(R.id.CDAliasDialogName);
- if (mContact.getName().length() == 0)
- nameText.setText(mContact.getJID());
- else
- nameText.setText(mContact.getName());
- Button ok = (Button) findViewById(R.id.CDAliasDialogOk);
- ok.setOnClickListener(new ContactDialogAliasDialogOK());
- }
-
- /**
- * Event click on the button OK.
- */
- private class ContactDialogAliasDialogOK implements View.OnClickListener {
-
- /**
- * Constructor.
- */
- public ContactDialogAliasDialogOK() {
- }
-
- @Override
- public void onClick(View v) {
- try {
- EditText nameText = (EditText) findViewById(R.id.CDAliasDialogName);
- String name = nameText.getText().toString();
- if (name.length() == 0)
- name = mContact.getJID();
- mRoster.setContactName(mContact.getJID(), name);
- mContact.setName(name);
- mTextAlias.setText(name);
-
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- dismiss();
- }
- }
- }
-
- /**
- * Adapter group horizontal list.
- */
- public class BeemGroups extends BaseAdapter {
- private Context mContext;
- private List<String> mListGroup;
-
- /**
- * Constructor.
- * @param c context activity.
- * @param listGroup the user group list.
- */
- public BeemGroups(final Context c, final List<String> listGroup) {
- mContext = c;
- if (listGroup.size() == 0)
- listGroup.add(getString(R.string.contact_list_no_group));
- mListGroup = listGroup;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int getCount() {
- return mListGroup.size();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Object getItem(int position) {
- return position;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public long getItemId(int position) {
- return position;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- TextView textView = new TextView(mContext);
- textView.setText(mListGroup.get(position));
- return textView;
- }
-
- }
-
- /**
- * Event simple click on layout resend suscription.
- */
- class ResendListener implements View.OnClickListener {
-
- /**
- * Constructor.
- */
- public ResendListener() {
- }
-
- @Override
- public void onClick(View v) {
-
- AlertDialog.Builder builder = new AlertDialog.Builder(UserInfo.this);
- builder.setMessage(UserInfo.this.getString(R.string.userinfo_sureresend)).setCancelable(false)
- .setPositiveButton(UserInfo.this.getString(R.string.userinfo_yes),
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- Presence presencePacket = new Presence(Presence.Type.subscribe);
- presencePacket.setTo(mContact.getJID());
- try {
- mXmppFacade.sendPresencePacket(new PresenceAdapter(presencePacket));
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- Toast.makeText(UserInfo.this, getString(R.string.userinfo_resend), Toast.LENGTH_SHORT)
- .show();
- }
- }).setNegativeButton(UserInfo.this.getString(R.string.userinfo_no),
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- dialog.cancel();
- }
- });
- AlertDialog alert = builder.create();
- alert.show();
- }
-
- }
-
- /**
- * Event simple click on layout delete.
- */
- class DeleteListener implements View.OnClickListener {
-
- /**
- * Constructor.
- */
- public DeleteListener() {
- }
-
- @Override
- public void onClick(View v) {
- AlertDialog.Builder builder = new AlertDialog.Builder(UserInfo.this);
- builder.setMessage(UserInfo.this.getString(R.string.userinfo_sure2delete)).setCancelable(false)
- .setPositiveButton(UserInfo.this.getString(R.string.userinfo_yes),
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- try {
- mRoster.deleteContact(mContact);
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- finish();
- }
- }).setNegativeButton(UserInfo.this.getString(R.string.userinfo_no),
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- dialog.cancel();
- }
- });
- AlertDialog alert = builder.create();
- alert.show();
- }
- }
-
- /**
- * The ServiceConnection used to connect to the Beem service.
- */
- private class BeemServiceConnection implements ServiceConnection {
-
- /**
- * Constructor.
- */
- public BeemServiceConnection() {
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void onServiceConnected(ComponentName name, IBinder service) {
- mXmppFacade = IXmppFacade.Stub.asInterface(service);
- mReceiver.setBinded(true);
- try {
- mRoster = mXmppFacade.getRoster();
- mJID = getIntent().getStringExtra("contact_contactdialog");
- mContact = mRoster.getContact(mJID);
- if (mContact.getName() != null)
- mTextAlias.setText(mContact.getName());
- else
- mTextAlias.setText(mContact.getJID());
- mGalleryGroups.setAdapter(new BeemGroups(UserInfo.this, mContact.getGroups()));
- setTitle(mJID);
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void onServiceDisconnected(ComponentName name) {
- mXmppFacade = null;
- }
- }
-}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/ui/dialogs/builders/Alias.java Fri Jan 15 12:02:29 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.ui.dialogs.builders;
+
+import android.app.AlertDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.os.RemoteException;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.EditText;
+
+import com.beem.project.beem.R;
+import com.beem.project.beem.service.Contact;
+import com.beem.project.beem.service.aidl.IRoster;
+
+/**
+ * Create dialog alias.
+ */
+public class Alias extends AlertDialog.Builder {
+
+ private static final String TAG = "Dialogs.Builders > Alias";
+
+ private IRoster mRoster;
+ private Contact mContact;
+ private EditText mEditTextAlias;
+
+ /**
+ * Constructor.
+ * @param context context activity.
+ * @param roster Beem roster.
+ * @param contact the contact to modify.
+ */
+ public Alias(final Context context, final IRoster roster, final Contact contact) {
+ super(context);
+
+ mRoster = roster;
+ mContact = contact;
+
+ LayoutInflater factory = LayoutInflater.from(context);
+ final View textEntryView = factory.inflate(
+ R.layout.contactdialogaliasdialog, null);
+ setTitle(mContact.getJID());
+ setView(textEntryView);
+ mEditTextAlias = (EditText) textEntryView.findViewById(
+ R.id.CDAliasDialogName);
+ mEditTextAlias.setText(mContact.getName());
+ setPositiveButton(R.string.OkButton, new DialogClickListener());
+ setNegativeButton(R.string.CancelButton, new DialogClickListener());
+ }
+
+ /**
+ * Event click listener.
+ */
+ class DialogClickListener implements DialogInterface.OnClickListener {
+
+ /**
+ * Constructor.
+ */
+ public DialogClickListener() {
+ }
+
+
+ @Override
+ public void onClick(final DialogInterface dialog, final int which) {
+ if (which == DialogInterface.BUTTON_POSITIVE) {
+ String name = mEditTextAlias.getText().toString();
+ if (name.length() == 0) {
+ name = mContact.getJID();
+ }
+ try {
+ mRoster.setContactName(mContact.getJID(), name);
+ } 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/dialogs/builders/CreatePrivacyList.java Fri Jan 15 12:02:29 2010 +0100
@@ -0,0 +1,123 @@
+/*
+ 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.ArrayList;
+
+import android.app.AlertDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.os.RemoteException;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.EditText;
+
+import com.beem.project.beem.R;
+import com.beem.project.beem.service.PrivacyListItem;
+import com.beem.project.beem.service.aidl.IPrivacyListManager;
+
+/**
+ * Use this builder to build a dialog which handles a privacy list creation.
+ * @author Jean-Manuel Da Silva <dasilvj at beem-project dot com>
+ */
+public class CreatePrivacyList extends AlertDialog.Builder {
+
+ private static final String TAG = "Dialogs.Builders > CreatePrivacyList";
+
+ private final IPrivacyListManager mPrivacyListManager;
+ private final View mTextEntryView;
+ private EditText mListNameField;
+
+ /**
+ * Constructor.
+ * @param context context activity.
+ */
+ 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);
+ setView(mTextEntryView);
+
+ mPrivacyListManager = privacyListManager;
+ 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());
+ setNegativeButton(R.string.CancelButton, new DialogClickListener());
+ }
+
+ /**
+ * Event click listener.
+ */
+ class DialogClickListener implements DialogInterface.OnClickListener {
+
+ /**
+ * Constructor.
+ */
+ public DialogClickListener() {
+ }
+
+ @Override
+ public void onClick(final DialogInterface dialog, final int which) {
+ if (which == DialogInterface.BUTTON_POSITIVE) {
+ try {
+ Log.d(TAG, "mPrivacyListManager ## " + mPrivacyListManager);
+ Log.d(TAG, "listNameField ## " + mListNameField);
+ Log.d(TAG, "listNameField.getText().toString() ## " + mListNameField.getText().toString());
+ mPrivacyListManager.createPrivacyList(mListNameField.getText().toString(),
+ new ArrayList<PrivacyListItem>());
+ } catch (RemoteException e) {
+ Log.e(TAG, e.getMessage());
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/ui/dialogs/builders/DeleteContact.java Fri Jan 15 12:02:29 2010 +0100
@@ -0,0 +1,102 @@
+/*
+ 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 android.app.AlertDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.os.RemoteException;
+import android.util.Log;
+
+import com.beem.project.beem.R;
+import com.beem.project.beem.service.Contact;
+import com.beem.project.beem.service.aidl.IRoster;
+
+public class DeleteContact extends AlertDialog.Builder {
+
+ private final static String TAG = "Dialogs.Builders > DeleteContact";
+
+ private IRoster mRoster;
+ private Contact mContact;
+
+ /**
+ * Constructor.
+ * @param context context activity.
+ */
+ public DeleteContact(final Context context, final IRoster roster,
+ final Contact contact) {
+ super(context);
+
+ mContact = contact;
+ mRoster = roster;
+
+ setMessage(R.string.userinfo_sure2delete);
+ DialogClickListener dl = new DialogClickListener();
+ setPositiveButton(R.string.userinfo_yes, dl);
+ setNegativeButton(R.string.userinfo_no, dl);
+ }
+
+ /**
+ * Event click listener.
+ */
+ private class DialogClickListener implements DialogInterface.OnClickListener {
+
+ /**
+ * Constructor.
+ */
+ public DialogClickListener() {
+ }
+
+ @Override
+ public void onClick(final DialogInterface dialog, final int which) {
+ if (which == DialogInterface.BUTTON_POSITIVE) {
+ try {
+ mRoster.deleteContact(mContact);
+ } 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/dialogs/builders/DeletePrivacyList.java Fri Jan 15 12:02:29 2010 +0100
@@ -0,0 +1,102 @@
+/*
+ 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 android.app.AlertDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.os.RemoteException;
+import android.util.Log;
+
+import com.beem.project.beem.R;
+import com.beem.project.beem.service.aidl.IPrivacyListManager;
+
+public class DeletePrivacyList extends AlertDialog.Builder {
+
+ private static final String TAG = "Dialogs.Builders > DeletePrivacyList";
+
+ private final IPrivacyListManager mPrivacyListManager;
+ private final String mPrivacyListName;
+
+ /**
+ * Constructor.
+ * @param context context activity.
+ */
+ 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));
+ DialogClickListener dl = new DialogClickListener();
+ setPositiveButton(R.string.privacy_list_delete_dialog_yes, dl);
+ setNegativeButton(R.string.privacy_list_delete_dialog_no, dl);
+ }
+
+ /**
+ * Event click listener.
+ */
+ private class DialogClickListener implements DialogInterface.OnClickListener {
+
+ /**
+ * Constructor.
+ */
+ public DialogClickListener() {
+ }
+
+ @Override
+ public void onClick(final DialogInterface dialog, final int which) {
+ if (which == DialogInterface.BUTTON_POSITIVE) {
+ try {
+ mPrivacyListManager.removePrivacyList(mPrivacyListName);
+ } 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/dialogs/builders/ResendSubscription.java Fri Jan 15 12:02:29 2010 +0100
@@ -0,0 +1,114 @@
+/*
+ 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 org.jivesoftware.smack.packet.Presence;
+
+import android.app.AlertDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.os.RemoteException;
+import android.util.Log;
+import android.widget.Toast;
+
+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.IXmppFacade;
+
+public class ResendSubscription extends AlertDialog.Builder {
+
+ private final static String TAG = "Dialogs.Builders > ResendSubscription";
+
+ private Context mContext;
+ private IXmppFacade mXmppFacade;
+ private Contact mContact;
+
+ /**
+ * Constructor.
+ * @param context context activity
+ */
+ public ResendSubscription(final Context context,
+ final IXmppFacade xmppFacade, final Contact contact) {
+ super(context);
+
+ mContext = context;
+ mXmppFacade = xmppFacade;
+ mContact = contact;
+
+ setMessage(R.string.userinfo_sureresend);
+ DialogClickListener dl = new DialogClickListener();
+ setPositiveButton(R.string.userinfo_yes, dl);
+ setNegativeButton(R.string.userinfo_no, dl);
+ }
+
+ /**
+ * Event click listener.
+ */
+ class DialogClickListener implements DialogInterface.OnClickListener {
+
+ /**
+ * Constructor.
+ */
+ DialogClickListener() {
+ }
+
+ @Override
+ public void onClick(final DialogInterface dialog, final int which) {
+ if (which == DialogInterface.BUTTON_POSITIVE) {
+ 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();
+ } 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/dialogs/builders/package-info.java Fri Jan 15 12:02:29 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 Beem dialog builder's.
+ */
+package com.beem.project.beem.ui.dialogs.builders;
+
--- a/src/com/beem/project/beem/ui/package-info.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/ui/package-info.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,5 +1,47 @@
+/*
+ BEEM is a videoconference application on the Android Platform.
+
+ Copyright (C) 2009 by Frederic-Charles Barthelery,
+ Jean-Manuel Da Silva,
+ Nikita Kozlov,
+ Philippe Lago,
+ Jean Baptiste Vergely,
+ Vincent Veronis.
+
+ This file is part of BEEM.
+
+ BEEM is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ BEEM is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with BEEM. If not, see <http://www.gnu.org/licenses/>.
+
+ Please send bug reports with examples or suggestions to
+ contact@beem-project.com or http://dev.beem-project.com/
+
+ Epitech, hereby disclaims all copyright interest in the program "Beem"
+ written by Frederic-Charles Barthelery,
+ Jean-Manuel Da Silva,
+ Nikita Kozlov,
+ Philippe Lago,
+ Jean Baptiste Vergely,
+ Vincent Veronis.
+
+ Nicolas Sadirac, November 26, 2009
+ President of Epitech.
+
+ Flavien Astraud, November 26, 2009
+ Head of the EIP Laboratory.
+*/
/**
- * This package contains the class concerning the user interface (activities) of Beem.
+ * This package contains the different activity displayed by BEEM and other class useful to make the UI.
*/
package com.beem.project.beem.ui;
--- a/src/com/beem/project/beem/utils/BeemBroadcastReceiver.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/utils/BeemBroadcastReceiver.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,14 +1,56 @@
+/*
+ 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.utils;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
-import android.content.ServiceConnection;
-import android.util.Log;
+import android.net.ConnectivityManager;
import android.widget.Toast;
-import com.beem.project.beem.ui.Login;
+import com.beem.project.beem.BeemService;
/**
* Manage broadcast disconnect intent.
@@ -16,55 +58,33 @@
*/
public class BeemBroadcastReceiver extends BroadcastReceiver {
- /**
- * Broadcast intent type.
- */
+ /** Broadcast intent type. */
public static final String BEEM_CONNECTION_CLOSED = "BeemConnectionClosed";
- private ServiceConnection mService;
- private boolean mIsBinded;
/**
* constructor.
- * @param service service observed
*/
- public BeemBroadcastReceiver(final ServiceConnection service) {
- mService = service;
- mIsBinded = false;
+ public BeemBroadcastReceiver() {
}
/**
* {@inheritDoc}
*/
@Override
- public void onReceive(Context context, Intent intent) {
- Log.d("Broadcast", "onReceive");
- if (mIsBinded)
- context.unbindService(mService);
- setBinded(false);
- // start activity if unexpected disconnection
- if (!intent.getBooleanExtra("normally", false))
- context.startActivity(new Intent(context, Login.class));
- CharSequence message = intent.getCharSequenceExtra("message");
- Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
- if (context instanceof Activity) {
- Activity act = (Activity) context;
- act.finish();
+ public void onReceive(final Context context, final Intent intent) {
+ String intentAction = intent.getAction();
+ if (intentAction.equals(BEEM_CONNECTION_CLOSED)) {
+ CharSequence message = intent.getCharSequenceExtra("message");
+ Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
+ if (context instanceof Activity) {
+ Activity act = (Activity) context;
+ act.finish();
+ // The service will be unbinded in the destroy of the activity.
+ }
+ } else if (intentAction.equals(ConnectivityManager.CONNECTIVITY_ACTION)) {
+ if (intent.getBooleanExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY, false)) {
+ context.stopService(new Intent(context, BeemService.class));
+ }
}
}
-
- /**
- * service is binded.
- * @param binded the state of the bind.
- */
- public void setBinded(boolean binded) {
- mIsBinded = binded;
- }
-
- /**
- * return service bind status.
- * @return service bind status.
- */
- public boolean isBinded() {
- return mIsBinded;
- }
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/utils/BeemConnectivity.java Fri Jan 15 12:02:29 2010 +0100
@@ -0,0 +1,117 @@
+/*
+ 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.utils;
+
+import android.content.Context;
+import android.net.ConnectivityManager;
+import android.net.NetworkInfo;
+import android.net.NetworkInfo.DetailedState;
+import android.net.wifi.WifiInfo;
+import android.net.wifi.WifiManager;
+import android.telephony.TelephonyManager;
+
+/**
+ * The Class BeemConnectivity.
+ */
+public final class BeemConnectivity {
+
+ /**
+ * Private constructor to forbid instantiation.
+ */
+ private BeemConnectivity() { }
+
+ /**
+ * Checks if is connected.
+ * @param ctx the ctx
+ * @return true, if is connected
+ */
+ public static boolean isConnected(final Context ctx) {
+ ConnectivityManager cm = (ConnectivityManager) ctx.getSystemService(
+ Context.CONNECTIVITY_SERVICE);
+ NetworkInfo ni = cm.getActiveNetworkInfo();
+ return ni != null && ni.isConnected();
+ }
+
+ /**
+ * Checks if is wifi.
+ * @param ctx the ctx
+ * @return true, if is wifi
+ */
+ public static boolean isWifi(final Context ctx) {
+ WifiManager wm = (WifiManager) ctx.getSystemService(
+ Context.WIFI_SERVICE);
+ WifiInfo wi = wm.getConnectionInfo();
+ if (wi != null
+ && (WifiInfo.getDetailedStateOf(wi.getSupplicantState())
+ == DetailedState.OBTAINING_IPADDR
+ || WifiInfo.getDetailedStateOf(wi.getSupplicantState())
+ == DetailedState.CONNECTED)) {
+ return false;
+ }
+ return false;
+ }
+
+ /**
+ * Checks if is umts.
+ * @param ctx the ctx
+ * @return true, if is umts
+ */
+ public static boolean isUmts(final Context ctx) {
+ TelephonyManager tm = (TelephonyManager) ctx.getSystemService(
+ Context.TELEPHONY_SERVICE);
+ return tm.getNetworkType() >= TelephonyManager.NETWORK_TYPE_UMTS;
+ }
+
+ /**
+ * Checks if is edge.
+ * @param ctx the ctx
+ * @return true, if is edge
+ */
+ public static boolean isEdge(final Context ctx) {
+ TelephonyManager tm = (TelephonyManager) ctx.getSystemService(
+ Context.TELEPHONY_SERVICE);
+ return tm.getNetworkType() == TelephonyManager.NETWORK_TYPE_EDGE;
+ }
+
+}
--- a/src/com/beem/project/beem/utils/FreePort.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/utils/FreePort.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,3 +1,46 @@
+/*
+ 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.utils;
import java.io.IOException;
--- a/src/com/beem/project/beem/utils/PresenceType.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/utils/PresenceType.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,6 +1,46 @@
-/**
- *
- */
+/*
+ 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.utils;
import org.jivesoftware.smack.packet.Presence;
@@ -11,40 +51,26 @@
*/
public final class PresenceType {
- /**
- * The user is available to receive messages (default).
- */
+ /** The user is available to receive messages (default). */
public static final int AVAILABLE = 100;
- /**
- * The user is unavailable to receive messages.
- */
+ /** The user is unavailable to receive messages. */
public static final int UNAVAILABLE = 200;
- /**
- * Request subscription to recipient's presence.
- */
+ /** Request subscription to recipient's presence. */
public static final int SUBSCRIBE = 300;
- /**
- * Grant subscription to sender's presence.
- */
+ /** Grant subscription to sender's presence. */
public static final int SUBSCRIBED = 400;
- /**
- * Request removal of subscription to sender's presence.
- */
+ /** Request removal of subscription to sender's presence. */
public static final int UNSUBSCRIBE = 500;
- /**
- * Grant removal of subscription to sender's presence.
- */
+ /** Grant removal of subscription to sender's presence. */
public static final int UNSUBSCRIBED = 600;
- /**
- * The presence packet contains an error message.
- */
+ /** The presence packet contains an error message. */
public static final int ERROR = 701;
/**
@@ -58,7 +84,7 @@
* @param presence the presence type
* @return an int representing the presence type
*/
- public static int getPresenceType(Presence presence) {
+ public static int getPresenceType(final Presence presence) {
int res = PresenceType.ERROR;
switch (presence.getType()) {
case available:
@@ -91,7 +117,7 @@
* @param type the status type in beem
* @return the presence mode to use in presence packet or null if there is no mode to use
*/
- public static Presence.Type getPresenceTypeFrom(int type) {
+ public static Presence.Type getPresenceTypeFrom(final int type) {
Presence.Type res;
switch (type) {
case AVAILABLE:
--- a/src/com/beem/project/beem/utils/Status.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/utils/Status.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,6 +1,46 @@
-/**
- *
- */
+/*
+ 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.utils;
import org.jivesoftware.smack.packet.Presence;
@@ -12,34 +52,22 @@
*/
public final class Status {
- /**
- * Status of a disconnected contact.
- */
+ /** Status of a disconnected contact. */
public static final int CONTACT_STATUS_DISCONNECT = 100;
- /**
- * Status of a unavailable (long away) contact.
- */
+ /** Status of a unavailable (long away) contact. */
public static final int CONTACT_STATUS_UNAVAILABLE = 200;
- /**
- * Status of a away contact.
- */
+ /** Status of a away contact. */
public static final int CONTACT_STATUS_AWAY = 300;
- /**
- * Status of a busy contact.
- */
+ /** Status of a busy contact. */
public static final int CONTACT_STATUS_BUSY = 400;
- /**
- * Status of a available contact.
- */
+ /** Status of a available contact. */
public static final int CONTACT_STATUS_AVAILABLE = 500;
- /**
- * Status of a available for chat contact.
- */
+ /** Status of a available for chat contact. */
public static final int CONTACT_STATUS_AVAILABLE_FOR_CHAT = 600;
/**
@@ -53,7 +81,7 @@
* @param status the status in beem
* @return the presence mode to use in presence packet or null if there is no mode to use
*/
- public static Presence.Mode getPresenceModeFromStatus(int status) {
+ public static Presence.Mode getPresenceModeFromStatus(final int status) {
Presence.Mode res;
switch (status) {
case CONTACT_STATUS_AVAILABLE:
@@ -82,7 +110,7 @@
* @param presence the presence containing status
* @return an int representing the status
*/
- public static int getStatusFromPresence(Presence presence) {
+ public static int getStatusFromPresence(final Presence presence) {
int res = Status.CONTACT_STATUS_DISCONNECT;
if (presence.getType().equals(Presence.Type.unavailable)) {
res = Status.CONTACT_STATUS_DISCONNECT;
@@ -121,8 +149,8 @@
* @param status contact status
* @return is obline
*/
- public static boolean statusOnline(int status) {
- return (status != Status.CONTACT_STATUS_DISCONNECT && status != Status.CONTACT_STATUS_UNAVAILABLE);
+ public static boolean statusOnline(final int status) {
+ return status != Status.CONTACT_STATUS_DISCONNECT && status != Status.CONTACT_STATUS_UNAVAILABLE;
}
}
--- a/src/com/beem/project/beem/utils/package-info.java Fri Jan 15 11:58:04 2010 +0100
+++ b/src/com/beem/project/beem/utils/package-info.java Fri Jan 15 12:02:29 2010 +0100
@@ -1,5 +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 utility class used by the Beem project.
+ * This package contains utility class to deal with various aspect of BEEM.
*/
package com.beem.project.beem.utils;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/JavaHeaderCheck.regex Fri Jan 15 12:02:29 2010 +0100
@@ -0,0 +1,39 @@
+^/\*$
+^ BEEM is a videoconference application on the Android Platform\.$
+^$
+^ Copyright \(C\) \d\d\d\d by .*$
+^ .*$
+^$
+^ 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\.$
+^$
+^\*/$
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/LicenseHeader.txt Fri Jan 15 12:02:29 2010 +0100
@@ -0,0 +1,43 @@
+/*
+ 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.
+
+*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/README Fri Jan 15 12:02:29 2010 +0100
@@ -0,0 +1,14 @@
+This directory contains useful files for the developer.
+
+JavaHeaderCheck.regex
+This file is used by checkstyle to check the header on the java files.
+
+LicenseHeader.txt
+This file contains the header mandatory for all the java files of the project. Lines 29 to 42 are optional.
+
+checkstyle.xml
+This file contains the rules used by checkstyle to verify the conformity of the source code. If you want your code to be accepted by the team, you must pass all the checks.
+
+eclipse_formatter.xml
+This file can be used by Eclipse IDE to configure the code formater.
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/checkstyle.xml Fri Jan 15 12:02:29 2010 +0100
@@ -0,0 +1,325 @@
+<?xml version="1.0"?>
+<!DOCTYPE module PUBLIC
+ "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
+ "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+
+<!--
+
+ Checkstyle configuration that checks the sun coding conventions from:
+
+ - the Java Language Specification at
+ http://java.sun.com/docs/books/jls/second_edition/html/index.html
+
+ - the Sun Code Conventions at http://java.sun.com/docs/codeconv/
+
+ - the Javadoc guidelines at
+ http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
+
+ - the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html
+
+ - some best practices
+
+ Checkstyle is very configurable. Be sure to read the documentation at
+ http://checkstyle.sf.net (or in your downloaded distribution).
+
+ Most Checks are configurable, be sure to consult the documentation.
+
+ To completely disable a check, just comment it out or delete it from the file.
+
+ Finally, it is worth reading the documentation.
+
+-->
+
+<module name="Checker">
+ <!--
+ If you set the basedir property below, then all reported file
+ 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="severity" value="warning"/>
+
+ <!-- Checks that a package-info.java file exists for each package. -->
+ <!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage -->
+ <module name="JavadocPackage">
+ <property name="allowLegacy" value="true"/>
+ </module>
+
+ <!-- Checks whether files end with a new line. -->
+ <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
+ <module name="NewlineAtEndOfFile">
+ <property name="severity" value="error"/>
+ </module>
+
+ <!-- Checks that property files contain the same keys. -->
+ <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
+ <module name="Translation">
+ <property name="severity" value="error"/>
+ </module>
+
+ <!-- Checks for Size Violations. -->
+ <!-- See http://checkstyle.sf.net/config_sizes.html -->
+ <module name="FileLength"/>
+
+ <!-- Checks for whitespace -->
+ <!-- See http://checkstyle.sf.net/config_whitespace.html -->
+ <!-- we want tab
+ <module name="FileTabCharacter"/>
+ -->
+
+ <!-- Miscellaneous other checks. -->
+ <!-- See http://checkstyle.sf.net/config_misc.html -->
+ <module name="RegexpSingleline">
+ <property name="severity" value="error"/>
+ <property name="format" value="\s+$"/>
+ <property name="minimum" value="0"/>
+ <property name="maximum" value="0"/>
+ <property name="message" value="Line has trailing spaces."/>
+ </module>
+
+ <!-- This rules is desactivated because it is too stupid.
+ It also compare the Header of the file.
+ <module name="StrictDuplicateCode">
+ <property name="min" value="25" />
+ </module>
+ -->
+
+ <!-- Header file -->
+ <module name="RegexpHeader">
+ <property name="headerFile" value="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>
+
+ <module name="TreeWalker">
+
+ <!-- Checks for Javadoc comments. -->
+ <!-- See http://checkstyle.sf.net/config_javadoc.html -->
+ <module name="JavadocMethod">
+ <property name="allowUndeclaredRTE" value="true"/>
+ <property name="severity" value="error"/>
+ </module>
+ <module name="JavadocType">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="JavadocVariable">
+ <property name="scope" value="package" />
+ <property name="severity" value="error"/>
+ </module>
+ <module name="JavadocStyle">
+ <property name="checkEmptyJavadoc" value="true"/>
+ <property name="severity" value="error"/>
+ </module>
+
+
+ <!-- Checks for Naming Conventions. -->
+ <!-- See http://checkstyle.sf.net/config_naming.html -->
+ <module name="ConstantName"/>
+ <module name="LocalFinalVariableName"/>
+ <module name="LocalVariableName"/>
+ <module name="MemberName">
+ <property name="format" value="^m[A-Z][a-zA-Z0-9]*$"/>
+ <property name="severity" value="error"/>
+ </module>
+ <module name="MethodName"/>
+ <module name="PackageName"/>
+ <module name="ParameterName"/>
+ <module name="StaticVariableName"/>
+ <module name="TypeName"/>
+
+
+ <!-- Checks for Headers -->
+ <!-- See http://checkstyle.sf.net/config_header.html -->
+ <!-- <module name="Header"> -->
+ <!-- The follow property value demonstrates the ability -->
+ <!-- to have access to ANT properties. In this case it uses -->
+ <!-- the ${basedir} property to allow Checkstyle to be run -->
+ <!-- from any directory within a project. See property -->
+ <!-- expansion, -->
+ <!-- http://checkstyle.sf.net/config.html#properties -->
+ <!-- <property -->
+ <!-- name="headerFile" -->
+ <!-- value="${basedir}/java.header"/> -->
+ <!-- </module> -->
+
+ <!-- Checks for imports -->
+ <!-- See http://checkstyle.sf.net/config_import.html -->
+ <module name="AvoidStarImport"/>
+ <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
+ <module name="RedundantImport"/>
+ <module name="UnusedImports">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="AvoidStaticImport">
+ <property name="excludes" value="*"/>
+ </module>
+
+
+ <!-- Checks for Size Violations. -->
+ <!-- See http://checkstyle.sf.net/config_sizes.html -->
+ <module name="LineLength">
+ <property name="max" value="120" />
+ </module>
+ <module name="MethodLength"/>
+ <module name="ParameterNumber"/>
+ <module name="AnonInnerLength">
+ <property name="max" value="60" />
+ </module>
+
+
+ <!-- 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="OperatorWrap"/>
+ <module name="ParenPad"/>
+ <module name="TypecastParenPad"/>
+ <!-- We want mixed tabulation
+ <module name="TabCharacter"/>
+ -->
+ <module name="WhitespaceAfter"/>
+ <module name="WhitespaceAround"/>
+
+
+ <!-- Modifier Checks -->
+ <!-- See http://checkstyle.sf.net/config_modifiers.html -->
+ <module name="ModifierOrder">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="RedundantModifier">
+ <property name="severity" value="error"/>
+ </module>
+
+
+ <!-- Checks for blocks. You know, those {}'s -->
+ <!-- See http://checkstyle.sf.net/config_blocks.html -->
+ <module name="AvoidNestedBlocks"/>
+ <module name="EmptyBlock"/>
+ <module name="LeftCurly">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="RightCurly">
+ <property name="severity" value="error"/>
+ </module>
+ <!--
+ <module name="NeedBraces"/>
+ -->
+
+ <!-- Check for annotations
+ http://checkstyle.sourceforge.net/config_annotation.html#MissingDeprecated
+ -->
+ <module name="AnnotationUseStyle">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="MissingDeprecated">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="MissingOverride">
+ <property name="severity" value="error"/>
+ </module>
+
+ <!-- Checks for common coding problems -->
+ <!-- See http://checkstyle.sf.net/config_coding.html -->
+ <module name="CovariantEquals"/>
+ <module name="AvoidInlineConditionals"/>
+ <module name="InnerAssignment" />
+ <module name="DoubleCheckedLocking"/> <!-- MY FAVOURITE -->
+ <module name="EmptyStatement"/>
+ <module name="EqualsHashCode">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="HiddenField">
+ <property name="ignoreConstructorParameter" value="true"/>
+ <property name="ignoreAbstractMethods" value="true"/>
+ <property name="ignoreSetter" value="true"/>
+ </module>
+ <module name="IllegalInstantiation"/>
+ <module name="InnerAssignment">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="MagicNumber"/>
+ <module name="MissingSwitchDefault">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="RedundantThrows"/>
+ <module name="SimplifyBooleanExpression">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="SimplifyBooleanReturn">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="StringLiteralEquality">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="IllegalCatch"/>
+ <module name="IllegalThrows"/>
+ <module name="IllegalType"/>
+ <module name="PackageDeclaration"/>
+ <module name="JUnitTestCase"/>
+ <module name="DeclarationOrder">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="ExplicitInitialization"/>
+ <module name="DefaultComesLast"/>
+ <module name="MissingCtor"/>
+ <module name="FallThrough"/>
+ <module name="MultipleStringLiterals">
+ <property name="allowedDuplicates" value="2"/>
+ </module>
+ <module name="MultipleVariableDeclarations"/>
+ <module name="UnnecessaryParentheses"/>
+ <module name="ParameterAssignment"/>
+ <module name="EqualsAvoidNull">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="NoClone"/>
+ <module name="NoFinalizer"/>
+ <module name="SuperClone"/>
+ <module name="SuperFinalize"/>
+ <module name="ModifiedControlVariable">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="ReturnCount">
+ <property name="max" value="3"/>
+ </module>
+
+ <!-- Checks for class design -->
+ <!-- See http://checkstyle.sf.net/config_design.html -->
+ <!--
+ <module name="DesignForExtension"/>
+ -->
+ <module name="FinalClass"/>
+ <module name="HideUtilityClassConstructor"/>
+ <!--
+ <module name="InterfaceIsType"/>
+ -->
+ <module name="VisibilityModifier"/>
+ <module name="MutableException"/>
+ <module name="ThrowsCount">
+ <property name="max" value="2" />
+ </module>
+
+
+ <!-- Miscellaneous other checks. -->
+ <!-- See http://checkstyle.sf.net/config_misc.html -->
+ <module name="ArrayTypeStyle"/>
+ <module name="FinalParameters">
+ <property name="tokens" value="CTOR_DEF"/>
+ </module>
+ <module name="Indentation"/>
+
+ <module name="TodoComment"/>
+ <module name="UpperEll"/>
+
+ <module name="BooleanExpressionComplexity"/>
+ <module name="UpperEll"/>
+
+ <module name="ArrayTypeStyle"/>
+
+ </module>
+
+</module>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/eclipse_formatter.xml Fri Jan 15 12:02:29 2010 +0100
@@ -0,0 +1,269 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<profiles version="11">
+<profile kind="CodeFormatterProfile" name="Eclipse [good tabsize]" version="11">
+<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
+<setting id="org.eclipse.jdt.core.compiler.source" value="1.5"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
+<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="mixed"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="8"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.5"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
+<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.5"/>
+<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
+</profile>
+</profiles>