示例#1
0
 public void getupdate()
 {
     if (MultiHelper.HasInternetConnection())
     {
         RunOnUiThread(() => estado.Text = "Buscando actualizaciones...");
         isonline      = true;
         updateinfo    = new WebClient().DownloadStringTaskAsync("https://raw.githubusercontent.com/Gr3gorywolf/Multitube.android/master/Updates/newversion.json").Result;
         checkedupdate = true;
     }
     else
     {
         isonline = false;
         RunOnUiThread(() =>
         {
             new AlertDialog.Builder(this)
             .SetTitle("Atencion")
             .SetMessage("No tiene conexion a internet.\n podra usar el reproductor offline y acceder a las configuraciones.")
             .SetCancelable(false)
             .SetPositiveButton("Entrar en modo offline", (aa, aaa) => { checkedupdate = true; })
             .SetNegativeButton("Salir", (aa, aaa) => { this.Finish(); })
             .Create()
             .Show();
         });
     }
 }
示例#2
0
        public async void initial_boot()
        {
            setinitialsettings();
            if (SettingsHelper.HasKey("abrirserver"))
            {
                if (SettingsHelper.GetSetting("abrirserver") == "si")
                {
                    if (serviciostreaming.gettearinstancia() != null)
                    {
                        StopService(new Intent(this, typeof(serviciostreaming)));
                        StartService(new Intent(this, typeof(serviciostreaming)));
                    }
                    else
                    {
                        StartService(new Intent(this, typeof(serviciostreaming)));
                    }
                }
            }
            if (!File.Exists(Constants.CachePath + "/verified"))
            {
                if (MultiHelper.HasInternetConnection())
                {
                    string serial = StringsHelper.GenerateSerial();
                    if (Constants.UseFirebase)
                    {
                        var firebase = new FirebaseClient(Constants.FirebaseSuggestionsUrl);
                        await firebase.Child("Descargas").Child(serial).PutAsync("Descargada@" + Android.OS.Build.Model + "@" + System.DateTime.Now);
                    }
                    var arch = File.CreateText(Constants.CachePath + "/verified");
                    arch.Write(serial);
                    arch.Close();
                }
            }

            checkedpremissions = true;
        }