Beispiel #1
0
        protected override async void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Activity_To_Do);

            CurrentPlatform.Init();

            // await InitLocalStoreAsync();

            // Get the Mobile Service sync table instance to use
            var toDoTable = client.GetSyncTable <Beacon> ();

            textNewToDo = FindViewById <EditText> (Resource.Id.textNewToDo);

            // Create an adapter to bind the items with the view
            adapter = new Adapters.BeaconAdapter(this, Resource.Layout.Row_List_To_Do);
            var listViewBeacon = FindViewById <ListView> (Resource.Id.listViewToDo);

            listViewBeacon.Adapter = adapter;

            // Load the items from the Mobile Service
            OnRefreshItemsSelected();
        }
        protected override async void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Activity_To_Do);

            CurrentPlatform.Init();

            // Create the client instance, using the mobile app backend URL.
            client = new MobileServiceClient(applicationURL);
#if OFFLINE_SYNC_ENABLED
            await InitLocalStoreAsync();

            // Get the sync table instance to use to store TodoItem rows.
            todoTable = client.GetSyncTable <ToDoItem>();
#else
            todoTable = client.GetTable <ToDoItem>();
#endif

            textNewToDo = FindViewById <EditText>(Resource.Id.textNewToDo);

            // Create an adapter to bind the items with the view
            adapter = new ToDoItemAdapter(this, Resource.Layout.Row_List_To_Do);
            var listViewToDo = FindViewById <ListView>(Resource.Id.listViewToDo);
            listViewToDo.Adapter = adapter;

            // Load the items from the mobile app backend.
            OnRefreshItemsSelected();
        }
        protected override async void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Activity_To_Do);

            try {
                CurrentPlatform.Init();

                // Create the Mobile Service Client instance, using the provided
                // Mobile Service URL and key
                client = new MobileServiceClient(applicationURL, applicationKey);
                await InitLocalStoreAsync();

                // Get the Mobile Service sync table instance to use
                toDoTable = client.GetSyncTable <ToDoItem> ();

                textNewToDo = FindViewById <EditText> (Resource.Id.textNewToDo);

                // Create an adapter to bind the items with the view
                adapter = new ToDoItemAdapter(this, Resource.Layout.Row_List_To_Do);
                var listViewToDo = FindViewById <ListView> (Resource.Id.listViewToDo);
                listViewToDo.Adapter = adapter;

                // Load the items from the Mobile Service
                OnRefreshItemsSelected();
            } catch (Java.Net.MalformedURLException) {
                CreateAndShowDialog(new Exception("There was an error creating the Mobile Service. Verify the URL"), "Error");
            } catch (Exception e) {
                CreateAndShowDialog(e, "Error");
            }
        }
Beispiel #4
0
        private async Task InitLocalStoreAsync()
        {
            // new code to initialize the SQLite store
            string path = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), localDbFilename);

            if (!File.Exists(path))
            {
                File.Create(path).Dispose();
            }

            var store = new MobileServiceSQLiteStore(localDbFilename);

            store.DefineTable <Beacon>();
            store.DefineTable <GuiSettings>();
            store.DefineTable <Location>();
            //store.DefineTable<Map>();
            //store.DefineTable<Prompt>();
            //store.DefineTable<PromptStep>();
            //store.DefineTable<Reminder>();
            //store.DefineTable<Settings>();
            //store.DefineTable<UserMaps>();
            //store.DefineTable<UserSettings>();
            //store.DefineTable<Users>();


            CurrentPlatform.Init();

            // Uses the default conflict handler, which fails on conflict
            // To use a different conflict handler, pass a parameter to InitializeAsync. For more details, see http://go.microsoft.com/fwlink/?LinkId=521416
            await client.SyncContext.InitializeAsync(store);
        }
        protected override void OnCreate(Bundle bundle)
        {
            ToolbarResource   = Resource.Layout.Toolbar;
            TabLayoutResource = Resource.Layout.Tabbar;

            base.OnCreate(bundle);

            AppCompatDelegate.DefaultNightMode = AppCompatDelegate.ModeNightNo;

            // Initialize Azure Mobile Apps
            CurrentPlatform.Init();

            // Initializing Xamarin Essentials
            Xamarin.Essentials.Platform.Init(this, bundle);

            //FFImageLoading
            FFImageLoading.Forms.Platform.CachedImageRenderer.Init(true);

            // Initialize Xamarin Forms
            Xamarin.Forms.Forms.Init(this, bundle);

            // Load the main application
            LoadApplication(new ArtGalleryCRM.Forms.App());

            this.Window.AddFlags(WindowManagerFlags.Fullscreen);
        }
        public static void Startup()
        {
            SQLiteConnection connection = null;
            string           dbLocation = "expensesDB.db3";

#if __ANDROID__
            var library = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            dbLocation = Path.Combine(library, dbLocation);
            var platform = new SQLitePlatformAndroid();
            connection = new SQLiteConnection(platform, dbLocation);
#elif __IOS__
            CurrentPlatform.Init();
            var docsPath    = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            var libraryPath = Path.Combine(docsPath, "../Library/");
            dbLocation = Path.Combine(libraryPath, dbLocation);
            var platform = new SQLitePlatformIOS();
            connection = new SQLiteConnection(platform, dbLocation);
#elif WINDOWS_PHONE
            var platform = new SQLitePlatformWP8();
            dbLocation = Path.Combine(ApplicationData.Current.LocalFolder.Path, dbLocation);
            connection = new SQLiteConnection(platform, dbLocation);
#endif
            ServiceContainer.Register <IMessageDialog>(() => new MessageDialog());
            ServiceContainer.Register <ICloudService>(AzureService.Instance);
            ServiceContainer.Register <IExpenseService>(() => new ExpenseService(connection));
            ServiceContainer.Register <ExpensesViewModel>();
            ServiceContainer.Register <ExpenseViewModel>();
        }
