Exemplo n.º 1
0
        public override void onDetach()
        {
            base.onDetach();

            Log.i(LOGTAG, "On detach Subscriber control fragment");
            mCallbacks = sOpenTokCallbacks;
        }
Exemplo n.º 2
0
        protected internal override void onCreate(Bundle savedInstanceState)
        {
            base.onCreate(savedInstanceState);

            // Generate a key
            // IMPORTANT! This is a silly way to generate a key. It is also never stored.
            // For proper key handling please consult:
            // * https://developer.android.com/training/articles/keystore.html
            // * http://nelenkov.blogspot.dk/2012/05/storing-application-secrets-in-androids.html
            sbyte[] key = new sbyte[64];
            (new SecureRandom()).NextBytes(key);
            RealmConfiguration realmConfiguration = (new RealmConfiguration.Builder(this)).encryptionKey(key).build();

            // Start with a clean slate every time
            Realm.deleteRealm(realmConfiguration);

            // Open the Realm with encryption enabled
            realm = Realm.getInstance(realmConfiguration);

            // Everything continues to work as normal except for that the file is encrypted on disk
            realm.beginTransaction();
            Person person = realm.createObject(typeof(Person));

            person.Name = "Happy Person";
            person.Age  = 14;
            realm.commitTransaction();

            person = realm.@where(typeof(Person)).findFirst();
            Log.i(TAG, string.Format("Person name: {0}", person.Name));
        }
Exemplo n.º 3
0
 public virtual void parsePayload(sbyte[] payload)
 {
     Log.i(tag, "parsePayload");
     try
     {
         string name = new string(Arrays.copyOfRange(payload, 0, 16), "UTF-8");
         if (name.Length == 0)
         {
             name = tag;
         }
         this.name = name;
         string groupName = new string(Arrays.copyOfRange(payload, 16, 32), "UTF-8");
         if (groupName.Length == 0)
         {
             groupName = "unassigned";
         }
         this.groupName = groupName;
     }
     catch (UnsupportedEncodingException)
     {
     }
     this.groupNumber        = payload[32] & 255;
     this.mode               = payload[33] & 255;
     this.brightness         = payload[34] & 255;
     this.ambientColor       = Arrays.copyOfRange(payload, 35, 38);
     this.saturation         = Arrays.copyOfRange(payload, 38, 41);
     this.fadeRate           = payload[41] & 255;
     this.sectorAssignment   = Arrays.copyOfRange(payload, 42, 57);
     this.espFirmwareVersion = Arrays.copyOfRange(payload, 57, 59);
     if (payload.Length == 62)
     {
         this.ambientModeType = payload[59] & 255;
         this.ambientShowType = payload[60] & 255;
     }
 }
Exemplo n.º 4
0
            public override void onLogMessage(int level, string area, string message)
            {
                switch (level)
                {
                case Log.DEBUG:
                    Log.d(area, message);
                    break;

                case Log.ERROR:
                    Log.e(area, message);
                    break;

                case Log.INFO:
                    Log.i(area, message);
                    break;

                case Log.VERBOSE:
                    Log.v(area, message);
                    break;

                case Log.WARN:
                    Log.w(area, message);
                    break;
                }
            }
        private void showStatus(string txt)
        {
            Log.i(TAG, txt);
            TextView tv = new TextView(this);

            tv.Text = txt;
            rootLayout.addView(tv);
        }
        /// <summary>
        /// Starts the Hello-World app with UI. See OpenTokUI.java
        /// </summary>
        public virtual void startHelloWorldUI()
        {
            Log.i(LOGTAG, "starting hello-world app with UI");

            Intent intent = new Intent(OpenTokSamples.this, typeof(UIActivity));

            intent.Flags = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP;
            startActivity(intent);
        }
        /// <summary>
        /// Starts the Hello-World app using subclassing. See
        /// MultipartyActivity.java
        /// </summary>
        public virtual void startHelloWorldSubclassing()
        {
            Log.i(LOGTAG, "starting hello-world app using subclassing");

            Intent intent = new Intent(OpenTokSamples.this, typeof(MultipartyActivity));

            intent.Flags = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP;
            startActivity(intent);
        }
        /// <summary>
        /// Starts the voice only Hello-World app. See
        /// VoiceOnlyActivity.java
        /// </summary>
        public virtual void startVoiceOnly()
        {
            Log.i(LOGTAG, "starting hello-world app using voice only");

            Intent intent = new Intent(OpenTokSamples.this, typeof(VoiceOnlyActivity));

            intent.Flags = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP;
            startActivity(intent);
        }
        /// <summary>
        /// Starts the Hello-World app using a custom audio device. See
        /// AudioDeviceActivity.java
        /// </summary>
        public virtual void startAudioDevice()
        {
            Log.i(LOGTAG, "starting hello-world app using a custom audio device");

            Intent intent = new Intent(OpenTokSamples.this, typeof(AudioDeviceActivity));

            intent.Flags = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP;
            startActivity(intent);
        }
        /// <summary>
        /// Starts the Hello-World app in the emulator. See
        /// EmulatorActivity.java
        /// </summary>
        public virtual void startHelloWorldEmulator()
        {
            Log.i(LOGTAG, "starting hello-world app for Android emulator");

            Intent intent = new Intent(OpenTokSamples.this, typeof(EmulatorActivity));

            intent.Flags = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP;
            startActivity(intent);
        }
        /// <summary>
        /// Starts the Hello-World app using the default video capturer feature. See
        /// DefaultCameraCapturerActivity.java
        /// </summary>
        public virtual void startDefaultCameraCapturer()
        {
            Log.i(LOGTAG, "starting hello-world app for default video capturer setting a preferred resolution and frame rate");

            Intent intent = new Intent(OpenTokSamples.this, typeof(DefaultCameraCapturerActivity));

            intent.Flags = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP;
            startActivity(intent);
        }
        /// <summary>
        /// Starts the Hello-World app using a custom video renderer with the screenshot option. See
        /// ScreenshotActivity.java
        /// </summary>
        public virtual void startScreenshot()
        {
            Log.i(LOGTAG, "starting hello-world app with screenshot option");

            Intent intent = new Intent(OpenTokSamples.this, typeof(ScreenshotActivity));

            intent.Flags = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP;
            startActivity(intent);
        }
