Beispiel #1
0
 private void stopButtonClicked()
 {
     if (SinchServiceInterface != null)
     {
         SinchServiceInterface.stopClient();
     }
     finish();
 }
Beispiel #2
0
 public override void onDestroy()
 {
     if (SinchServiceInterface != null)
     {
         SinchServiceInterface.stopClient();
     }
     base.onDestroy();
 }
Beispiel #3
0
 public override void onDestroy()
 {
     if (SinchServiceInterface != null)
     {
         SinchServiceInterface.removeMessageClientListener(this);
         SinchServiceInterface.stopClient();
     }
     base.onDestroy();
 }
        private void declineClicked()
        {
            mAudioPlayer.stopRingtone();
            Call call = SinchServiceInterface.getCall(mCallId);

            if (call != null)
            {
                call.hangup();
            }
            finish();
        }
Beispiel #5
0
        private void endCall()
        {
            mAudioPlayer.stopProgressTone();
            Call call = SinchServiceInterface.getCall(mCallId);

            if (call != null)
            {
                call.hangup();
            }
            finish();
        }
Beispiel #6
0
        public override void onServiceConnected()
        {
            Call call = SinchServiceInterface.getCall(mCallId);

            if (call != null)
            {
                call.addCallListener(new SinchCallListener(this));
                mCallerName.Text = call.RemoteUserId;
                mCallState.Text  = call.State.ToString();
            }
            else
            {
                Log.e(TAG, "Started with invalid callId, aborting.");
                finish();
            }
        }
        protected internal override void onServiceConnected()
        {
            Call call = SinchServiceInterface.getCall(mCallId);

            if (call != null)
            {
                call.addCallListener(new SinchCallListener(this));
                TextView remoteUser = (TextView)findViewById(R.id.remoteUser);
                remoteUser.Text = call.RemoteUserId;
            }
            else
            {
                Log.e(TAG, "Started with invalid callId, aborting");
                finish();
            }
        }
        private void answerClicked()
        {
            mAudioPlayer.stopRingtone();
            Call call = SinchServiceInterface.getCall(mCallId);

            if (call != null)
            {
                call.answer();
                Intent intent = new Intent(this, typeof(CallScreenActivity));
                intent.putExtra(SinchService.CALL_ID, mCallId);
                startActivity(intent);
            }
            else
            {
                finish();
            }
        }
Beispiel #9
0
        private void callButtonClicked()
        {
            string userName = mCallName.Text.ToString();

            if (userName.Length == 0)
            {
                Toast.makeText(this, "Please enter a user to call", Toast.LENGTH_LONG).show();
                return;
            }

            Call   call   = SinchServiceInterface.callUserVideo(userName);
            string callId = call.CallId;

            Intent callScreen = new Intent(this, typeof(CallScreenActivity));

            callScreen.putExtra(SinchService.CALL_ID, callId);
            startActivity(callScreen);
        }
        private void updateUI()
        {
            if (SinchServiceInterface == null)
            {
                return;                 // early
            }

            Call call = SinchServiceInterface.getCall(mCallId);

            if (call != null)
            {
                mCallerName.Text = call.RemoteUserId;
                mCallState.Text  = call.State.ToString();
                if (call.State == CallState.ESTABLISHED)
                {
                    addVideoViews();
                }
            }
        }
Beispiel #11
0
        private void sendMessage()
        {
            string recipient = mTxtRecipient.Text.ToString();
            string textBody  = mTxtTextBody.Text.ToString();

            if (recipient.Length == 0)
            {
                Toast.makeText(this, "No recipient added", Toast.LENGTH_SHORT).show();
                return;
            }
            if (textBody.Length == 0)
            {
                Toast.makeText(this, "No text message", Toast.LENGTH_SHORT).show();
                return;
            }

            SinchServiceInterface.sendMessage(recipient, textBody);
            mTxtTextBody.Text = "";
        }
Beispiel #12
0
        private void loginClicked()
        {
            string userName = mLoginName.Text.ToString();

            if (userName.Length == 0)
            {
                Toast.makeText(this, "Please enter a name", Toast.LENGTH_LONG).show();
                return;
            }

            if (!SinchServiceInterface.Started)
            {
                SinchServiceInterface.startClient(userName);
                showSpinner();
            }
            else
            {
                openPlaceCallActivity();
            }
        }
        public override void onServiceConnected()
        {
            Call call = SinchServiceInterface.getCall(mCallId);

            if (call != null)
            {
                if (!mAddedListener)
                {
                    call.addCallListener(new SinchCallListener(this));
                    mAddedListener = true;
                }
            }
            else
            {
                Log.e(TAG, "Started with invalid callId, aborting.");
                finish();
            }

            updateUI();
        }
Beispiel #14
0
        private void callButtonClicked()
        {
            string userName = mCallName.Text.ToString();

            if (userName.Length == 0)
            {
                Toast.makeText(this, "Please enter a user to call", Toast.LENGTH_LONG).show();
                return;
            }

            try
            {
                Call   call       = SinchServiceInterface.callUser(userName);
                string callId     = call.CallId;
                Intent callScreen = new Intent(this, typeof(CallScreenActivity));
                callScreen.putExtra(SinchService.CALL_ID, callId);
                startActivity(callScreen);
            }
            catch (MissingPermissionException e)
            {
                ActivityCompat.requestPermissions(this, new string[] { e.RequiredPermission }, 0);
            }
        }
        private void answerClicked()
        {
            mAudioPlayer.stopRingtone();
            Call call = SinchServiceInterface.getCall(mCallId);

            if (call != null)
            {
                try
                {
                    call.answer();
                    Intent intent = new Intent(this, typeof(CallScreenActivity));
                    intent.putExtra(SinchService.CALL_ID, mCallId);
                    startActivity(intent);
                }
                catch (MissingPermissionException e)
                {
                    ActivityCompat.requestPermissions(this, new string[] { e.RequiredPermission }, 0);
                }
            }
            else
            {
                finish();
            }
        }
Beispiel #16
0
 private void InitializeInstanceFields()
 {
     mServiceInterface = new SinchServiceInterface(this);
 }
Beispiel #17
0
 public override void onServiceConnected()
 {
     SinchServiceInterface.addMessageClientListener(this);
     ButtonEnabled = true;
 }
		private void InitializeInstanceFields()
		{
			mSinchServiceInterface = new SinchServiceInterface(this);
		}
Beispiel #19
0
 public SinchService()
 {
     mSinchServiceInterface = new SinchServiceInterface(this);
 }