Beispiel #7
0
 // This is the main entry point of the application.
 static void Main(string[] args)
 {
     // if you want to use a different Application Delegate class from "AppDelegate"
     // you can specify it here.
     CurrentPlatform.Init();
     UIApplication.Main(args, null, "AppDelegate");
 }
Beispiel #8
0
        public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary launchOptions)
        {
            //#if ENABLE_TEST_CLOUD
            Xamarin.Calabash.Start();
            //#endif

            CurrentPlatform.Init();
            SQLitePCL.CurrentPlatform.Init();
            Forms.Init();
            ImageCircleRenderer.Init();
            XFGloss.iOS.Library.Init();

            MobileCenter.Configure(Keys.MobileCenterKeyiOS);
            LoadApplication(new App());

            UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent;
            UIBarButtonItem.Appearance.SetBackButtonTitlePositionAdjustment(new UIOffset(0, -100), UIBarMetrics.Default);

            AppDomain.CurrentDomain.UnhandledException += (sender, e) => {
                try
                {
                    var exception = ((Exception)e.ExceptionObject).GetBaseException();
                    Console.WriteLine("**SPORT UNHANDLED EXCEPTION**\n\n" + exception);
                    exception.Track();
                }
                catch
                {
                    throw;
                }
            };

            return(base.FinishedLaunching(uiApplication, launchOptions));
        }
        protected override async void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Activity_To_Do);

            CurrentPlatform.Init();

            // Create the Mobile Service Client instance, using the provided
            // Mobile Service URL
            client = new MobileServiceClient(applicationURL);
            await InitLocalStoreAsync();

            // Set the current instance of TodoActivity.
            instance = this;

            // Make sure the GCM client is set up correctly.
            GcmClient.CheckDevice(this);
            GcmClient.CheckManifest(this);

            // Get the Mobile Service sync table instance to use
            toDoTable = client.GetSyncTable <ToDoItem> ();

            textNewToDo = FindViewById <EditText> (Resource.Id.textNewToDo);

            // Create an adapter to bind the items with the view
            adapter = new ToDoItemAdapter(this, Resource.Layout.Row_List_To_Do);
            var listViewToDo = FindViewById <ListView> (Resource.Id.listViewToDo);

            listViewToDo.Adapter = adapter;

            //// Load the items from the Mobile App backend.
            //OnRefreshItemsSelected ();
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            try
            {
                TabLayoutResource = Resource.Layout.Tabbar;
                ToolbarResource   = Resource.Layout.Toolbar;

                base.OnCreate(savedInstanceState);
                //Xamarin.Essentials.Platform.Init(this, savedInstanceState);
                global::Xamarin.Forms.Forms.SetFlags("FastRenderers_Experimental");
                global::Xamarin.Forms.Forms.Init(this, savedInstanceState);

                Xamarin.FormsMaps.Init(this, savedInstanceState);
                CurrentPlatform.Init();
                CrossCurrentActivity.Current.Init(this, savedInstanceState);
                CrossCurrentActivity.Current.Activity = this;

                string dbName     = "travel_db.sqlite";
                string folderPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
                string fullPath   = Path.Combine(folderPath, dbName);

                LoadApplication(new App(fullPath));
            }
            catch (System.Exception ex)
            {
            }
        }
