コード例 #1
0
ファイル: AppDelegate.cs プロジェクト: kdanilkov/Xpence
        //
        // 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)
        {
            CurrentPlatform.Init();
            Xamarin.Forms.Forms.Init();
            StartAppCenter();
            UIColor accentColor = UIColor.Gray;

            UINavigationBar.Appearance.TintColor = accentColor;
            // UINavigationBar.Appearance.BarTintColor = accentColor;
            UINavigationBar.Appearance.SetTitleTextAttributes(new UITextAttributes()
            {
                TextColor = accentColor
            });

            LoadApplication(new App(new iOSInitializer()));

            return(base.FinishedLaunching(app, options));
        }
コード例 #2
0
ファイル: MainActivity.cs プロジェクト: jakuboles/TDKInz2020
        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);

            CurrentPlatform.Init();
            Plugin.CurrentActivity.CrossCurrentActivity.Current.Init(this, savedInstanceState);

            string db         = "tdk_db.sqlite";
            string folderPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
            string dbPath     = Path.Combine(folderPath, db);

            LoadApplication(new App(dbPath));
        }
コード例 #3
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)
        {
            global::Xamarin.Forms.Forms.Init();
            Xamarin.FormsMaps.Init();
            // Init azure services:
            CurrentPlatform.Init();

            // IMPORTANT: Defining a path to a resource in a system in a clever way
            string dbName = "travel_db.sqlite";
            // In iOS, we can not store directly in the personal folder, so we go up a level with ".." and create a new folder "Library"
            // For more information, see Course "The Complete Xamarin Developer Course: iOS and Android, Video 50: DatabasePaths (5:20)"
            string folderPath = System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "..", "Library");
            string fullPath   = System.IO.Path.Combine(folderPath, dbName);

            LoadApplication(new App(fullPath));

            return(base.FinishedLaunching(app, options));
        }
コード例 #4
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();
            SQLitePCL.Batteries.Init();
            CachedImageRenderer.Init();


            Iconize.With(new FontAwesomeModule())
            .With(new IoniconsModule())
            .With(new MedicalFontModule());
            IconControls.Init();


            LoadApplication(new App(new iOSInitializer()));

            return(base.FinishedLaunching(app, options));
        }
コード例 #5
0
        public override void FinishedLaunching(UIApplication application)
        {
            CurrentPlatform.Init();

            UINavigationBar.Appearance.BarTintColor = new UIColor(red: 0, green: 173.0f / 255.0f, blue: 240.0f / 255.0f, alpha: 1);
            UINavigationBar.Appearance.BarTintColor.SetColor();

            UINavigationBar.Appearance.TintColor = UIColor.White;

            UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.LightContent, false);

            UINavigationBar.Appearance.SetTitleTextAttributes(new UITextAttributes()
            {
                TextColor = UIColor.White
            });

            MobileServiceClientProvider.InitializeClient(ConfigurationHub.ReadConfigurationValue("MobSvcUri"), ConfigurationHub.ReadConfigurationValue("AppKey"));
        }
コード例 #6
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            CurrentPlatform.Init();

            View view = inflater.Inflate(PlanYourJourney.Resource.Layout.MyPage, null);

            _textView       = view.FindViewById <TextView>(PlanYourJourney.Resource.Id.my_plans);
            _listView       = view.FindViewById <ListView>(PlanYourJourney.Resource.Id.List_of_Mine);
            _myUsename      = view.FindViewById <TextView>(Resource.Id.account_name);
            _myUsename.Text = MainActivity.MyUsername;
            //CurrentPlatform.Init();

            _adapter             = new ListScreenAdapter(this.Activity);
            _listView.Adapter    = _adapter;
            _listView.ItemClick += OnListItemClick; // to be defined

            return(view);
        }
コード例 #7
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            CurrentPlatform.Init();

            SetContentView(Resource.Layout.Main);
            button    = FindViewById <Button>(Resource.Id.enterButton);
            textView  = FindViewById <TextView>(Resource.Id.welcomeTextView);
            imageView = FindViewById <ImageView>(Resource.Id.imageView1);

            AdjustViewsToDevice();
            checkInternetConnection();

            button.Click += delegate
            {
                ButtonClicked();
            };
        }
