protected override void OnCreate(Bundle savedInstanceState) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(savedInstanceState); string fileName = "BCMWeb_db.db3"; string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal); ServicePointManager.ServerCertificateValidationCallback += (se, cert, chain, sslerror) => { return(true); }; string fullPathFile = Path.Combine(folderPath, fileName); var mainDisplayInfo = DeviceDisplay.MainDisplayInfo; var pixelWidth = (int)mainDisplayInfo.Width; var pixelHeight = (int)mainDisplayInfo.Height; var screenPixelDensity = mainDisplayInfo.Density; Xamarin.Essentials.Platform.Init(this, savedInstanceState); global::Xamarin.Forms.Forms.SetFlags("CollectionView_Experimental"); global::Xamarin.Forms.Forms.Init(this, savedInstanceState); _app = new App(fullPathFile, (double)((pixelHeight - 0.5f) / screenPixelDensity), (double)((pixelWidth - 0.5f) / screenPixelDensity)); App.deviceDownloadRoot = ApplicationContext.GetExternalFilesDir(Android.OS.Environment.DirectoryDownloads).AbsolutePath; Downloaded(); LoadApplication(_app); }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { global::Xamarin.Forms.Forms.SetFlags("CollectionView_Experimental"); global::Xamarin.Forms.Forms.Init(); string fileName = "BCMWeb_db.db3"; string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); ServicePointManager.ServerCertificateValidationCallback += (se, cert, chain, sslerror) => { return(true); }; string fullPathFile = Path.Combine(folderPath, fileName); var mainDisplayInfo = DeviceDisplay.MainDisplayInfo; var pixelWidth = (int)mainDisplayInfo.Width; var pixelHeight = (int)mainDisplayInfo.Height; var screenPixelDensity = mainDisplayInfo.Density; _app = new App(fullPathFile, (double)((pixelHeight - 0.5f) / screenPixelDensity), (double)((pixelWidth - 0.5f) / screenPixelDensity)); LoadApplication(_app); return(base.FinishedLaunching(app, options)); }