Beispiel #11
0
        protected override async void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            CurrentPlatform.Init();

            // Create the Mobile Service Client instance, using the provided
            // Mobile Service URL
            client = new MobileServiceClient(applicationURL);
            await InitLocalStoreAsync();

            // Get the Mobile Service sync table instance to use
            toDoTable = client.GetSyncTable <ToDoItem>();

            textNewToDo = FindViewById <EditText>(Resource.Id.todoText);


            // Create an adapter to bind the items with the view
            adapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleListItem1);
            var listViewToDo = FindViewById <ListView>(Resource.Id.Items);

            listViewToDo.Adapter = adapter;
        }
Beispiel #12
0
 //
 // 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)
 {
     Forms.Init();
     CurrentPlatform.Init();
     LoadApplication(new App());
     return(base.FinishedLaunching(app, options));
 }
Beispiel #13
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            Xamarin.FormsMaps.Init(this, savedInstanceState);
            CurrentPlatform.Init();

            var status = await Permissions.CheckStatusAsync <Permissions.LocationWhenInUse>();

            if (status == PermissionStatus.Denied)
            {
                status = await Permissions.RequestAsync <Permissions.LocationWhenInUse>();
            }

            string dbName     = "travel_db.sqlite";
            string folderPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
            string fullPath   = Path.Combine(folderPath, dbName);

            LoadApplication(new App(fullPath));
        }
Beispiel #14
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            CurrentPlatform.Init();
            Plugin.SecureStorage.CrossSecureStorage.Current.SetValue("Session Password", "dadf2b61441e47d8a91d9056b0a6ed06");
            global::Xamarin.Forms.Forms.Init();
            //var dbPath = FileAccessHelper.GetLocalFilePath("commandScheduling.db3
            App.DeviceWidth  = (int)UIScreen.MainScreen.Bounds.Width;
            App.DeviceHeight = (int)UIScreen.MainScreen.Bounds.Height;
            App.Xdpi         = 0; //temporary constant
            App.IsIOS        = true;
            //Xamarin.FormsGoogleMaps.Init("AIzaSyAg4qblST3s8rfCI8-qT9PanptZPcll9Gs");
            LoadApplication(new App());

            WireUpLongRunningTask();

            var songURL = new NSUrl("Sounds/notificationSound.mp3");
            var audio   = new AVAudioPlayer(songURL, "mp3", out NSError err);

            audio.Volume = 0.5f;
            //audio.FinishedPlaying += delegate { audio = null; };
            audio.NumberOfLoops = 2;
            App.Player          = audio;
            NotificationInit();
            //LocationManagerInit();
            //StartBackgroundLocationUpdating();
            return(base.FinishedLaunching(app, options));
        }
Beispiel #15
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            Forms.Init();
            // create a new window instance based on the screen size
            window = new UIWindow(UIScreen.MainScreen.Bounds);


            #region Azure stuff
            CurrentPlatform.Init();
            Client = new MobileServiceClient(
                Constants.Url,
                Constants.Key);
            todoTable       = Client.GetTable <TodoItem>();
            todoItemManager = new TodoItemManager(todoTable);

            App.SetTodoItemManager(todoItemManager);
            #endregion region

            #region Text to Speech stuff
            App.SetTextToSpeech(new Speech());
            #endregion region

            // If you have defined a view, add it here:
            // window.RootViewController  = navigationController;
            window.RootViewController = App.GetMainPage().CreateViewController();

            // make the window visible
            window.MakeKeyAndVisible();

            return(true);
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            instance = this;
            CurrentPlatform.Init();

            todoItemManager = new ToDoItemManager();
            App.SetTodoItemManager(todoItemManager);

            LoadApplication(new App());

            try
            {
                // Check to ensure everything's setup right
                GcmClient.CheckDevice(this);
                GcmClient.CheckManifest(this);

                // Register for push notifications
                System.Diagnostics.Debug.WriteLine("Registering...");
                GcmClient.Register(this, PushHandlerBroadcastReceiver.SENDER_IDS);
            }
            catch (Java.Net.MalformedURLException)
            {
                CreateAndShowDialog(new Exception("There was an error creating the Mobile Service. Verify the URL"), "Error");
            }
            catch (Exception e)
            {
                CreateAndShowDialog(e, "Error");
            }
        }