コード例 #8
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            CurrentPlatform.Init();

            _window = new UIWindow(UIScreen.MainScreen.Bounds);

            var setup = new Setup(this, _window);

            setup.Initialize();

            var startup = Mvx.Resolve <IMvxAppStart>();

            startup.Start();

            _window.MakeKeyAndVisible();

            return(true);
        }
コード例 #9
0
        protected override async void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Init);

            TVMemeticame                = FindViewById <TextView> (Resource.Id.TVMemeticame);
            TVNombreUsuario             = FindViewById <TextView> (Resource.Id.TVNombreUsuario);
            TVNombreUsuario.Visibility  = ViewStates.Gone;
            TVNumeroTelefono            = FindViewById <TextView> (Resource.Id.TVNumeroTelefono);
            TVNumeroTelefono.Visibility = ViewStates.Gone;
            ETNombreUsuario             = FindViewById <EditText> (Resource.Id.ETNombreUsuario);
            ETNombreUsuario.Visibility  = ViewStates.Gone;
            ETNumeroTelefono            = FindViewById <EditText> (Resource.Id.ETNumeroTelefono);
            ETNumeroTelefono.Visibility = ViewStates.Gone;
            BTRegistrar            = FindViewById <Button> (Resource.Id.BTRegistrar);
            BTRegistrar.Visibility = ViewStates.Gone;


            BTRegistrar.Click += (object sender, EventArgs e) => {
                Tools.usuario.Username    = ETNombreUsuario.Text;
                Tools.usuario.PhoneNumber = ETNumeroTelefono.Text;
                Tools.usuario.DeviceID    = getDeviceID();
                AddItem(Tools.usuario.Username, Tools.usuario.DeviceID, Tools.usuario.PhoneNumber);
                StartActivity(typeof(ContactsActivity));
            };


            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
            UserTable = client.GetSyncTable <User> ();

            /*
             * AddItem ("agustin", "34lkndjh23jhb4kskj4", "+56992320387");
             * AddItem ("pedrod", "hskjhdfg897djhsdmk3", "+56989995553");
             * AddItem ("pedros", "kjndfn8s934mn4mn2n", "+56982474868");
             */
            OnRefreshItemsSelected();
        }
コード例 #10
0
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;


            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            CachedImageRenderer.Init();
            AnimationViewRenderer.Init();
            CarouselViewRenderer.Init();
            UserDialogs.Init(() => (Activity)global::Xamarin.Forms.Forms.Context);

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

            LoadApplication(new App(this));
        }
コード例 #11
0
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            Instance = this;

            CrossCurrentActivity.Current.Init(this, bundle);
            Xamarin.Essentials.Platform.Init(this, bundle);

            //finger print initialization.
            CrossFingerprint.SetCurrentActivityResolver(() => CrossCurrentActivity.Current.Activity);

            CurrentPlatform.Init();

            global::Xamarin.Forms.Forms.Init(this, bundle);
            Ioc.Container = new AndroidBootstrapper().Bootstrap();

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

            Plugin.Iconize.Iconize.Init(Resource.Id.toolbar, Resource.Id.sliding_tabs);

            UserDialogs.Init(() => this);

            System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return(true); };

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

            Stormlion.PhotoBrowser.Droid.Platform.Init(this);

            CrossJobs.ResolveJob = JobBuilder.ResolveJob;

            Xamarin.FormsMaps.Init(this, bundle);

            LoadApplication(new App());

            Ioc.Container.Resolve <IMessageBus>().Subscribe <ExitAppMessage>(message =>
            {
                Finish();
            });
        }
コード例 #12
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();

            // Create the client instance, using the mobile app backend URL.
            client = new MobileServiceClient(applicationURL);

            ToDoActivity.instance = this;
            Gcm.Client.GcmClient.CheckManifest(this);
            Gcm.Client.GcmClient.Register(this, ToDoBroadcastReceiver.senderIDs);



