# HG changeset patch # User Da Risk # Date 1274275685 -7200 # Node ID ebc57b51acf2b74bf4ad32143e90455588c9652d # Parent af1c21ab7ab9291d9bff17829b1e691a7c413e48# Parent a892ea0075a56f7f3b15c728221f9e6d66c06e75 merge diff -r a892ea0075a5 -r ebc57b51acf2 res/layout/preferences.xml --- a/res/layout/preferences.xml Fri May 07 22:19:19 2010 +0200 +++ b/res/layout/preferences.xml Wed May 19 15:28:05 2010 +0200 @@ -25,11 +25,11 @@ android:hint="@string/away_message_hint" /> - + @@ -56,31 +56,31 @@ android:summary="@string/settings_proxy_sum"> + android:key="proxy_use" /> - + android:key="proxy_type" /> + android:key="proxy_server" /> + android:key="proxy_port" android:numeric="signed" android:hint="@string/comments_proxy_port" /> + android:key="proxy_username" /> + android:title="@string/settings_proxy_password" android:key="proxy_password" /> + Beem Ok Löschen Abbrechen Authorisieren Ablehnen + + Passwort Jabber ID @@ -51,7 +54,6 @@ Mein Status Meine persönliche Nachricht Kontaktliste öffnen - Kontakt hinzufügen Beem Project @@ -82,6 +84,44 @@ Priorität XMPP Ressource des Clients einstellen Priorität des Clients einstellen + Kontaktliste + Anzeigeoptionen der Kontaktliste + Gruppen verstecken + Aktivieren, um Gruppen zu verstecken + Kontakte verstecken + Aktivieren, um Kontakte zu verstecken, die offline sind + Benutzername + beem@beem-project.com + Passwort + Server + Port + Verhalten des Dienstes + Erweiterte Einstellungen für fortgeschrittene Benutzer + Adresse + example.com + Port + Verwende SSL/TLS + Verzögerung bei der Wiederverbindung + Standard: 5222 + Einstellungen für das Benutzen eines Proxyservers + Benutze einen Proxyserver + Art des Proxyservers wählen + Server + Port + Standard: 1080 + Benutzername + Passwort + Aktiviere automatische Abwesenheit + Status auf Abwesend wenn Bildschirm aus + Abwesendheitsnachricht + Angezeigte Abwesendheitsnachricht + Ich bin abwesend, mein Telefonbildschirm ist aus + Benachrichtigungseinstellungen + Vibrieren + Aktivieren Sie vibriert bei eingehenden Nachrichten + Nachrichtensignalton + Lege den Signalton für eingehende Nachrichten fest + Zustimmung angenommen @@ -129,17 +169,13 @@ Einstellungen Über Beem %s - Über - - Beem ist ein EPITECH Innovative Projekt. Besuche uns auf - http://www.beem-project.com ! - + Beem ist ein EPITECH Innovative Projekt. Besuche uns auf http://www.beem-project.com ! Schließen Einstellungen Anmelden Verbinden. Bitte warten... Maximaler Wiederholungsversuch - Leider trat ein Fehler auf.\n\nFehler - Detail:\n%s + Leider trat ein Fehler auf.\n\nFehler Detail:\n%s Anmelden Keine Internetverbindung gefunden Konfiguration der Einstellungen im Menü @@ -167,43 +203,12 @@ edit_settings_tab_proxy Proxy - - Kontaktliste - Anzeigeoptionen der Kontaktliste - + + + Du hast noch keinen Jabberaccount konfiguriert. Wähle eine der folgenden Optionen: - Gruppen verstecken - Aktivieren, um Gruppen zu verstecken - Kontakte verstecken - Aktivieren, um Kontakte zu verstecken, die offline sind - - - - Benutzername - beem@beem-project.com - Passwort - Server - Port - - - Verhalten des Dienstes - Erweiterte Einstellungen für fortgeschrittene Benutzer - Adresse - example.com - Port - Verwende SSL/TLS - Verzögerung bei der Wiederverbindung - Standard: 5222 - - - Einstellungen für das Benutzen eines Proxyservers - Benutze einen Proxyserver - Art des Proxyservers wählen - Server - Port - Standard: 1080 - Benutzername - Passwort + Ich habe bereits einen Jabberaccount, den ich benutzen will + Ich möchte einen neuen Account registrieren Konto erstellen - Anweisungen @@ -230,8 +235,7 @@ Sperren Löschen Zustimmung erneut senden - Bist du sicher, dass du diesen Kontakt löschen willst ? - + Bist du sicher, dass du diesen Kontakt löschen willst ? Ja Nein Bist du sicher, dass du die Einladung erneut senden willst ? @@ -246,6 +250,10 @@ Offene Chats Diesen Chat schließen Keine weiteren aktiven Chats + schreibt gerade + hat die Unterhaltung verlassen + verfolgt die Unterhaltung + macht etwas anderes Online Bereit zum Chatten diff -r a892ea0075a5 -r ebc57b51acf2 res/values-fr/strings.xml --- a/res/values-fr/strings.xml Fri May 07 22:19:19 2010 +0200 +++ b/res/values-fr/strings.xml Wed May 19 15:28:05 2010 +0200 @@ -119,8 +119,8 @@ Votre Message d\'absence Je suis absent car mon ecran est éteind Paramètres des notifications - Vibreur - Désactiver le vibreur pour les messages entrants + Activer le vibreur + Activer le vibreur pour les messages entrants Sonnerie des messages Configurer la sonnerie des messages entrants diff -r a892ea0075a5 -r ebc57b51acf2 res/values-ru/arrays.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/res/values-ru/arrays.xml Wed May 19 15:28:05 2010 +0200 @@ -0,0 +1,27 @@ + + + + HTTP + SOCKS4 + SOCKS5 + + + Готов пообщаться + Доступен + Занят + Oтсутствии + Недоступен + Не в сети + + + Собеседники + Groups + Delete + + + Соединение... + Аутентификация... + Логин успешной + Не удалось войти в сеть + + diff -r a892ea0075a5 -r ebc57b51acf2 res/values-ru/strings.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/res/values-ru/strings.xml Wed May 19 15:28:05 2010 +0200 @@ -0,0 +1,315 @@ + + + +Beem +ОК +Очистить +Отмена +Разрешить +Отказать +JID +Пароль + + +JID + + +Соединяемся... + + +Использовать сервис Beem + + + + +Соединение +Имя пользователя: +Пароль: +Сервер: +Порт: +Прокси +Имя пользователя: +ОК + + +Написать +Повонить +Настройки + + +Добавление контакта + +Имя пользователя +Псевдоним +Группа +Добавить +Контакт добавлен +При добавлении контакта возникла ошибка +При выполнении входа возникла ошибка + +Контакт уже добавлен + + +Изменение статуса +Мой статус +Персональное сообщение +Открыть список контактов + +Добавить новый контакт +О проекте Beem +Создать аккаунт +Изменить аккаунт +Обновляем статус... +Ничего не поменялось + + +Имя пользователя +Пароль +Прокси +Использовать прокси + +Протокол +Выберите тип прокси +Сервер +Порт + + +Дополнительно +Дополнительные настройки сервера +Изменить задержку повторного соединения + +Сервер +Порт +Ресурс +Приоритет + + +Список контактов +A set of display options for your buddy list + +Скрывать группы + +Скрывать оффлайн-контакты +Check this option to hide unconnected buddies + +Имя польозвателя + +Пароль +Сервер +Порт + + +Сервер + +Порт +Требовать SSL/TLS + +По умолчанию 5222 + +Соединяться через прокси +Выберите тип проси +Сервер +Порт +По умолчанию 1080 +Имя пользователя +Пароль + + + + + +Настройка оповещений +Вибрация +Активировать вибрировать на входящие сообщения +Сигнал сообщений + + + + + + + + + + + +Не подключен + + +Пришло новое сообщение + + + + + + + + + + +Настройки + +Создать аккаунт + +Контакты + +Информация о пользователе + + +Очистить +Войти +Сохранить + + + + +Имя пользователя +Пароль +Ошибка входа +Закрыть +Создать аккаунт +Настройки +О программе + + +Beem is an EPITECH Innovative Project. Visit us at +http://www.beem-project.com ! + +Закрыть +Настройки +Войти +Соединяемся, подождите немного... + +Unfortunately, an error occured.\n\nError +detail:\n%s +Войти + + + + +Создать аккаунт +Настроить списки приватности + + + + + + + + +Настройки сети +Настройки прокси +Настройки прокси + + + +Аккаунт + +XMPP + +Прокси + + + + + +Использовать существующий аккаунт +Создать новый аккаунт + + + + +Изменить настройки +Закрыть +Аккаунт %s успешно создан +Неправильный JID +Пароли не совпадают +Имя пользователя +Пароль +Ещё раз + + +Добавить контакт +Настройки +Все контакты + + + +Псевдоним +Управление группами +Выслать приглашение ещё раз +Заблокировать +Удалить + +Are you sure you want to delete this contact ? + +Да +Нет + + +Чат + +Я +Ошибка +Отправить +Список контактов + +Открытые чаты +Закрыть этот чат + +набирает текст +покинул чат +вникает в текст +занимается чем-то другим + +Онлайн + +Занят +Отошёл +Недоступен +Оффлайн + +Настройки приватности +Нет списков приватности +Создать список приватности +Создать список приватности +Название +Создать +Контакты +Группы +Удалить + +Да +Нет + +Обновить + + + +Ошибка: неверно указан логин или пароль + +Ошибка сервера + + + + + + + + + + + + + + +Сервер не найден +Сервер не отвечает +Ошибка сервера + + + + + + + diff -r a892ea0075a5 -r ebc57b51acf2 res/values/strings.xml --- a/res/values/strings.xml Fri May 07 22:19:19 2010 +0200 +++ b/res/values/strings.xml Wed May 19 15:28:05 2010 +0200 @@ -119,8 +119,8 @@ The away message that will be displayed I\'m away, my cellphone screen is off Notification settings - Vibrate - Vibrate phone for incoming messages + Enable vibrate + Enable vibrate on incoming messages Message ringtone Set your incoming message ringtone diff -r a892ea0075a5 -r ebc57b51acf2 src/com/beem/project/beem/BeemApplication.java --- a/src/com/beem/project/beem/BeemApplication.java Fri May 07 22:19:19 2010 +0200 +++ b/src/com/beem/project/beem/BeemApplication.java Wed May 19 15:28:05 2010 +0200 @@ -67,6 +67,23 @@ public static final String STATUS_KEY = "status"; /** Preference key for status message. */ public static final String STATUS_TEXT_KEY = "status_text"; + /** Preference key for the use of a proxy */ + public static final String PROXY_USE_KEY = "proxy_use"; + /** Preference key for the type of proxy */ + public static final String PROXY_TYPE_KEY = "proxy_type"; + /** Preference key for the proxy server */ + public static final String PROXY_SERVER_KEY = "proxy_server"; + /** Preference key for the proxy port */ + public static final String PROXY_PORT_KEY = "proxy_port"; + /** Preference key for the proxy username */ + public static final String PROXY_USERNAME_KEY = "proxy_username"; + /** Preference key for the proxy password */ + public static final String PROXY_PASSWORD_KEY = "proxy_password"; + /** Preference key for vibrate on notification */ + public static final String NOTIFICATION_VIBRATE_KEY = "notification_vibrate"; + /** Preference key for notification sound */ + public static final String NOTIFICATION_SOUND_KEY = "notification_sound"; + //TODO add the other one private boolean mIsConnected; diff -r a892ea0075a5 -r ebc57b51acf2 src/com/beem/project/beem/BeemService.java --- a/src/com/beem/project/beem/BeemService.java Fri May 07 22:19:19 2010 +0200 +++ b/src/com/beem/project/beem/BeemService.java Wed May 19 15:28:05 2010 +0200 @@ -64,6 +64,7 @@ import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.net.ConnectivityManager; +import android.net.Uri; import android.os.IBinder; import android.os.RemoteException; import android.preference.PreferenceManager; @@ -77,7 +78,9 @@ import com.beem.project.beem.utils.Status; /** - * This class is for the Beem service. The connection to the xmpp server will be made asynchronously when the service + * This class is for the Beem service. + * It must contains every global informations needed to maintain the background service. + * The connection to the xmpp server will be made asynchronously when the service * will start. * @author darisk */ @@ -119,13 +122,13 @@ * Initialize the connection. */ private void initConnectionConfig() { - mUseProxy = mSettings.getBoolean("settings_key_proxy_use", false); + mUseProxy = mSettings.getBoolean(BeemApplication.PROXY_USE_KEY, false); if (mUseProxy) { - String stype = mSettings.getString("settings_key_proxy_type", "HTTP"); - String phost = mSettings.getString("settings_key_proxy_server", ""); - String puser = mSettings.getString("settings_key_proxy_username", ""); - String ppass = mSettings.getString("settings_key_proxy_password", ""); - int pport = Integer.parseInt(mSettings.getString("settings_key_proxy_port", "1080")); + String stype = mSettings.getString(BeemApplication.PROXY_TYPE_KEY, "HTTP"); + String phost = mSettings.getString(BeemApplication.PROXY_SERVER_KEY, ""); + String puser = mSettings.getString(BeemApplication.PROXY_USERNAME_KEY, ""); + String ppass = mSettings.getString(BeemApplication.PROXY_PASSWORD_KEY, ""); + int pport = Integer.parseInt(mSettings.getString(BeemApplication.PROXY_PORT_KEY, "1080")); ProxyInfo.ProxyType type = ProxyType.valueOf(stype); mProxyInfo = new ProxyInfo(type, phost, pport, puser, ppass); } else { @@ -156,21 +159,16 @@ return mBind; } - /* (non-Javadoc) - * @see android.app.Service#onUnbind(android.content.Intent) - */ @Override public boolean onUnbind(Intent intent) { Log.d(TAG, "ONUNBIND()"); if (!mConnection.getAdaptee().isConnected()) { - Log.d(TAG, "DESTROYED"); this.stopSelf(); } return true; } - /** * {@inheritDoc} */ @@ -220,7 +218,6 @@ @Override public void onDestroy() { super.onDestroy(); - Log.d("Service", "onDestroy"); resetStatus(); mNotificationManager.cancelAll(); unregisterReceiver(mReceiver); @@ -247,11 +244,16 @@ } /** - * Show a notification. + * Show a notification using the preference of the user. * @param id the id of the notification. * @param notif the notification to show */ public void sendNotification(int id, Notification notif) { + if (mSettings.getBoolean(BeemApplication.NOTIFICATION_VIBRATE_KEY, true)) + notif.defaults |= Notification.DEFAULT_VIBRATE; + notif.defaults |= Notification.DEFAULT_LIGHTS; + String ringtoneStr = mSettings.getString(BeemApplication.NOTIFICATION_SOUND_KEY, ""); + notif.sound = Uri.parse(ringtoneStr); mNotificationManager.notify(id, notif); } @@ -397,9 +399,6 @@ public BeemServicePreferenceListener() { } - /** - * {@inheritDoc} - */ @Override public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { if ("settings_away_chk".equals(key)) { @@ -424,14 +423,11 @@ private int mOldMode; /** - * ctor. + * Constructor. */ public BeemServiceBroadcastReceiver() { } - /** - * {@inheritDoc} - */ @Override public void onReceive(final Context context, final Intent intent) { String intentAction = intent.getAction(); diff -r a892ea0075a5 -r ebc57b51acf2 src/com/beem/project/beem/service/BeemChatManager.java --- a/src/com/beem/project/beem/service/BeemChatManager.java Fri May 07 22:19:19 2010 +0200 +++ b/src/com/beem/project/beem/service/BeemChatManager.java Wed May 19 15:28:05 2010 +0200 @@ -75,8 +75,8 @@ * @author darisk */ public class BeemChatManager extends IChatManager.Stub { - /** Tag to use with log methods. */ - public static final String TAG = "BeemChatManager"; + + private static final String TAG = "BeemChatManager"; private final ChatManager mAdaptee; private final Map mChats = new HashMap(); private final ChatListener mChatListener = new ChatListener(); @@ -95,9 +95,6 @@ mAdaptee.addChatListener(mChatListener); } - /** - * {@inheritDoc} - */ @Override public void addChatCreationListener(IChatManagerListener listener) throws RemoteException { if (listener != null) @@ -258,7 +255,7 @@ */ private PendingIntent makeChatIntent(IChat chat) { Intent chatIntent = new Intent(mService, com.beem.project.beem.ui.Chat.class); - chatIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_SINGLE_TOP); + chatIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); try { chatIntent.setData(chat.getParticipant().toUri()); } catch (RemoteException e) { @@ -280,13 +277,9 @@ .getName(); Notification notification = new Notification(android.R.drawable.stat_notify_chat, tickerText, System .currentTimeMillis()); - if (!pref.getBoolean("settings_notification_disable_vibrate", true)) - notification.defaults -= Notification.DEFAULT_VIBRATE; notification.flags = Notification.FLAG_AUTO_CANCEL; notification.setLatestEventInfo(mService, tickerText, mService .getString(R.string.BeemChatManagerNewMessage), makeChatIntent(chat)); - String ringtoneStr = pref.getString("settings_notification_snd", ""); - notification.sound = Uri.parse(ringtoneStr); mService.sendNotification(chat.getParticipant().getJID().hashCode(), notification); } catch (RemoteException e) { Log.e(TAG, e.getMessage()); diff -r a892ea0075a5 -r ebc57b51acf2 src/com/beem/project/beem/service/RosterAdapter.java --- a/src/com/beem/project/beem/service/RosterAdapter.java Fri May 07 22:19:19 2010 +0200 +++ b/src/com/beem/project/beem/service/RosterAdapter.java Wed May 19 15:28:05 2010 +0200 @@ -112,20 +112,6 @@ Log.e(TAG, "Error while adding new contact", e); return null; } - if (groups != null) { - for (String groupStr : groups) { - RosterGroup group = mAdaptee.getGroup(groupStr); - if (group == null) { - group = mAdaptee.createGroup(groupStr); - } - try { - group.addEntry(contact); - } catch (XMPPException e) { - e.printStackTrace(); - return null; - } - } - } return getContactFromRosterEntry(contact); } @@ -147,11 +133,8 @@ */ @Override public void createGroup(String groupname) throws RemoteException { - try { + if (mAdaptee.getGroup(groupname) == null) mAdaptee.createGroup(groupname); - } catch (IllegalArgumentException e) { - Log.v(TAG, "Error while creating group", e); - } } /** @@ -170,16 +153,9 @@ @Override public List getContactList() throws RemoteException { boolean add = true; - List coList = new ArrayList(mAdaptee.getEntries().size()); - for (RosterEntry entry : mAdaptee.getEntries()) { - for (Contact c : coList) { - if (c.getJID().equals(entry.getUser())) { - add = false; - break; - } - } - // Because getEntries return duplicated user. - if (add) + Collection list = mAdaptee.getEntries(); + List coList = new ArrayList(list.size()); + for (RosterEntry entry : list) { coList.add(getContactFromRosterEntry(entry)); } return coList; diff -r a892ea0075a5 -r ebc57b51acf2 src/com/beem/project/beem/service/XmppConnectionAdapter.java --- a/src/com/beem/project/beem/service/XmppConnectionAdapter.java Fri May 07 22:19:19 2010 +0200 +++ b/src/com/beem/project/beem/service/XmppConnectionAdapter.java Wed May 19 15:28:05 2010 +0200 @@ -571,10 +571,10 @@ String from = packet.getFrom(); Notification notif = new Notification(android.R.drawable.stat_notify_more, mService.getString( R.string.AcceptContactRequest, from), System.currentTimeMillis()); - notif.defaults = Notification.DEFAULT_ALL; notif.flags = Notification.FLAG_AUTO_CANCEL; Intent intent = new Intent(mService, Subscription.class); - intent.putExtra("from", from); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) + .putExtra("from", from); notif.setLatestEventInfo(mService, from, mService .getString(R.string.AcceptContactRequestFrom, from), PendingIntent.getActivity(mService, 0, intent, PendingIntent.FLAG_ONE_SHOT)); @@ -620,16 +620,11 @@ if (p.getType() != Presence.Type.subscribe) return; String from = p.getFrom(); - SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(mService); Notification notification = new Notification(android.R.drawable.stat_notify_more, mService.getString( R.string.AcceptContactRequest, from), System.currentTimeMillis()); - if (!pref.getBoolean("settings_notification_disable_vibrate", true)) - notification.defaults -= Notification.DEFAULT_VIBRATE; notification.flags = Notification.FLAG_AUTO_CANCEL; Intent intent = new Intent(mService, Subscription.class); intent.putExtra("from", from); - String ringtoneStr = pref.getString("settings_notification_snd", ""); - notification.sound = Uri.parse(ringtoneStr); notification.setLatestEventInfo(mService, from, mService .getString(R.string.AcceptContactRequestFrom, from), PendingIntent.getActivity(mService, 0, intent, PendingIntent.FLAG_ONE_SHOT)); diff -r a892ea0075a5 -r ebc57b51acf2 src/com/beem/project/beem/ui/Chat.java --- a/src/com/beem/project/beem/ui/Chat.java Fri May 07 22:19:19 2010 +0200 +++ b/src/com/beem/project/beem/ui/Chat.java Wed May 19 15:28:05 2010 +0200 @@ -133,6 +133,7 @@ private final BeemBroadcastReceiver mBroadcastReceiver = new BeemBroadcastReceiver(); private final BeemRosterListener mBeemRosterListener = new BeemRosterListener(); private IXmppFacade mXmppFacade; + private boolean mBinded; /** * Constructor. @@ -174,8 +175,10 @@ protected void onResume() { super.onResume(); mContact = new Contact(getIntent().getData()); - if (mXmppFacade == null) + if (!mBinded) { bindService(SERVICE_INTENT, mConn, BIND_AUTO_CREATE); + mBinded = true; + } } /** @@ -205,8 +208,10 @@ } catch (RemoteException e) { Log.e(TAG, e.getMessage()); } - if (mXmppFacade != null) + if (mBinded) { unbindService(mConn); + mBinded = false; + } mXmppFacade = null; mRoster = null; mChat = null; diff -r a892ea0075a5 -r ebc57b51acf2 src/com/beem/project/beem/ui/ContactList.java --- a/src/com/beem/project/beem/ui/ContactList.java Fri May 07 22:19:19 2010 +0200 +++ b/src/com/beem/project/beem/ui/ContactList.java Wed May 19 15:28:05 2010 +0200 @@ -127,6 +127,7 @@ private IXmppFacade mXmppFacade; private SharedPreferences mSettings; private LayoutInflater mInflater; + private boolean mBinded; /** * Constructor. @@ -289,8 +290,10 @@ @Override protected void onResume() { super.onResume(); - if (mXmppFacade == null) - bindService(SERVICE_INTENT, mServConn, BIND_AUTO_CREATE); + if (!mBinded) { + mBinded = bindService(SERVICE_INTENT, mServConn, BIND_AUTO_CREATE); + Log.d(TAG, "on resume bind = " + mBinded); + } else { if (!mSettings.getBoolean("settings_key_hide_groups", false)) buildBanner(); @@ -314,7 +317,10 @@ } catch (RemoteException e) { Log.d("ContactList", "Remote exception", e); } - unbindService(mServConn); + if (mBinded) { + unbindService(mServConn); + mBinded = false; + } mXmppFacade = null; } diff -r a892ea0075a5 -r ebc57b51acf2 src/com/beem/project/beem/ui/CreateAccount.java --- a/src/com/beem/project/beem/ui/CreateAccount.java Fri May 07 22:19:19 2010 +0200 +++ b/src/com/beem/project/beem/ui/CreateAccount.java Wed May 19 15:28:05 2010 +0200 @@ -172,7 +172,7 @@ * @return Registered proxy password */ private String getRegisteredProxyPassword() { - return mSettings.getString("settings_key_proxy_password", DEFAULT_STRING_VALUE); + return mSettings.getString(BeemApplication.PROXY_PASSWORD_KEY, DEFAULT_STRING_VALUE); } /** @@ -180,7 +180,7 @@ * @return Registered proxy port */ private int getRegisteredProxyPort() { - return Integer.parseInt(mSettings.getString("settings_key_proxy_port", DEFAULT_STRING_VALUE)); + return Integer.parseInt(mSettings.getString(BeemApplication.PROXY_PORT_KEY, DEFAULT_STRING_VALUE)); } /** @@ -188,7 +188,7 @@ * @return Registered proxy server */ private String getRegisteredProxyServer() { - return mSettings.getString("settings_key_proxy_server", DEFAULT_STRING_VALUE); + return mSettings.getString(BeemApplication.PROXY_SERVER_KEY, DEFAULT_STRING_VALUE); } /** @@ -197,8 +197,8 @@ */ private ProxyInfo.ProxyType getRegisteredProxyType() { ProxyInfo.ProxyType result = ProxyInfo.ProxyType.NONE; - if (mSettings.getBoolean("settings_key_proxy_use", false)) { - String type = mSettings.getString("settings_key_proxy_type", "none"); + if (mSettings.getBoolean(BeemApplication.PROXY_USE_KEY, false)) { + String type = mSettings.getString(BeemApplication.PROXY_TYPE_KEY, "none"); if ("HTTP".equals(type)) result = ProxyInfo.ProxyType.HTTP; else if ("SOCKS4".equals(type)) @@ -216,7 +216,7 @@ * @return Registered proxy use */ private boolean getRegisteredProxyUse() { - return mSettings.getBoolean("settings_key_proxy_use", DEFAULT_BOOLEAN_VALUE); + return mSettings.getBoolean(BeemApplication.PROXY_USE_KEY, DEFAULT_BOOLEAN_VALUE); } /** @@ -224,7 +224,7 @@ * @return Registered proxy username */ private String getRegisteredProxyUsername() { - return mSettings.getString("settings_key_proxy_username", DEFAULT_STRING_VALUE); + return mSettings.getString(BeemApplication.PROXY_USERNAME_KEY, DEFAULT_STRING_VALUE); } /**