Exemplo n.º 13
0
        private void showStatus(string txt)
        {
            Log.i(TAG, txt);
            TextView tv = new TextView(Activity);

            tv.Text      = txt;
            tv.TextColor = Resources.getColor(android.R.color.white);
            logsView.addView(tv);
        }
        /// <summary>
        /// Starts the Hello-World app using a custom video renderer. See
        /// VideoRendererActivity.java
        /// </summary>
        public virtual void startHelloWorldVideoRenderer()
        {
            Log.i(LOGTAG, "starting hello-world app using a customer video capturer");

            Intent intent = new Intent(OpenTokSamples.this, typeof(VideoRendererActivity));

            intent.Flags = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP;
            startActivity(intent);
        }
Exemplo n.º 15
0
            public virtual void zoomApplied(ZoomEvent e)
            {
                string type = "out";

                if (e.ZoomIn)
                {
                    type = "in";
                }
                Log.i("Zoom", "Zoom " + type + " rate " + e.ZoomRate);
            }
Exemplo n.º 16
0
        public override void onAttach(Activity activity)
        {
            base.onAttach(activity);

            Log.i(LOGTAG, "On attach Publisher status fragment");
            openTokActivity = (UIActivity)activity;
            if (!(activity is PublisherCallbacks))
            {
                throw new System.InvalidOperationException("Activity must implement fragment's callback");
            }
        }
Exemplo n.º 17
0
        public override void onAttach(Activity activity)
        {
            base.onAttach(activity);
            Log.i(LOGTAG, "On attach Subscriber control fragment");
            openTokActivity = (UIActivity)activity;
            if (!(activity is SubscriberCallbacks))
            {
                throw new System.InvalidOperationException("Activity must implement fragment's callback");
            }

            mCallbacks = (SubscriberCallbacks)activity;
        }
Exemplo n.º 18
0
 public virtual void onClickSend(View v)
 {
     if (mMessageEditText.Text.ToString().CompareTo("") == 0)
     {
         Log.i(LOGTAG, "Cannot Send - Empty String Message");
     }
     else
     {
         Log.i(LOGTAG, "Sending a chat message");
         mSession.sendChatMessage(mMessageEditText.Text.ToString());
         mMessageEditText.Text = "";
     }
 }
            public override void onClick(View arg0)
            {
                playClickAnim(arg0);
                switch (arg0.Id)
                {
                case R.id.img01:
                    Log.i(TAG, "clicked iamge icon 01.");
                    outerInstance.mainText.Text = "Selected pencil icon.";
                    break;

                case R.id.img02:
                    Log.i(TAG, "clicked iamge icon 02.");
                    outerInstance.mainText.Text = "Selected pen icon.";
                    break;

                case R.id.img03:
                    Log.i(TAG, "clicked iamge icon 03.");
                    outerInstance.mainText.Text = "Selected high lighter icon.";
                    break;

                case R.id.img04:
                    Log.i(TAG, "clicked iamge icon 04.");
                    outerInstance.mainText.Text = "Selected calligraphy brush icon.";
                    break;

                case R.id.img05:
                    Log.i(TAG, "clicked iamge icon 05.");
                    outerInstance.mainText.Text = "Selected brush icon.";
                    break;

                case R.id.img06:
                    Log.i(TAG, "clicked iamge icon 06.");
                    outerInstance.mainText.Text = "Selected marker icon.";
                    break;
                }
            }
Exemplo n.º 20
0
 public virtual void panApplied()
 {
     Log.i("Pan", "New X range=[" + outerInstance.mRenderer.XAxisMin + ", " + outerInstance.mRenderer.XAxisMax + "], Y range=[" + outerInstance.mRenderer.YAxisMax + ", " + outerInstance.mRenderer.YAxisMax + "]");
 }
Exemplo n.º 21
0
 public override void onDetach()
 {
     base.onDetach();
     Log.i(LOGTAG, "On detach Publisher status fragment");
 }
Exemplo n.º 22
0
 public virtual void setSectorData(sbyte[] sectorData2, bool broadcastingToGroup)
 {
     this.sectorData = sectorData2;
     Log.i(tag, "setSectorData ");
     sendUDPWrite(3, 22, sectorData2, broadcastingToGroup);
 }
Exemplo n.º 23
0
 public virtual void setSectorAssignment(sbyte[] sectorAssignment2, bool broadcastingToGroup)
 {
     this.sectorAssignment = sectorAssignment2;
     Log.i(tag, "setSectorAssignment ");
     sendUDPWrite(3, 23, sectorAssignment2, broadcastingToGroup);
 }
Exemplo n.º 24
0
 public override void onConnected(Bundle bundle)
 {
     /* Connected with Google API, use this to authenticate with Firebase */
     Log.i(TAG, "Login Connected");
     GoogleOAuthTokenAndLogin;
 }
Exemplo n.º 25
0
 public override void onConnectionSuspended(int i)
 {
     Log.i(TAG, "Login Suspended");
     // ignore
 }
Exemplo n.º 26
0
 public virtual void zoomReset()
 {
     Log.i("Zoom", "Reset");
 }