#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();

            Services.ServiceHelper client2 = new Services.ServiceHelper();

            ;

            await client2.InsertarEntidad("*****@*****.**", "RetoN + cf170 + https://github.com/iperezmx87/RetosXamarinChamp/RetoN", Android.Provider.Settings.Secure.GetString(ContentResolver, Android.Provider.Settings.Secure.AndroidId));
        }
コード例 #13
0
        // private string ad;
        protected override async void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            MobileServiceClient baskentpaticlubClient = new MobileServiceClient("https://baskentpaticlub.azurewebsites.net");
            IMobileServiceTable KULUBETEMELTABLO      = baskentpaticlubClient.GetTable("KULUBETEMEL");

            CurrentPlatform.Init();

            gelenKulube = Intent.GetStringExtra("kName");
            JToken ktemel = await KULUBETEMELTABLO.ReadAsync("$filter=KULUBEADI eq " + "'" + gelenKulube + "'");

            List <KULUBETEMEL> Kitems = JsonConvert.DeserializeObject <List <KULUBETEMEL> >(ktemel.ToString());

            lat = Kitems[0].LAT;
            lng = Kitems[0].LNG;

            SetContentView(Resource.Layout.activity_gmaps);
            SetUpMap();
        }
コード例 #14
0
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(bundle);
            global::Xamarin.Forms.Forms.Init(this, bundle);
            Xamarin.FormsMaps.Init(this, bundle);
            //Azure service connection
            CurrentPlatform.Init();

            Plugin.CurrentActivity.CrossCurrentActivity.Current.Init(this, bundle);

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

            LoadApplication(new App(fullPath));
        }
コード例 #15
0
        protected override void OnCreate(Bundle bundle)
        {
            FormsAppCompatActivity.ToolbarResource   = Resource.Layout.toolbar;
            FormsAppCompatActivity.TabLayoutResource = Resource.Layout.tabs;

            base.OnCreate(bundle);

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

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

            ActionBar.SetIcon(Android.Resource.Color.Transparent);

            // Load the main application
            LoadApplication(new App());
        }
コード例 #16
0
        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);

            // Initialize the authenticator before loading the app.
            App.Init(this);

            // Load the main application
            LoadApplication(new App());
        }
コード例 #17
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

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

            #region Azure stuff
            CurrentPlatform.Init();

            Client = new MobileServiceClient(
                Constants.Url,
                Constants.Key);


            #region Azure Sync stuff
            // http://azure.microsoft.com/en-us/documentation/articles/mobile-services-xamarin-android-get-started-offline-data/
            // new code to initialize the SQLite store
            string path = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "test1.db");

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

            var store = new MobileServiceSQLiteStore(path);
            store.DefineTable <TodoItem>();

            Client.SyncContext.InitializeAsync(store).Wait();
            #endregion


            todoTable       = Client.GetSyncTable <TodoItem>();
            todoItemManager = new TodoItemManager(Client, todoTable);

            App.SetTodoItemManager(todoItemManager);
            #endregion region

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

            SetPage(App.GetMainPage());
        }
コード例 #18
0
        //[Java.Interop.Export()]
        //public async void LoginUser(View view)
        //{
        //    // Load data only after authentication succeeds.
        //    if (await Authenticate())
        //    {
        //        //Hide the button after authentication succeeds.
        //        //FindViewById<Button>(Resource.Id.buttonLoginUser).Visibility = ViewStates.Gone;

        //        // Load the data.
        //        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);

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

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

            // Register the app for push notifications.
            GcmClient.Register(this, ToDoBroadcastReceiver.senderIDs);

#if OFFLINE_SYNC_ENABLED
            await InitLocalStoreAsync();

            // Get the sync table instance to use to store TodoItem rows.
            todoTable = client.GetSyncTable <ToDoItem>();
#else
            //userTable = client.GetTable<UserItem>();
            todoTable = client.GetTable <ToDoItem>();
            //var r = await client.InvokeApiAsync("testpm", HttpMethod.Get, null);
#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();
        }
コード例 #19
0
        protected override 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);
            CurrentPlatform.Init();

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



            LoadApplication(new App(fullPath));
        }
コード例 #20
0
        protected override 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();
            Plugin.CurrentActivity.CrossCurrentActivity.Current.Init(this, savedInstanceState);

            string dbName     = "bracco.database.windows.net";
            string folderPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
            string fullPath   = Path.Combine(folderPath, dbName);

            LoadApplication(new App(fullPath));
        }