Beispiel #17
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            AuthenticationProviders = new List <MobileServiceAuthenticationProvider>
            {
                MobileServiceAuthenticationProvider.Facebook,
                //MobileServiceAuthenticationProvider.MicrosoftAccount,
                //MobileServiceAuthenticationProvider.Google,
                //MobileServiceAuthenticationProvider.Twitter
            };

            UITabBar.Appearance.SelectedImageTintColor = UIColor.FromRGB(250, 168, 25);

            global::Xamarin.Forms.Forms.Init();
            CachedImageRenderer.Init();
            AnimationViewRenderer.Init();
            CarouselViewRenderer.Init();


            // Initialize Azure Mobile App Client for the current platform
            CurrentPlatform.Init();

            // Code for starting up the Xamarin Test Cloud Agent
            Xamarin.Calabash.Start();

            // Disable Mobile Center updates when in Debug Mode
            Distribute.DontCheckForUpdatesInDebug();

            LoadApplication(new App(this));

            var result = base.FinishedLaunching(app, options);

            return(result);
        }
Beispiel #18
0
        private ProgressBar progressBar;                  // Progress spinner to use for table operations

        // Called when the activity initially gets created
        protected override async void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Activity_To_Do);

            // Initialize the progress bar
            progressBar            = FindViewById <ProgressBar>(Resource.Id.loadingProgressBar);
            progressBar.Visibility = ViewStates.Gone;

            // Create ProgressFilter to handle busy state
            var progressHandler = new ProgressHandler();

            progressHandler.BusyStateChange += (busy) => {
                if (progressBar != null)
                {
                    progressBar.Visibility = busy ? ViewStates.Visible : ViewStates.Gone;
                }
            };

            try
            {
                // Check to ensure everything's setup right
                GcmClient.CheckDevice(this);
                GcmClient.CheckManifest(this);

                // Register for push notifications
                System.Diagnostics.Debug.WriteLine("Registering...");
                GcmClient.Register(this, PushHandlerBroadcastReceiver.SENDER_IDS);

                CurrentPlatform.Init();
                // Create the Mobile Service Client instance, using the provided
                // Mobile Service URL and key
                client = new MobileServiceClient(
                    Constants.ApplicationURL,
                    Constants.ApplicationKey, progressHandler);

                // Get the Mobile Service Table instance to use
                todoTable = client.GetTable <TodoItem>();

                textNewTodo = FindViewById <EditText>(Resource.Id.textNewTodo);

                // Create an adapter to bind the items with the view
                adapter = new TodoItemAdapter(this, Resource.Layout.Row_List_To_Do);
                var listViewTodo = FindViewById <ListView>(Resource.Id.listViewTodo);
                listViewTodo.Adapter = adapter;

                // Load the items from the Mobile Service
                await RefreshItemsFromTableAsync();
            }
            catch (Java.Net.MalformedURLException)
            {
                CreateAndShowDialog(new Exception("There was an error creating the Mobile Service. Verify the URL"), "Error");
            }
            catch (Exception e)
            {
                CreateAndShowDialog(e, "Error");
            }
        }
Beispiel #19
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            //The following line added to support the XAML CollectionView
            global::Xamarin.Forms.Forms.SetFlags("CollectionView_Experimental");

            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);

            CurrentPlatform.Init();

            string filePath     = "Famous.db3";
            string locationPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
            string fullPath     = Path.Combine(locationPath, filePath);

            LoadApplication(new App(fullPath));


            //LoadApplication(new App());
        }
