Esempio n. 1
0
 public void StartSignalling()
 {
     if (this.App.Xmpp == null)
     {
         return;
     }
     SignallingStarted = true;
     App.StartSignalling((error) =>
     {
         if (error != null)
         {
             BaseAppCompatActivity o = (BaseAppCompatActivity)context;
             o.Alert(error);
         }
     });
 }
Esempio n. 2
0
        public void init(Context context)
        {
            App                 = App.Instance;
            this.context        = context;
            connectivityManager = (ConnectivityManager)
                                  context.GetSystemService(Context.ConnectivityService);

            if (appPreferences == null)
            {
                appPreferences = new AppPreferences(Application.Context);
            }
            if (userService == null)
            {
                userService = new UserService(appPreferences);
            }
            userRecentsAndGroups = LegionUtils.getGroupsTempToList(AppPreferences.GROUPS_TEMP, appPreferences);

            if (Username != null && Password != null)
            {
                if (IsOnline())
                {
                    if (IS_TRY_CONNECT)
                    {
                        if (App.Xmpp != null)
                        {
                            App.Xmpp.Connect();
                        }
                        else
                        {
                            loadXmppConnect();
                        }
                    }
                    else
                    {
                        loadXmppConnect();
                    }
                }
                else
                {
                    BaseAppCompatActivity o = (BaseAppCompatActivity)context;
                    o.Alert("You are Offline!");
                }
            }

            StartSignalling();
        }