// // 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) { // create a new window instance based on the screen size this.window = new UIWindow(UIScreen.MainScreen.Bounds); // If you have defined a root view controller, set it here: this.controller = new MainViewController(); this.window.RootViewController = this.controller; // make the window visible this.window.MakeKeyAndVisible(); DependencyResolver.Current.RegisterService <IDevice>(t => AppleDevice.CurrentDevice()); DependencyResolver.Current.RegisterService <ISQLitePlatform, SQLitePlatformIOS>(); DependencyResolver.Current.RegisterService <IPhone, PhoneImplementation> (); this.OnStart(); Resolver.GetService <StoreAccelerometerData>().Start(); Resolver.GetService <StoreLocationChange> ().Start(); var device = Resolver.GetService <IDevice> (); System.Diagnostics.Debug.WriteLine(string.Format("Device {0} a phone.", device.Phone != null ? "is" : "is not")); System.Diagnostics.Debug.WriteLine(device.Screen); System.Diagnostics.Debug.WriteLine(device.Name); System.Diagnostics.Debug.WriteLine(device.HardwareVersion); System.Diagnostics.Debug.WriteLine(device.FirmwareVersion); return(true); }
// // 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) { // create a new window instance based on the screen size this.window = new UIWindow (UIScreen.MainScreen.Bounds); // If you have defined a root view controller, set it here: this.controller = new MainViewController(); this.window.RootViewController = this.controller; // make the window visible this.window.MakeKeyAndVisible(); DependencyResolver.Current.RegisterService<IDevice>(t => AppleDevice.CurrentDevice ()); DependencyResolver.Current.RegisterService<ISQLitePlatform, SQLitePlatformIOS>(); DependencyResolver.Current.RegisterService<IPhone, PhoneImplementation> (); this.OnStart(); Resolver.GetService<StoreAccelerometerData>().Start(); Resolver.GetService<StoreLocationChange> ().Start (); var device = Resolver.GetService<IDevice> (); System.Diagnostics.Debug.WriteLine (string.Format("Device {0} a phone.", device.Phone != null ? "is" : "is not")); System.Diagnostics.Debug.WriteLine (device.Screen); System.Diagnostics.Debug.WriteLine (device.Name); System.Diagnostics.Debug.WriteLine (device.HardwareVersion); System.Diagnostics.Debug.WriteLine (device.FirmwareVersion); return true; }