Beispiel #20
0
        private async Task InitLocalStoreAsync()
        {
            // new code to initialize the SQLite store

            writedb();

            var store = new MobileServiceSQLiteStore(localDbFilename);

            store.DefineTable <caapa.SharedBeacon>();
            store.DefineTable <GuiSettings>();
            store.DefineTable <Location>();
            store.DefineTable <Map>();
            store.DefineTable <Prompt>();
            store.DefineTable <PromptStep>();
            store.DefineTable <Reminder>();
            store.DefineTable <Settings>();
            store.DefineTable <UserMaps>();
            store.DefineTable <UserSettings>();
            store.DefineTable <Users>();

            CurrentPlatform.Init();

            // Uses the default conflict handler, which fails on conflict
            // To use a different conflict handler, pass a parameter to InitializeAsync. For more details, see http://go.microsoft.com/fwlink/?LinkId=521416
            await client.SyncContext.InitializeAsync(store);
        }
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            // Initialize Azure Mobile Apps
            CurrentPlatform.Init();

            // Initialize Xamarin Forms
            Forms.Init(this, bundle);

            var app = new App();

            // kod co opravuje klavesnici. Aby spravne fungoval statusbar a neprekryval aplikaci, tak je nutne aplikaci nastavit WindowSoftInputModeAdjust = "Resize"
            if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop)
            {
                // unfortunately this creates a transparent statusbar, so 're-color' the status bar again
                var statusBarHeightInfo = typeof(FormsAppCompatActivity).GetField("_statusBarHeight", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
                if (statusBarHeightInfo != null)
                {
                    statusBarHeightInfo.SetValue(this, 0);
                }

                Color color = (Color)app.Resources["PrimaryColor"];
                Window.SetStatusBarColor(color.ToAndroid());
            }

            // Load the main application
            LoadApplication(app);

            Xamarin.Forms.Application.Current.On <Xamarin.Forms.PlatformConfiguration.Android>().UseWindowSoftInputModeAdjust(WindowSoftInputModeAdjust.Resize);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);
            //render más rápido. omite el Renderer y deja solo el elemento al correr el app
            global::Xamarin.Forms.Forms.SetFlags("FastRederers_Experimental");
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            //metodo init para maps
            Xamarin.FormsMaps.Init(this, savedInstanceState);
            //referencia INIT a servicio Azure
            CurrentPlatform.Init();
            //Init de permisos
            CrossCurrentActivity.Current.Init(this, savedInstanceState);
            //Base de datos SQLite path para android
            string dbName = "travel_db.sqlite"; //db name
            //en android se guarda en la "Special Folder" Personal
            string folderPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
            // Cobinamos el relative path con el nombre del archivo
            string fullPath = Path.Combine(folderPath, dbName);

            //paso el fullPath al constructor nuevo
            LoadApplication(new App(fullPath));
        }
Beispiel #23
0
 public MobileServiceClient GetMobileServiceClient()
 {
     CurrentPlatform.Init();
     azureDatabase = new MobileServiceClient("http://suncorphealth.azurewebsites.net");
     InitializeLocal();
     return(azureDatabase);
 }
Beispiel #24
0
 public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
 {
     // Override point for customization after application launch.
     // If not required for your application you can safely delete this method
     CurrentPlatform.Init();
     return(true);
 }
        static AppDelegate()
        {
            CurrentPlatform.Init();

            Harness = new TestHarness();
            Harness.LoadTestAssembly(typeof(SQLiteStoreTests).Assembly);
        }
Beispiel #26
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            // Implement FastRenderers
            global::Xamarin.Forms.Forms.SetFlags("FastRenderers_Experimental");
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            //Use maps for Xamarin Forms
            Xamarin.FormsMaps.Init(this, savedInstanceState);
            //User azure services
            CurrentPlatform.Init();

            string dbName     = "travel_db.sqlite";
            string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            string fullPath   = Path.Combine(folderPath, dbName);

            //LoadApplication(new App());
            // New constructor for database location
            LoadApplication(new App(fullPath));

            //CrossCurrentActivity.Current.Init(this, savedInstanceState);
        }
