protected override async void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Activity_chargedCards); xmlDb = new XmlDb(this); cardrepo = new CardRepository(); #region banner ads var adView = FindViewById <AdView>(Resource.Id.adView); var adRequest = new AdRequest.Builder().Build(); adView.LoadAd(adRequest); #endregion recyclerView = FindViewById <RecyclerView>(Resource.Id.mvxRecyclerViewChargs); _cards = await GetSavedCardList(); adapter = new ChargedAdapter(this, _cards, recyclerView); recyclerView.SetAdapter(adapter); layoutManager = new LinearLayoutManager(this, LinearLayoutManager.Vertical, false); recyclerView.SetLayoutManager(layoutManager); }
//public event EventHandler CardsChanged; protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Activity_Home); xmlDb = new XmlDb(this); cardrepo = new CardRepository(); Button bt = FindViewById <Button>(Resource.Id.buttonCharge); //https://www.c-sharpcorner.com/article/xamarin-android-create-android-navigation-drawer-layout-using-support-design/ drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); // Create ActionBarDrawerToggle button and add it to the toolbar toolbar = FindViewById <V7Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); var drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, Resource.String.drawer_open, Resource.String.drawer_close); // drawerLayout.SetDrawerListener(drawerToggle); drawerLayout.AddDrawerListener(drawerToggle); drawerToggle.SyncState(); navigationView = FindViewById <NavigationView>(Resource.Id.nav_view); setupDrawerContent(navigationView); //Calling Function imagePlus = toolbar.FindViewById <ImageView>(Resource.Id.imagePlus); loading = FindViewById <ProgressBar>(Resource.Id.progressBarhome); recyclerView = FindViewById <RecyclerView>(Resource.Id.mvxRecyclerViewProducts); // recyclerView.AddOnItemTouchListener(this); #region ads adView = FindViewById <AdView>(Resource.Id.adView); var adRequest = new AdRequest.Builder().Build(); //var adRequestTst = new AdRequest.Builder().AddTestDevice("4E811BB7106DD61A6306B379A856A2B1"); adView.LoadAd(adRequest); mInterstitialAd = new InterstitialAd(this); mInterstitialAd.AdUnitId = GetString(Resource.String.interstital_ad_unit_id_home); mInterstitialAd.AdListener = new InterstitailAdListener(this); //AdRequest.Builder(). #endregion bt.Click += Bt_Click; imagePlus.Click += ImagePlus_Click; }
static void Main(string[] args) { XmlDb mydb = new XmlDb(@"D:\xmldb.xml", string.Empty); Console.WriteLine("Reading existing database"); Console.WriteLine(" "); Console.WriteLine("**************************************"); mydb.LoadXmlDb(); Console.WriteLine("Printing table data:"); PrintList("Security", mydb.GetListItems("Security")); Console.WriteLine(" "); Console.WriteLine("Printing table data:"); PrintList("Order", mydb.GetListItems("Order")); Console.WriteLine(" "); Console.WriteLine("Printing table data:"); PrintList("Contact", mydb.GetListItems("Contact")); Console.ReadLine(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Activity_services); xmlDb = new XmlDb(this); cardrepo = new CardRepository(); servicesListView = FindViewById <ExpandableListView>(Resource.Id.expandableListViewSer); var local = Resources.Configuration.Locale; serviceis = cardrepo.GetDefaultCardServiceList(local.Country); servicesadapter = new ServicesExpanableAdapter(this, serviceis); servicesListView.SetAdapter(servicesadapter); servicesListView.ChildClick += ServicesListView_ChildClick; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_setting); xmlDb = new XmlDb(this); cardrepo = new CardRepository(); #region banner ads var adView = FindViewById <AdView>(Resource.Id.adView); var adRequest = new AdRequest.Builder().Build(); adView.LoadAd(adRequest); #endregion dailGrou = FindViewById <RadioGroup>(Resource.Id.radioGroupDial); redBoxCheck = FindViewById <CheckBox>(Resource.Id.checkBoxRed); dailGrou.CheckedChange += DailGrou_CheckedChange; redBoxCheck.CheckedChange += RedBoxCheck_CheckedChange; }
static void Main(string[] args) { Console.WriteLine("Creating new database"); Console.WriteLine(" "); Console.WriteLine("**************************************"); XmlDb mydb = new XmlDb(@"D:\xmldbtest.xml", @"D:\xmldbtestlog.xml"); //create tables from scratch Dictionary <string, Type> myfields = new Dictionary <string, Type> { { "Id", typeof(int) }, { "Name", typeof(string) }, { "Type", typeof(string) } }; mydb.AddTable("Security", myfields); mydb.AddTable("Order", myfields); mydb.AddTable("Contact", new Dictionary <string, Type> { { "Id", typeof(int) }, { "Name", typeof(string) }, { "Surname", typeof(string) } }); mydb.AddListItem("Order", new List <Dictionary <string, string> > { new Dictionary <string, string> { { "Name", "Name1" }, { "Type", "1000" } }, new Dictionary <string, string> { { "Name", "Name2" }, { "Type", "2000" } }, new Dictionary <string, string> { { "Name", "Name3" }, { "Type", "3000" } } }); //crud operations on tables mydb.AddItem("Contact", new Dictionary <string, string> { { "Name", "Name1" }, { "Surname", "Surname1" } }); mydb.AddItem("Security", new Dictionary <string, string> { { "Name", "NameSecurity0" }, { "Type", "TypeSecurity0" } }); mydb.AddItem("Security", new Dictionary <string, string> { { "Name", "NameSecurity1" }, { "Type", "TypeSecurity1" } }); mydb.AddItem("Security", new Dictionary <string, string> { { "Name", "NameSecurity1" }, { "Type", "TypeSecurity1" } }); mydb.UpdateItem("Security", new Dictionary <string, string> { { "Name", "NameSecurity1" }, { "Type", "TypeSecurity1" } }, new Dictionary <string, string> { { "Name", "NameSecurity2" }, { "Type", "TypeSecurity2" } }); mydb.RemoveItem("Security", new Dictionary <string, string> { { "Name", "NameSecurity0" }, { "Type", "TypeSecurity0" } }); Console.WriteLine("Printing table data:"); PrintList("Security", mydb.GetListItems("Security")); Console.WriteLine(" "); Console.WriteLine("Printing table data:"); PrintList("Order", mydb.GetListItems("Order")); Console.WriteLine(" "); Console.WriteLine("Printing table data:"); PrintList("Contact", mydb.GetListItems("Contact")); Console.WriteLine(" "); Console.WriteLine(" "); Console.WriteLine("completed. "); Console.ReadLine(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Activity_camera); xmlDb = new XmlDb(this); cardrepo = new CardRepository(); chargedNumbers = new List <string>(); camView = FindViewById <SurfaceView>(Resource.Id.MainSurfaceView); tv = FindViewById <TextView>(Resource.Id.txt); flashImage = FindViewById <ImageView>(Resource.Id.imageViewFlash); flashImage.Visibility = ViewStates.Visible; TextRecognizer txtRecognizer = new TextRecognizer.Builder(ApplicationContext).Build(); if (!txtRecognizer.IsOperational) { //https://stackoverflow.com/questions/38254349/google-mobile-vision-text-api-example IntentFilter lowstorageFilter = new IntentFilter(Intent.ActionDeviceStorageLow); bool hasLowStorage = RegisterReceiver(null, lowstorageFilter) != null; if (hasLowStorage) { string ok = GetString(Resource.String.home_ok); var builder = new Android.Support.V7.App.AlertDialog.Builder(this); builder.SetIconAttribute (Android.Resource.Attribute.AlertDialogIcon); builder.SetTitle(""); builder.SetMessage(GetString(Resource.String.cam_lowStorage)); builder.SetPositiveButton(ok, delegate { }); builder.Create().Show(); //Toast.MakeText(this, " Low Storage, delete some files", ToastLength.Long).Show(); } Toast.MakeText(this, GetString(Resource.String.cam_Detector_not_ready), ToastLength.Short).Show(); Log.Error("CameraActivity", "Detector not ready"); } else { camSource = new CameraSource.Builder(ApplicationContext, txtRecognizer) .SetFacing(CameraFacing.Back) .SetRequestedPreviewSize(1280, 1024) .SetRequestedFps(2.0f) .SetAutoFocusEnabled(true) .Build(); camView.Holder.AddCallback(this); txtRecognizer.SetProcessor(this); } GetChargedList(); #region Flash light // FlashlightIsAvailableOrNot(); // mCameraManager = (CameraManager)GetSystemService(Context.CameraService); //try //{ // mCameraId = mCameraManager.GetCameraIdList()[0]; //} //catch (CameraAccessException e) //{ // e.PrintStackTrace(); //} //CameraDeviceCallback callBack = new CameraDeviceCallback(); //mCameraManager.OpenCamera(mCameraId, callBack, null); //mCameraDevice = callBack.Device; //mPreviewBuilder = mCameraDevice.CreateCaptureRequest(CameraTemplate.Preview); /* * mPreviewBuilder = mCameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW); * * Surface previewSurface = new Surface(texture); * mPreviewBuilder.addTarget(previewSurface); */ flashImage.Click += FlashImage_Click; #endregion redBox = FindViewById <ImageView>(Resource.Id.imageViewRedBox); #region banner ads var adView = FindViewById <AdView>(Resource.Id.adView); var adRequest = new AdRequest.Builder().Build(); adView.LoadAd(adRequest); #endregion }