Пример #1
0
        public MainPage()
        {
            InitializeComponent();
            DebugEx.DebugLine();
            Task.Run(() => {
                var x = new Browser().Request("http://jsonplaceholder.typicode.com/photos");

                Debug.WriteLine(x.Result);
            });
            DebugEx.DebugLine();



            //    CrossLocalNotifications.Current.Show("title", "body", 101, DateTime.Now.AddSeconds(5));
            Debug.WriteLine(CrossDeviceInfo.Current.Model);
            Debug.WriteLine(CrossDeviceInfo.Current.Platform);
            Debug.WriteLine(CrossDeviceInfo.Current.Version);

            var v = CrossVibrate.Current;

            v.Vibration(TimeSpan.FromMilliseconds(10)); // very tiny vibration
            Device.BeginInvokeOnMainThread(async() =>
            {
                Username.Opacity     = 0;
                Password.Opacity     = 0;
                SignInButton.Opacity = 0;
                SignUpButton.Opacity = 0;
                await Username.FadeTo(1, 500);
                await Password.FadeTo(1, 500);
                await SignInButton.FadeTo(1, 500);
                await SignUpButton.FadeTo(1, 500);

                //  await CrossTextToSpeech.Current.Speak("Text to speak");
            });
            veggies = new ObservableCollection <VeggieViewModel>();

            lstView.ItemTemplate = new DataTemplate(typeof(CustomVeggieCell));
            veggies.Add(new VeggieViewModel {
                Name = "Tomato", Type = "Fruit", Image = "icon.png"
            });
            veggies.Add(new VeggieViewModel {
                Name = "Romaine Lettuce", Type = "Vegetable", Image = "icon.png"
            });
            veggies.Add(new VeggieViewModel {
                Name = "Zucchini", Type = "Vegetable", Image = "icon.png"
            });
            lstView.ItemsSource = veggies;
        }
Пример #2
0
        public MainPage()
        {
            InitializeComponent();


            /*  Task.Run(async () => {
             *      var x=  new ReadWrite().StoragePermisionRead("log.txt");
             *      await x;
             *      Debug.WriteLine(x.Result);
             * }).ConfigureAwait(false);
             **/
            Task.Run(async() => {
                var ServerValidator = new ServerValidator().IsEmailExistAsync("Email");
                await ServerValidator;
                Debug.WriteLine(ServerValidator.Result);
            });



            if (CrossSecureStorage.Current.HasKey("UserID"))
            {
                var UserID = CrossSecureStorage.Current.GetValue("UserID");
                Debug.WriteLine("----------------------" + UserID + "----------------------");
            }
            else
            {
                Debug.WriteLine("----likely a new account so we have no user id");
            }



            /* var db = new SQLiteConnection("MyData.db");//disabled for now because its referancing is incompleate
             * db.CreateTable<UserTable>();
             *
             * db.Insert(new UserTable() { UserID = new Random().Next().ToString() });
             *
             * Debug.WriteLine(db.Query<UserTable>("Select count(id) From UserTable").First().UserID.ToString());*/



            var result = ValidatorConnection.IsValidateNetwork();

            DebugEx.DebugLine();

            Validator.IsValidPhoneNumber("09026487141");
            Debug.WriteLine("Valid Password :"******"eastcoast123"));

            /* Task.Run( () => {
             * var x= new Browser().Request("http://jsonplaceholder.typicode.com/photos");
             *
             *   Debug.WriteLine(x.Result);
             *
             * });*/
            DebugEx.DebugLine();



            //    CrossLocalNotifications.Current.Show("title", "body", 101, DateTime.Now.AddSeconds(5));
            Debug.WriteLine(CrossDeviceInfo.Current.Model);
            Debug.WriteLine(CrossDeviceInfo.Current.Platform);
            Debug.WriteLine(CrossDeviceInfo.Current.Version);

            var v = CrossVibrate.Current;

            v.Vibration(TimeSpan.FromMilliseconds(10)); // very tiny vibration
            Device.BeginInvokeOnMainThread(async() =>
            {
                Username.Opacity     = 0;
                Password.Opacity     = 0;
                SignInButton.Opacity = 0;
                SignUpButton.Opacity = 0;
                await Username.FadeTo(1, 500);
                await Password.FadeTo(1, 500);
                await SignInButton.FadeTo(1, 500);
                await SignUpButton.FadeTo(1, 500);

                //  await CrossTextToSpeech.Current.Speak("Text to speak");
            });



            /*  Task.Run(async () =>
             * {
             *     var locator = CrossGeolocator.Current;
             *     locator.DesiredAccuracy = 20;
             *
             *
             *
             *     /*   if (locator.IsListening)
             *        return;*/


            ///This logic will run on the background automatically on iOS, however for Android and UWP you must put logic in background services. Else if your app is killed the location updates will be killed.

            /* await locator.StartListeningAsync(TimeSpan.FromSeconds(2), 2, true, new Plugin.Geolocator.Abstractions.ListenerSettings
             *       {
             *           ActivityType = Plugin.Geolocator.Abstractions.ActivityType.AutomotiveNavigation,
             *           AllowBackgroundUpdates = true,
             *           DeferLocationUpdates = true,
             *           DeferralDistanceMeters = 1,
             *
             *           DeferralTime = TimeSpan.FromSeconds(1),
             *           ListenForSignificantChanges = true,
             *           PauseLocationUpdatesAutomatically = false
             *
             *       });
             *
             *   var x = await locator.GetPositionAsync(TimeSpan.FromSeconds(1), null, true);
             *   Debug.WriteLine(x.Latitude + " " + x.Longitude);
             *
             *   locator.PositionChanged += Locator_PositionChanged;
             * }).ConfigureAwait(false);
             */
        }