Beispiel #27
0
            //public static string deviceUniqueIdentifier { get; set; }
            //public static int graphicsDeviceID { get; set; }

            /*
             * public static string graphicsDeviceName { get; set; }
             * public static string graphicsDeviceType { get; set; }
             * public static string graphicsDeviceVersion { get; set; }
             * public static int graphicsMemorySize { get; set; }
             * public static int maxTextureSize { get; set; }
             * public static int systemMemorySize { get; set; }
             * public static string operatingSystem { get; set; }
             * public static string operatingSystemFamily { get; set; }
             * public static int processorCount { get; set; }
             * public static int processorFrequency { get; set; }
             * public static string processorType { get; set; }
             */
            public STSystemInfo()
            {
                configVer   = GetCurrentConfigVersion().GetVersion();
                clientVer   = GetBuildVersion();
                platform    = CurrentPlatform.ToString();
                server      = GetCurrentConfigServerIP() + ":" + GetCurrentConfigServerPORT().ToString();
                deviceModel = SystemInfo.deviceModel;
                deviceName  = SystemInfo.deviceName;
                deviceType  = SystemInfo.deviceType.ToString();
                //deviceUniqueIdentifier = SystemInfo.deviceUniqueIdentifier;
                //graphicsDeviceID = SystemInfo.graphicsDeviceID;

                /*
                 * graphicsDeviceName = SystemInfo.graphicsDeviceName;
                 * graphicsDeviceType = SystemInfo.graphicsDeviceType.ToString();
                 * graphicsDeviceVersion = SystemInfo.graphicsDeviceVersion;
                 * graphicsMemorySize = SystemInfo.graphicsMemorySize;
                 * systemMemorySize = SystemInfo.systemMemorySize;
                 * maxTextureSize = SystemInfo.maxTextureSize;
                 * operatingSystem = SystemInfo.operatingSystem;
                 * operatingSystemFamily = SystemInfo.operatingSystemFamily.ToString();
                 * processorCount = SystemInfo.processorCount;
                 * processorFrequency = SystemInfo.processorFrequency;
                 * processorType = SystemInfo.processorType;
                 */
            }
Beispiel #28
0
        public async Task Initialize()
        {
            if (Client?.SyncContext?.IsInitialized ?? false)
            {
                return;
            }

            CurrentPlatform.Init();


            var appUrl = "https://mobile-13f2a020-9809-42ce-8db2-783ee8c05e68.azurewebsites.net";


            Client = new MobileServiceClient(appUrl);

            //InitialzeDatabase for path
            var path = "syncstore.db";

            //setup our local sqlite store and intialize our table
            var store = new MobileServiceSQLiteStore(path);

            //Define table
            store.DefineTable <Game>();


            //Initialize SyncContext
            await Client.SyncContext.InitializeAsync(store);

            //Get our sync table that will call out to azure
            table = Client.GetSyncTable <Game>();
        }
Beispiel #29
0
 public ServiceHelper()
 {
     CurrentPlatform.Init();
     client = new MobileServiceClient(@"ghttp://xamarinchampions.azurewebsites.net");
     InitLocalStoreAsync().Wait();
     _TorneoItemTable = client.GetSyncTable <TorneoItem>();
 }
Beispiel #30
0
	/// <summary>
	/// Weikie's controller input wrapper
	/// </summary>
	/// <param name="controllerPort">1-based index of what controller port to use</param>
	public ControllerInput(int controllerPort)
	{
#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN
		currentPlatform = CurrentPlatform.Windows;
#elif UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX
		currentPlatform = CurrentPlatform.Mac;
#else
		currentPlatform = CurrentPlatform.Unknown;
#endif

		this.controllerPort = controllerPort;
		string[] controllerNames = Input.GetJoystickNames();
		if (controllerNames.Length < controllerPort)
		{
			//Log.Weikie(string.Format("Controller {0} not assigned, only {1} controllers detected", controllerPort, controllerNames.Length));
			//Log.Weikie("Assigned to port 1 as default.");
			this.controllerPort = 1;
			if (controllerNames.Length == 0)
				return;
		}
		//else
		{
			DoBindings(controllerNames);
		}
	}
Beispiel #31
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            Xamarin.FormsMaps.Init(this, savedInstanceState);       // Initialise maps, specifying activity & bundle - AndroidManifest.xml must be edited
                                                                    // LoadApplication(new App());              // boilerplate instantiation of
            // Azure code 11-86
            CurrentPlatform.Init();

            // use Plugin.Permissions (step 2 of 3 for Plugin.Permissions permissions plugin)
            Plugin.CurrentActivity.CrossCurrentActivity.Current.Init(this, savedInstanceState);// Initialise permissions, specifying activity & bundle - AndroidManifest.xml must be edited
            // step 3 of 3 for Plugin.Permissions - in Info.plist, add 'Privacy-Calendars Usage', 'Privacy - Bluetooth Peripheral Usage Description'


            CrossCurrentActivity.Current.Activity = this;   // for Permissions 12-114

            // define the location of the db in terms of path
            string dbName     = "travel_db.sqlite";
            string folderPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
            string fullPath   = System.IO.Path.Combine(folderPath, dbName);

            LoadApplication(new App(fullPath));
        }