コード例 #21
0
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.SetFlags("FastRenderers_Experimental");
            global::Xamarin.Forms.Forms.Init(this, bundle);

            Xamarin.FormsMaps.Init(this, bundle);
            CurrentPlatform.Init();

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

            LoadApplication(new App(fullPath));
        }
コード例 #22
0
ファイル: DateMap.xaml.cs プロジェクト: NickPtr/UTaxi
        public async void retrieveLocation()
        {
            var locator = CrossGeolocator.Current;

            locator.DesiredAccuracy = 50;

            var position = await locator.GetPositionAsync(TimeSpan.FromMilliseconds(10000));

            MyMap.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(position.Latitude, position.Longitude), Distance.FromMiles(1)));
            CurrentPlatform.Init();
            this.info.Long = position.Longitude;
            this.info.Lat  = position.Latitude;
            this.info.Date = Date.Text;
            this.info.Time = Time.Text;
            UserDialogs.Instance.ShowLoading("Loading...");
            await App.MobileService.GetTable <Info>().InsertAsync(info);

            UserDialogs.Instance.HideLoading();
        }
コード例 #23
0
ファイル: TodoActivity.cs プロジェクト: Yashwanth1302/Test
        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
            {
                CurrentPlatform.Init();
                // Create the Mobile Service Client instance, using the provided
                // Mobile Service URL and key
                client = new MobileServiceClient(
                    Constants.ApplicationURL,
                    Constants.ApplicationKey, progressHandler);

                await Authenticate();
                await CreateTable();
            }
            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");
            }
        }
コード例 #24
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

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

            CurrentPlatform.Init();

            MobileService = new MobileServiceClient(
                "https://qutbraingearapp.azure-mobile.net/",
                "dqTWRsEygjexEvHVQYjzrneKfvTKBU73"
                );

            // 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(path);

            store.DefineTable <Module>();
            store.DefineTable <QA>();
            store.DefineTable <Comment>();
            store.DefineTable <Skills>();

            // Uses the default conflict handler, which fails on conflict
            MobileService.SyncContext.InitializeAsync(store, new MobileServiceSyncHandler()).Wait();
            QUTBrainGearDB.MobileService = MobileService;

            QUTBrainGearDB.ModuleTable  = MobileService.GetSyncTable <Module> ();
            QUTBrainGearDB.QATable      = MobileService.GetSyncTable <QA> ();
            QUTBrainGearDB.CommentTable = MobileService.GetSyncTable <Comment> ();
            QUTBrainGearDB.SkillsTable  = MobileService.GetSyncTable <Skills> ();

            QUTBrainGearDB.SyncAsync();


            LoadApplication(new App());
        }
コード例 #25
0
ファイル: RecipeActivity.cs プロジェクト: miazga/BazaFitness
        protected override async void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

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

            CurrentPlatform.Init();

            // Create the client instance, using the mobile app backend URL.
            client = new MobileServiceClient(applicationURL);

            recipeTable = client.GetTable <Recipe>();

            rec_icon    = FindViewById <EditText>(Resource.Id.rec_icon);
            rec_name    = FindViewById <EditText>(Resource.Id.rec_name);
            rec_content = FindViewById <EditText>(Resource.Id.rec_content);

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

            listViewToDo.Adapter = adapter;

            spinnerMeal     = FindViewById <Spinner>(Resource.Id.spinnerMeal);
            spinnerCategory = FindViewById <Spinner>(Resource.Id.spinnerCategory);

            var spinnerMealAdapter = ArrayAdapter.CreateFromResource(
                this, Resource.Array.meal_array, Android.Resource.Layout.SimpleSpinnerItem);

            spinnerMealAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            spinnerMeal.Adapter = spinnerMealAdapter;

            var spinnerCategoryAdapter = ArrayAdapter.CreateFromResource(
                this, Resource.Array.category_array, Android.Resource.Layout.SimpleSpinnerItem);

            spinnerCategoryAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            spinnerCategory.Adapter = spinnerCategoryAdapter;

            // Load the items from the mobile app backend.
            OnRefreshItemsSelected();
        }
