# HG changeset patch # User dasilvj # Date 1256918692 -3600 # Node ID eb6f1fbea903ed89723812616aff26534516be23 # Parent 7782f6193322b57ea39ad18c8af924f41c856944 Premier jet de l'activite chat, devant remplacer par la suite SendIM. diff -r 7782f6193322 -r eb6f1fbea903 AndroidManifest.xml --- a/AndroidManifest.xml Fri Oct 30 16:24:59 2009 +0100 +++ b/AndroidManifest.xml Fri Oct 30 17:04:52 2009 +0100 @@ -28,6 +28,12 @@ android:name="com.beem.project.beem.service.XmppConnectionAdapter.CONNECTION_CLOSED" /> + + + + + + + + + + + + + + + + + + + diff -r 7782f6193322 -r eb6f1fbea903 res/values-en/strings.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/res/values-en/strings.xml Fri Oct 30 17:04:52 2009 +0100 @@ -0,0 +1,252 @@ + + + Beem + Ok + Clear + Cancel + Accept + Refuse + + + Jabber ID + + + Connecting... + + + Use Beem Service + Beem Service Created + Beem Service Destroyed + + + Status + status_text + preference_is_configured + + + + Server connection + User id: + Password: + Service: + Port: + Proxy informations + Login: + Ok + + + Chat + Call + Manage User + + + Beem - Add contact + + Login : + Alias : + Group : + Ok + Contact added + Error Contact not added + Error Login + Bad form + Contact already exist + + + Beem - Chat + + %s says :\n%s\n + You say :\n%s\n + %s\n + Tip text here + Is : + Error : %s\n + and is speaking from : + Insert a smiley + login + No status set + + + Type here your status message : + + Beem - Change status + Add new contact + Beem Project + Create account + Edit account + Updating status + Nothing to change + + + Modify my username + Modify my password + Using Gmail + Use my Gmail account + Proxy + Use a proxy server + Check this box if you\'re behind a proxy server + Protocol + Choose the proxy server type + Address definition of the proxy server + Port definition of the proxy server + Optional, allow to authenticate yourself on the proxy server + Optional, allow to authenticate yourself on the proxy server + Advanced + Use specific server option + Modify reconnection delay + Check this box if you want to use a specific server for your connection + Allow to edit the server address + Allow to edit the server port + + + Subscription accepted + Subscription error + Subscription refused + You have received a request for add by %s. Do you want to accept it ? + + + Not connected + + + You\'ve got a new message + + + You have been disconnected + + + Accept contact request + Accept contact request from + + + + + Beem - Login Activity + Beem - Settings + Beem - EditSettings Activity + Beem - Create an account + Beem - CreateAccount Activity + Beem - Contacts + Beem - ContactList Activity + Beem - User Info + + + + Reset + Login + Save + Create this account + Create and log + + + + Username + Password + Login - Error + Close + Create an account + Settings + About + About + + Beem is an EPITECH Innovative Project. Visit us at http://www.beem-project.com ! + + Close + Settings + Log in + Connecting. Please wait... + Unfortunately, an error occured.\n\nError detail:\n%s + + + Create an account + Login + The settings have been saved successfully. + beem_settings + Reconnection delay + beem_account_username + beem_account_password + beem_xmpp_server + beem_xmpp_port + beem_xmpp_tls_use + beem_xmpp_proxy_use + beem_xmpp_proxy_server + beem_xmpp_proxy_port + beem_xmpp_proxy_username + beem_xmpp_proxy_password + beem_xmpp_proxy_type + + + edit_settings_tab_account + Account + edit_settings_tab_xmpp + XMPP + edit_settings_tab_proxy + Proxy + + + Username + Password + Server + Port + + + Server + Port + Require SSL/TLS + + + Connect using a proxy + Choose a type of proxy + Server + Port + Username + Password + + + Create an account - Instructions + Create an account - Error + Change my settings + Close + has been created successfully + Bad JabberID + Passwords do not match. + Username + Password + Confirm password + + + Add a contact + Settings + All contacts + No group + + + Alias + Manage groups + Resend invit + Block + Delete + Suscription resend + Are you sure you want to delete this contact? + Yes + No + Are you sure you want to resend invit? + +Beem - Chat +Type your message + diff -r 7782f6193322 -r eb6f1fbea903 res/values-fr/strings.xml --- a/res/values-fr/strings.xml Fri Oct 30 16:24:59 2009 +0100 +++ b/res/values-fr/strings.xml Fri Oct 30 17:04:52 2009 +0100 @@ -246,4 +246,6 @@ Oui Non Etes vous sûr de vouloir renvoyer l\'invitation ? +Saisissez votre message +Beem - Chat diff -r 7782f6193322 -r eb6f1fbea903 src/com/beem/project/beem/ui/Chat.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/com/beem/project/beem/ui/Chat.java Fri Oct 30 17:04:52 2009 +0100 @@ -0,0 +1,180 @@ +package com.beem.project.beem.ui; + +import java.util.List; + +import android.app.Activity; +import android.content.ComponentName; +import android.content.Intent; +import android.content.IntentFilter; +import android.content.ServiceConnection; +import android.os.Bundle; +import android.os.Handler; +import android.os.IBinder; +import android.os.RemoteException; +import android.util.Log; +import android.widget.EditText; +import android.widget.TextView; + +import com.beem.project.beem.R; +import com.beem.project.beem.service.Contact; +import com.beem.project.beem.service.Message; +import com.beem.project.beem.service.PresenceAdapter; +import com.beem.project.beem.service.aidl.IBeemRosterListener; +import com.beem.project.beem.service.aidl.IChat; +import com.beem.project.beem.service.aidl.IMessageListener; +import com.beem.project.beem.service.aidl.IRoster; +import com.beem.project.beem.service.aidl.IXmppFacade; +import com.beem.project.beem.utils.BeemBroadcastReceiver; + +public class Chat extends Activity { + + private static final String TAG = "Chat"; + private static final Intent SERVICE_INTENT = new Intent(); + static { + SERVICE_INTENT.setComponent(new ComponentName("com.beem.project.beem", "com.beem.project.beem.BeemService")); + } + + private Handler _handler = new Handler(); + + private IRoster _roster; + private Contact _contact; + + private TextView _contactNameTextView; + private TextView _contactStatusMsgTextView; + private EditText _input; + + private final ServiceConnection _conn = new BeemServiceConnection(); + private BeemBroadcastReceiver _broadcastReceiver; + + + /** + * Constructor. + */ + public Chat() { + super(); + } + + /** + * {@inheritDoc}. + */ + protected void onCreate(Bundle savedBundle) { + super.onCreate(savedBundle); + + _contactNameTextView = (TextView) findViewById(R.id.chat_contact_name); + _contactStatusMsgTextView = (TextView) findViewById(R.id.chat_contact_status_msg); + + setContentView(R.layout.chat); + + _broadcastReceiver = new BeemBroadcastReceiver(_conn); + this.registerReceiver(_broadcastReceiver, new IntentFilter(BeemBroadcastReceiver.BEEM_CONNECTION_CLOSED)); + } + + /** + * {@inheritDoc}. + */ + protected void onDestroy() { + super.onDestroy(); + this.unregisterReceiver(_broadcastReceiver); + } + + /** + * {@inheritDoc}. + */ + protected void onStart() { + super.onStart(); + } + + /** + * {@inheritDoc}. + */ + protected void onStop() { + super.onStop(); + } + + protected void onNewIntent(Intent intent) { + super.onNewIntent(intent); + + _contact = new Contact(intent.getData()); + } + + /** + * + * @author Jamu + * + */ + private final class BeemServiceConnection implements ServiceConnection { + + private IXmppFacade _xmppFacade; + + @Override + public void onServiceConnected(ComponentName name, IBinder service) { + _xmppFacade = IXmppFacade.Stub.asInterface(service); + _broadcastReceiver.setBinded(true); + try { + _roster = _xmppFacade.getRoster(); + } catch (RemoteException e) { + Log.e(TAG, e.getMessage()); + } + } + + @Override + public void onServiceDisconnected(ComponentName name) { + _xmppFacade = null; + _broadcastReceiver.setBinded(false); + } + } + + + /** + * + * @author Jamu + * + */ + private class BeemRosterListener extends IBeemRosterListener.Stub { + + @Override + public void onEntriesAdded(List addresses) throws RemoteException { + // Nothing to do + } + + @Override + public void onEntriesDeleted(List addresses) throws RemoteException { + // Nothing to do + } + + @Override + public void onEntriesUpdated(List addresses) throws RemoteException { + // Nothing to do + } + + @Override + public void onEntryDeleteFromGroup(String group, String jid) throws RemoteException { + // Nothing to do + } + + @Override + public void onPresenceChanged(PresenceAdapter presence) throws RemoteException { + // TODO Auto-generated method stub + + } + } + + /** + * + * @author Jamu + * + */ + private class OnMessageListener extends IMessageListener.Stub { + + @Override + public void processMessage(IChat chat, Message msg) throws RemoteException { + // TODO Auto-generated method stub + } + + @Override + public void stateChanged(IChat chat) throws RemoteException { + // TODO Auto-generated method stub + + } + } +}