src/com/beem/project/beem/BeemService.java
changeset 140 f36049828552
parent 133 190a55f30e11
parent 115 59c052ee1c90
child 145 70b67bdac4fc
child 147 472d56ba57c6
equal deleted inserted replaced
135:efdae5f9289f 140:f36049828552
    76 	super.onCreate();
    76 	super.onCreate();
    77 	mSettings = getSharedPreferences(getString(R.string.PreferenceFileName), MODE_PRIVATE);
    77 	mSettings = getSharedPreferences(getString(R.string.PreferenceFileName), MODE_PRIVATE);
    78 	mLogin = mSettings.getString(getString(R.string.PreferenceLoginKey), "");
    78 	mLogin = mSettings.getString(getString(R.string.PreferenceLoginKey), "");
    79 	mPassword = mSettings.getString(getString(R.string.PreferencePasswordKey), "");
    79 	mPassword = mSettings.getString(getString(R.string.PreferencePasswordKey), "");
    80 	mHost = mSettings.getString(getString(R.string.PreferenceHostKey), "");
    80 	mHost = mSettings.getString(getString(R.string.PreferenceHostKey), "");
       
    81 	// TODO penser a commenter
    81 	mHost = "10.0.2.2";
    82 	mHost = "10.0.2.2";
    82 	initConnectionConfig();
    83 	initConnectionConfig();
    83 	mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
    84 	mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
    84 	mConnection = new XmppConnectionAdapter(mConnectionConfiguration, mLogin, mPassword, this);
    85 	mConnection = new XmppConnectionAdapter(mConnectionConfiguration, mLogin, mPassword, this);
    85 	initRosterRequestListener();
    86 	initRosterRequestListener();
   127 	    String stype = mSettings.getString(getString(R.string.PreferenceProxyType),
   128 	    String stype = mSettings.getString(getString(R.string.PreferenceProxyType),
   128 		getString(R.string.PreferenceProxyTypeHttp));
   129 		getString(R.string.PreferenceProxyTypeHttp));
   129 	    String phost = mSettings.getString(getString(R.string.PreferenceProxyHost), "");
   130 	    String phost = mSettings.getString(getString(R.string.PreferenceProxyHost), "");
   130 	    String puser = mSettings.getString(getString(R.string.PreferenceProxyUser), "");
   131 	    String puser = mSettings.getString(getString(R.string.PreferenceProxyUser), "");
   131 	    String ppass = mSettings.getString(getString(R.string.PreferenceProxyPassword), "");
   132 	    String ppass = mSettings.getString(getString(R.string.PreferenceProxyPassword), "");
   132 	    int pport =  mSettings.getInt(getString(R.string.PreferenceProxyPort), 3128);
   133 	    int pport =  mSettings.getInt(getString(R.string.PreferenceProxyPort), 1080);
   133 	    ProxyInfo.ProxyType type = ProxyType.valueOf(stype);
   134 	    ProxyInfo.ProxyType type = ProxyType.valueOf(stype);
   134 	    mProxyInfo = new ProxyInfo(type, phost, pport, puser, ppass);
   135 	    mProxyInfo = new ProxyInfo(type, phost, pport, puser, ppass);
   135 	    mConnectionConfiguration = new ConnectionConfiguration(mHost, mProxyInfo);
   136 	    mConnectionConfiguration = new ConnectionConfiguration(mHost, mProxyInfo);
   136 	} else {
   137 	} else {
   137 	    mConnectionConfiguration = new ConnectionConfiguration(mHost);
   138 	    mConnectionConfiguration = new ConnectionConfiguration(mHost);