Пример #3
0
        public MainPage()
        {
            InitializeComponent();



            var result = ValidatorConnection.IsValidateNetwork();



            DebugEx.DebugLine();

            Validator.IsValidPhoneNumber("09026487141");
            Debug.WriteLine("Valid Password :"******"eastcoast123"));

            /* Task.Run( () => {
             * var x= new Browser().Request("http://jsonplaceholder.typicode.com/photos");
             *
             *   Debug.WriteLine(x.Result);
             *
             * });*/
            DebugEx.DebugLine();



            //    CrossLocalNotifications.Current.Show("title", "body", 101, DateTime.Now.AddSeconds(5));
            Debug.WriteLine(CrossDeviceInfo.Current.Model);
            Debug.WriteLine(CrossDeviceInfo.Current.Platform);
            Debug.WriteLine(CrossDeviceInfo.Current.Version);

            var v = CrossVibrate.Current;

            v.Vibration(TimeSpan.FromMilliseconds(10)); // very tiny vibration
            Device.BeginInvokeOnMainThread(async() =>
            {
                Username.Opacity     = 0;
                Password.Opacity     = 0;
                SignInButton.Opacity = 0;
                SignUpButton.Opacity = 0;
                await Username.FadeTo(1, 500);
                await Password.FadeTo(1, 500);
                await SignInButton.FadeTo(1, 500);
                await SignUpButton.FadeTo(1, 500);

                //  await CrossTextToSpeech.Current.Speak("Text to speak");
            });



            /*  Task.Run(async () =>
             * {
             *     var locator = CrossGeolocator.Current;
             *     locator.DesiredAccuracy = 20;
             *
             *
             *
             *     /*   if (locator.IsListening)
             *        return;*/


            ///This logic will run on the background automatically on iOS, however for Android and UWP you must put logic in background services. Else if your app is killed the location updates will be killed.

            /* await locator.StartListeningAsync(TimeSpan.FromSeconds(2), 2, true, new Plugin.Geolocator.Abstractions.ListenerSettings
             *       {
             *           ActivityType = Plugin.Geolocator.Abstractions.ActivityType.AutomotiveNavigation,
             *           AllowBackgroundUpdates = true,
             *           DeferLocationUpdates = true,
             *           DeferralDistanceMeters = 1,
             *
             *           DeferralTime = TimeSpan.FromSeconds(1),
             *           ListenForSignificantChanges = true,
             *           PauseLocationUpdatesAutomatically = false
             *
             *       });
             *
             *   var x = await locator.GetPositionAsync(TimeSpan.FromSeconds(1), null, true);
             *   Debug.WriteLine(x.Latitude + " " + x.Longitude);
             *
             *   locator.PositionChanged += Locator_PositionChanged;
             * }).ConfigureAwait(false);
             */
        }