public async void Initialize(IServiceProvider services) { _essentialsBuilder = new EssentialsBuilder(); if (_essentialsRegistrations != null) { foreach (var essentialsRegistration in _essentialsRegistrations) { essentialsRegistration.RegisterEssentialsOptions(_essentialsBuilder); } } #if WINDOWS Platform.MapServiceToken = _essentialsBuilder.MapServiceToken; #endif AppActions.OnAppAction += HandleOnAppAction; try { await AppActions.SetAsync(_essentialsBuilder.AppActions); } catch (FeatureNotSupportedException ex) { services.GetService <ILoggerFactory>()? .CreateLogger <IEssentialsBuilder>()? .LogError(ex, "App Actions are not supported on this platform."); } if (_essentialsBuilder.TrackVersions) { VersionTracking.Track(); } }
protected override void OnInitialized() { InitializeComponent(); Debug.WriteLine("====== resource debug info ========="); var assembly = typeof(App).GetTypeInfo().Assembly; foreach (var res in assembly.GetManifestResourceNames()) { Debug.WriteLine("found resource: " + res); } Debug.WriteLine("===================================="); // This lookup NOT required for Windows platforms - the Culture will be automatically set if (Xamarin.Forms.Device.RuntimePlatform == Xamarin.Forms.Device.iOS || Xamarin.Forms.Device.RuntimePlatform == Xamarin.Forms.Device.Android) { // determine the correct, supported .NET culture DependencyService.Get <ILocalize>(); var ci = DependencyService.Get <ILocalize>().GetCurrentCultureInfo(); // Assets.Strings.AppResources.Culture = ci; // ODO set the RESX for resource localization DependencyService.Get <ILocalize>().SetLocale(ci); // set the Thread for locale-aware methods } // Subscribe to changes of screen metrics DeviceDisplay.MainDisplayInfoChanged += OnMainDisplayInfoChanged; // Update Card widths CardWidths.ResetCardWidths(); VersionTracking.Track(); }
public App() { InitializeComponent(); VersionTracking.Track(); MainPage = new NavigationPage(new HomeView()); }
public void Initialize(IServiceProvider services) { _essentialsBuilder = new EssentialsBuilder(); if (_essentialsRegistrations != null) { foreach (var essentialsRegistration in _essentialsRegistrations) { essentialsRegistration.RegisterEssentialsOptions(_essentialsBuilder); } } #if WINDOWS ApplicationModel.Platform.MapServiceToken = _essentialsBuilder.MapServiceToken; #endif #if !TIZEN AppActions.OnAppAction += HandleOnAppAction; if (_essentialsBuilder.AppActions is not null) { SetAppActions(services, _essentialsBuilder.AppActions); } #endif if (_essentialsBuilder.TrackVersions) { VersionTracking.Track(); } }
/// <summary> /// Initializes a new instance of the App class /// </summary> public App() { VersionTracking.Track(); InitializeContainer(); InitializeComponent(); var culture = CrossMultilingual.Current.DeviceCultureInfo; AppResources.Culture = culture; _splitPage = App.Container.Resolve <ISplitPage>(); if (VersionTracking.IsFirstLaunchForCurrentVersion) { // Navigating to Carousel on first time load var carouselPage = App.Container.Resolve <ICarouselPage>(); MainPage = new NavigationPage(carouselPage as Page); } else { MainPage = new NavigationPage(_splitPage as Page); } }
protected override async void OnStart() { // Handle when your app starts VersionTracking.Track(); // Only start Visual Studio App Center when running in a real-world scenario // which means on a physical device in Release mode and not in a Test cloud // to make sure we have real insights in Visual Studio App Center var environment = DependencyService.Get <IEnvironmentService>(); if (environment.IsRunningInRealWorld()) { AppCenter.Start( Helpers.Constants.AppCenterIOSKey + Helpers.Constants.AppCenterUWPKey + Helpers.Constants.AppCenterAndroidKey, typeof(Analytics), typeof(Crashes), typeof(Push), typeof(Distribute)); // Subscribe to Push Notification Event Push.PushNotificationReceived += PushNotificationReceived; // Track application start Analytics.TrackEvent("App Started", new Dictionary <string, string> { { "Day of week", DateTime.Now.ToString("dddd") } }); } }
protected override async Task NavigateToFirstViewModel(object?hint = null) { // Track versions VersionTracking.Track(); // Setup Cache Barrel.ApplicationId = "soundbyte_cache"; // Ensure premium is loaded await _storeService.InitializeAsync(); // Load any application music providers await _musicProviderService.FindAndLoadAsync(); // Check for updates and update these providers await _musicProviderService.CheckForUpdatesAndInstallAsync(); // If this is the first time the user has ever opened the application var firstLaunch = VersionTracking.IsFirstLaunchEver; // On first launch, run the tutorial if (firstLaunch) { //await NavigationService.Navigate<TutorialViewModel>(); // <!-- TODO await NavigationService.Navigate <RootViewModel>(); } else { // Navigate to the root view model await NavigationService.Navigate <RootViewModel>(); } }
public App() { InitializeComponent(); VersionTracking.Track(); FolderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)); MainPage = new NavigationPage(new MainPage()); }
public App() { InitializeComponent(); VersionTracking.Track(); var logger = new LoggerConfiguration() .WriteTo.File(Path.Combine(FileSystem.AppDataDirectory, "log.txt"), rollingInterval: RollingInterval.Day) .CreateLogger(); string databasePath = Path.Combine(FileSystem.AppDataDirectory, "app.db"); var database = new AppDatabase(databasePath); string userSettingsPath = Path.Combine(FileSystem.AppDataDirectory, "user_settings.json"); var settingsService = new SettingsService(userSettingsPath, logger); var settingsViewModel = new SettingsViewModel(settingsService); DependencyContainer = new Container(); DependencyContainer.RegisterSingleton <ILogger>(() => logger); DependencyContainer.RegisterSingleton(() => database); DependencyContainer.RegisterSingleton(() => settingsService); DependencyContainer.RegisterSingleton(() => settingsViewModel); DependencyContainer.RegisterSingleton <ISettingsViewModel>(() => settingsViewModel); DependencyContainer.RegisterSingleton <ITrackerService, TrackerService>(); DependencyContainer.RegisterSingleton <ITrackerLogService, TrackerLogService>(); DependencyContainer.RegisterSingleton <TrackerViewModel>(); DependencyContainer.RegisterSingleton <ImportViewModel>(); DependencyContainer.RegisterSingleton <ExportViewModel>(); MainPage = new ConductorPage(); }
//ObservableCollection<SideMenu> SideMenus = new ObservableCollection<SideMenu>(); public MainPage() { VersionTracking.Track(); Theme CurTheme = new Theme(); InitializeComponent(); string isDebug = string.Empty; #if DEBUG isDebug = "D"; #endif lblVersion.Text = $"Version: {VersionTracking.CurrentVersion} (Db V: {Util.CurrentDbVersion}) {isDebug}"; this.Detail = new NavigationPage(new Search()) { BarBackgroundColor = Color.FromHex(CurTheme.HeaderColor), BarTextColor = Color.White, }; LoadMenu(); swtLanguage.IsToggled = Util.PrefSelectedLanguage == "P"; bool isAdmin = Util.PrefIsAdmin; if (isAdmin) { imgIsAdmin.Source = ImageSource.FromFile("unlock.png"); } else { imgIsAdmin.Source = ImageSource.FromFile("Lock.png"); } }
/// <summary> /// Configures VersionTracking | RgPluginsPopup | BitCSharpClientControls (DatePicker, Checkbox, RadioButton, Frame) /// </summary> protected virtual void UseDefaultConfiguration() { _useDefaultConfiguration = true; VersionTracking.Track(); Rg.Plugins.Popup.Popup.Init(); BitCSharpClientControls.Init(); }
public App(string rutaBD) { InitializeComponent(); RutaBD = rutaBD; VersionTracking.Track(); bool firsttime = VersionTracking.IsFirstLaunchForCurrentVersion; if (firsttime == true) { List <ListaProductos> lista_productos; lista_productos = TraerProductos(); List <Distribuidora> ListaDistribuidores; ListaDistribuidores = TraerDatos2(); using (SQLite.SQLiteConnection conexion = new SQLite.SQLiteConnection(RutaBD)) { conexion.CreateTable <Provincia>(); conexion.CreateTable <TipoLocal>(); conexion.CreateTable <Distribuidora>(); conexion.CreateTable <Local>(); conexion.CreateTable <TipoProductos>(); conexion.CreateTable <ListaProductos>(); conexion.CreateTable <Relevado>(); } SQLiteAsyncConnection conn = new SQLiteAsyncConnection(App.RutaBD); conn.InsertAllAsync(lista_productos); conn.InsertAllAsync(ListaDistribuidores); } MainPage = new NavigationPage(new LoginPage()); }
public void First_Launch_After_Build_Downgrade() { VersionTracking.Track(); Preferences.Set(versionsKey, string.Join("|", new string[] { currentVersion }), sharedName); Preferences.Set(buildsKey, string.Join("|", new string[] { currentBuild, "10", "20" }), sharedName); VersionTracking.InitVersionTracking(); output.WriteLine((VersionTracking.Default as VersionTrackingImplementation)?.GetStatus()); Assert.Equal(currentBuild, VersionTracking.CurrentBuild); Assert.Equal("20", VersionTracking.PreviousBuild); Assert.Equal("10", VersionTracking.FirstInstalledBuild); Assert.False(VersionTracking.IsFirstLaunchEver); Assert.False(VersionTracking.IsFirstLaunchForCurrentVersion); Assert.True(VersionTracking.IsFirstLaunchForCurrentBuild); VersionTracking.InitVersionTracking(); Assert.Equal(currentBuild, VersionTracking.CurrentBuild); Assert.Equal("20", VersionTracking.PreviousBuild); Assert.Equal("10", VersionTracking.FirstInstalledBuild); Assert.False(VersionTracking.IsFirstLaunchEver); Assert.False(VersionTracking.IsFirstLaunchForCurrentVersion); Assert.False(VersionTracking.IsFirstLaunchForCurrentBuild); }
protected override async void OnStart() { VersionTracking.Track(); if (VersionTracking.IsFirstLaunchEver) { var response = await DialogService.ShowActionSheetAsync("Thanks for installing the app, would you like a tour?", null, null, "Yes", "No"); if (response == "Yes") { Device.OpenUri(new Uri("https://www.youtube.com/watch?v=JaVjmi7MDEs")); } } else if (VersionTracking.IsFirstLaunchForVersion("1.1")) { await DialogService.ShowAlertAsync( "We've just released a panoramic photo viewer. Check it out on the property details page!", "New Features"); } var updateTask = Task.Run(async() => { var updateService = ViewModelLocator.Resolve <IUpdateService>(); if (await updateService.CheckForAppUpdatesAsync()) { MainThread.BeginInvokeOnMainThread(async() => { var mainPage = Current.MainPage; await mainPage.DisplayAlert("App Update", "There is a new version available. Please download it from the App Store", "OK"); }); } }); }
public App(string rutaBD) { InitializeComponent(); //Linea para obtener permisos //Task.Run(async() => await ObtenerPermisos()).GetAwaiter().GetResult(); RutaBD = rutaBD; VersionTracking.Track(); bool firsttime = VersionTracking.IsFirstLaunchForCurrentVersion; using (SQLite.SQLiteConnection conexion = new SQLite.SQLiteConnection(RutaBD)) { conexion.CreateTable <GenericDataConfig>(); conexion.CreateTable <TbRequest>(); //Debug.WriteLine($"{"LOCALIDADES: " + conexion.Table<ERP_LOCALIDADES>().Count().ToString()}"); //Debug.WriteLine($"{"LOCALIDADES: " + countLocalidades.ToString()}"); } //DROP DE TABLAS /*using (SQLite.SQLiteConnection conexion = new SQLite.SQLiteConnection(RutaBD)) * { * //conexion.DropTable<_ARTICULOS>(); * }*/ MainPage = new NavigationPage(new Login()) { BarBackgroundColor = Color.FromHex("#aed4ff"), BarTextColor = Color.Gray }; }
protected override void OnAppearing() { base.OnAppearing(); VersionTracking.Track(); var currentVersion = VersionTracking.CurrentVersion; LblVersion.Text = "Version " + currentVersion.ToString(); }
public App() { InitializeComponent(); VersionTracking.Track(); DependencyService.Register <DataStore>(); MainPage = new MainPage(); }
protected override async void OnInitialized() { InitializeComponent(); VersionTracking.Track(); await NavigationService.NavigateAsync("/NavigationPage/LoginView"); }
/// <summary> /// Configures VersionTracking | RgPluginsPopup | Fast Renderers | Xamarin Essentials' Permissions | BitCSharpClientControls (DatePicker, Checkbox, RadioButton, Frame) /// </summary> protected virtual void UseDefaultConfiguration(Bundle savedInstanceState) { _useDefaultConfiguration = true; Rg.Plugins.Popup.Popup.Init(this, savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); VersionTracking.Track(); BitCSharpClientControls.Init(); }
/// <summary> /// Configures VersionTracking | RgPluginsPopup | Fast Renderers | Xamarin Essentials' Permissions /// </summary> protected virtual void UseDefaultConfiguration(Bundle savedInstanceState) { _useDefaultConfiguration = true; Forms.SetFlags("FastRenderers_Experimental"); Rg.Plugins.Popup.Popup.Init(this, savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); VersionTracking.Track(); }
public App() { InitializeComponent(); VersionTracking.Track(); MainContext = new MainContext(); MainPage = new LoginScreen(MainContext, !VersionTracking.IsFirstLaunchEver); }
// // This method is invoked when the application has loaded and is ready to run. In this // method you should instantiate the window, load the UI into it and then make the window // visible. // // You have 17 seconds to return from this method, or iOS will terminate your application. // public override bool FinishedLaunching(UIApplication app, NSDictionary options) { global::Xamarin.Forms.Forms.Init(); LoadApplication(new App()); VersionTracking.Track(); return(base.FinishedLaunching(app, options)); }
protected override void OnStart() { AppCenter.Start("android=a40bd6f0-5ad7-4b36-9a89-740333948b82;" + "ios=f757b6ef-a959-4aac-9404-98dbbd2fb1bb;", typeof(Analytics), typeof(Crashes)); //SetReminderEnabled(); VersionTracking.Track(); OnResume(); }
public App() { InitializeComponent(); VersionTracking.Track(); MainPage = new MainMDPage(); AdjustBrightness(); }
public App() { InitializeComponent(); // Enable currently experimental features VersionTracking.Track(); MainPage = new NavigationPage(new HomePage()); }
public App() { InitializeComponent(); VersionTracking.Track(); MainPage = new NavigationPage(new HomePage()); SetUpAppActions(); }
public App() { InitializeComponent(); MainPage = new NavigationPage(new MainPage()); ((NavigationPage)Application.Current.MainPage).BarBackgroundColor = Color.Transparent; ((NavigationPage)Application.Current.MainPage).BarTextColor = Color.Black; VersionTracking.Track(); }
/// <summary> /// TODO : To Defeine On Page Appearing Event... /// </summary> protected async override void OnAppearing() { base.OnAppearing(); await SettingVM.GetSettings(); VersionTracking.Track(); var currentVersion = VersionTracking.CurrentVersion; LblVersion.Text = "Version " + currentVersion.ToString(); }
public App() { InitializeComponent(); // register platform-specific Services here DependencyService.Register <IPlatformUtil>(); VersionTracking.Track(); MainPage = new MainPage(); }
public App() { InitializeComponent(); VersionTracking.Track(); MigrateSettingsIfNeeded(); RefreshDatabaseIfNeeded(); MainPage = Startup.ServiceProvider.GetService <AppShell>(); }