コード例 #26
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            Core.ViewModels.ViewModelBase.Init();
            ServiceLocator.Instance.Add <IAppInsights, AppInsights>();
            ServiceLocator.Instance.Add <IDeviceSearchProvider, SpotlightService>();

#if DEBUG
            Utils.Helpers.Settings.UserId = string.Empty;

            Xamarin.Calabash.Start();
            #endif

            //Windows Azure
            CurrentPlatform.Init();
            SQLitePCL.CurrentPlatform.Init();

            SetupGlobalAppearances();
            ConfigureJudoPayments();

            var shouldPerformAdditionalDelegateHandling = true;

            // Get possible shortcut item
            if (launchOptions != null)
            {
                LaunchedShortcutItem = launchOptions [UIApplication.LaunchOptionsShortcutItemKey] as UIApplicationShortcutItem;
                shouldPerformAdditionalDelegateHandling = (LaunchedShortcutItem == null);
            }

            // Add dynamic shortcut items
            if (application.ShortcutItems.Length == 0)
            {
                var shortcut3 = new UIMutableApplicationShortcutItem(ShortcutIdentifier.MyBeers, "My Beer")
                {
                    LocalizedSubtitle = "See the beers you've already had",
                    Icon = UIApplicationShortcutIcon.FromTemplateImageName("quickAction.myBeers.png")
                };

                // Update the application providing the initial 'dynamic' shortcut items.
                application.ShortcutItems = new UIApplicationShortcutItem[] { shortcut3 };
            }
            return(shouldPerformAdditionalDelegateHandling);
        }
コード例 #27
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            CurrentPlatform.Init();

            SetContentView(Resource.Layout.layout1);
            ImageView image1 = FindViewById <ImageView>(Resource.Id.banner);

            image1.SetImageResource(Resource.Drawable.clouds);
            var user = FindViewById <EditText>(Resource.Id.uname);
            var pass = FindViewById <EditText>(Resource.Id.upass);



            Button loginbutton = FindViewById <Button>(Resource.Id.login);

            loginbutton.Click += (sender, e) =>
            {
                if (user.Text == "Goutam" && pass.Text == "123")
                {
                    var intent = new Intent(this, typeof(HomeScreen));

                    StartActivity(intent);
                }
                else
                {
                    Toast.MakeText(this, "Wrong Input", ToastLength.Long).Show();
                }
            };
            Button newadbutton = FindViewById <Button>(Resource.Id.newad);

            newadbutton.Click += (sender, e) =>
            {
                var ad = new Intent(this, typeof(Activity2));

                StartActivity(ad);


                Toast.MakeText(this, "There You Go!", ToastLength.Long).Show();
            };
        }
コード例 #28
0
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.tabs;
            ToolbarResource   = Resource.Layout.toolbar;

            CurrentPlatform.Init();
            CachedImageRenderer.Init();

            base.OnCreate(bundle);

            Iconize.With(new FontAwesomeModule())
            .With(new IoniconsModule())
            .With(new MedicalFontModule());

            Forms.Init(this, bundle);

            IconControls.Init(Resource.Id.toolbar, Resource.Id.sliding_tabs);

            LoadApplication(new App(new AndroidInitializer()));
        }
コード例 #29
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            CurrentPlatform.Init();
            MobileCenter.Start("31513391-7567-468b-85ac-7fb7b97d0e5b",
                               typeof(Analytics), typeof(Crashes), typeof(Distribute), typeof(Microsoft.Azure.Mobile.Push.Push));

            global::Xamarin.Forms.Forms.Init();

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

            var csharpSevenFeatures  = new CsharpSevenFeatures();
            var csharpSevenFeatures1 = new CsharpSevenFeatures("User");

            LoadApplication(new App());

            return(base.FinishedLaunching(app, options));
        }
コード例 #30
0
        private string InitializeDatabase()
        {
#if __ANDROID__ || __IOS__
            CurrentPlatform.Init();
#endif
            SQLitePCL.Batteries.Init();

            var path = "localstore.db";

#if __ANDROID__
            path = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), path);

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

            return(path);
        }