private void GetConfigList() { DBManagerHelper dbmgr = new DBManagerHelper(this); DatabaseUpdates tblConfigList = new DatabaseUpdates(); var eListAdapt = new ConfigAdapter(this, tblConfigList.GetConfigList()); eListAdapt.NotifyDataSetChanged(); var lvConfigList = FindViewById <ListView>(Resource.Id.lvConfigList); lvConfigList.Adapter = eListAdapt; }
private void RetrieveDBMail() { EmailsToRead = ""; DBManagerHelper dbmgr = new DBManagerHelper(this); DatabaseUpdates tblEmail = new DatabaseUpdates(); var eListAdapt = new EmailListAdapter(this, tblEmail.EmailOBJ()); eListAdapt.NotifyDataSetChanged(); var emailListView = FindViewById <ListView>(Resource.Id.lvEmailList); emailListView.Adapter = eListAdapt; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.ConfigEditor); ConfigName = Intent.GetStringExtra("ConfigName") ?? "From Data not available"; ConfigValue = Intent.GetStringExtra("ConfigValue") ?? "Date Data not available"; ConfigType = Intent.GetStringExtra("ConfigType") ?? "CC Data not available"; var tvNameConfigEdit = FindViewById <TextView>(Resource.Id.tvNameConfigEdit); tvNameConfigEdit.Text = ConfigName; var etxtValueConfigEdit = FindViewById <EditText>(Resource.Id.etxtValueConfigEdit); etxtValueConfigEdit.Text = ConfigValue; var btnBackConfigEdit = FindViewById <Button>(Resource.Id.btnBackConfigEdit); btnBackConfigEdit.Click += delegate { Finish(); }; var btnSaveConfigEdit = FindViewById <Button>(Resource.Id.btnSaveConfigEdit); btnSaveConfigEdit.Click += delegate { //save method here DBManagerHelper dbmgr = new DBManagerHelper(this); DatabaseUpdates tblConfigList = new DatabaseUpdates(); tblConfigList.UpdateConfig(new DataManager.ConfigEntity() { Name = ConfigName, Value = ConfigValue, Type = ConfigType }); dbmgr.Close(); Toast.MakeText(this, "Configuration Update Successful", 0); }; }
private void RetrievePOP3Mail() { EmailsToRead = ""; using (var client = new Pop3Client()) { // accept all SSL certificates (in case the server supports STARTTLS) client.ServerCertificateValidationCallback = (s, c, h, e) => true; //Console.WriteLine("Connecting to MailServer" + GetString(Resource.String.GDSSEMailServerHost) +" port 995"); //Toast.MakeText(this, "Email Sync: Authenticating to Server", ToastLength.Long).Show(); client.Connect(GetString(Resource.String.GDSSEMailServerHost), int.Parse(GetString(Resource.String.GDSSEMailServerPort)), true); // Note: since we don't have an OAuth2 token, disable // the XOAUTH2 authentication mechanism. client.AuthenticationMechanisms.Remove("XOAUTH2"); client.Authenticate(GetString(Resource.String.GDSSEMailAccount), GetString(Resource.String.GDSSEMailPwd)); var emails = new List <EmailObject>(); DBManagerHelper dbmgr = new DBManagerHelper(this); DatabaseUpdates tblEmail = new DatabaseUpdates(); //var tblEmail = new EmailEntity(); //Toast.MakeText(this, "Email Sync: Downloading Emails", ToastLength.Long).Show(); //for testing purpose only / clearing of table. if (int.Parse(GetString(Resource.String.TestDeleteEmailsOn)) == 1) { tblEmail.ClearMail(); } for (int i = client.Count - 1; i >= 0; i--) { var message = new MimeMessage(); try { message = client.GetMessage(i); } catch (Exception ex) { Console.WriteLine(ex.Source + " || " + ex.Message); } if (!tblEmail.IsEmailExist(message.MessageId)) { var curemail = new EmailObject(message.MessageId, message.From.ToString(), message.Subject, message.TextBody, message.Cc.ToString(), DateTime.Parse(message.Date.ToString())); try { tblEmail.AddEmail(new EmailEntity { EmailID = curemail.EmailID ?? "0", EmailFrom = curemail.From, EmailCC = curemail.CC, EmailDate = curemail.date, EmailSubject = curemail.Subject, EmailBody = curemail.Body }); } catch (Exception ex) { Console.WriteLine(ex.Source + "||" + ex.Message); } } } client.Disconnect(true); dbmgr.Close(); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); using (DBManagerHelper dbmgr = new DBManagerHelper(this)) { dbmgr.OnCreate(null); } // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); // set the isRecording flag to false (not recording) isRecording = false; //initialize speech to text (input) InitSTTMethod(); //initialize text to speech (read/speak) InitTTSMethod(); recButton = FindViewById <ImageButton>(Resource.Id.imgBtnListen); recButton.Click += delegate { if (textToSpeech.IsSpeaking) { textToSpeech.Stop(); } if (!NeedToSpeak) { ListenToSpeech(0); } else { InvokeRead(); }; }; callButton = FindViewById <ImageButton>(Resource.Id.imgBtnCall); callButton.Click += delegate { InvokeRead("Phone Call", 0); StartActivity(typeof(Activities.PhoneCallActivity)); }; var smsButton = FindViewById <ImageButton>(Resource.Id.imgBtnSMS); smsButton.Click += delegate { InvokeRead("SMS Message", 0); StartActivity(typeof(Activities.MessageActivity)); }; var mailButton = FindViewById <ImageButton>(Resource.Id.imgBtnEmail); mailButton.Click += delegate { InvokeRead("Emails", 0); StartActivity(typeof(Activities.EmailActivity)); }; var otherButton = FindViewById <ImageButton>(Resource.Id.imgBtnOther); otherButton.Click += delegate { //StartActivity(typeof(Activities.EmailActivity)); }; var exitButton = FindViewById <ImageButton>(Resource.Id.imgBtnAppExit); exitButton.Click += delegate { //System.Environment.Exit(0); //this.FinishAffinity(); Process.KillProcess(Process.MyPid()); }; ActivityStatus = "Created"; }