2017-01-09 1 views
0

Android 기기에 Skype 및 Skype for Business가 설치되어 있습니다. Skype for Business로 프로그래밍 방식으로 VOIP 통화를하고 싶습니다. 나는과 같이 의도를 만들 : 나는 전화를 걸 의도를 시작하면Skype for Business 통화 의도

Intent intent = new Intent("android.intent.action.VIEW"); 
intent.setData(Uri.parse("skype:" + somePhoneNumber)); 
context.startActivity(intent); 

, 팝업이 나타납니다

작업 완료 사용 :
스카이프
에게 전화
한 번만 항상

Skype for Business가 없습니다.

은 내가 followoing을 시도하지만 (IllegalArgument가)

intent.setData(Uri.parse("skype for business:" + somePhoneNumber)); 

내가 무엇을 할 수 충돌? 은 MSDN docs에서 언급 한 바와 같이

답변

1

이야 .skype.xml

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/skype_layout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" 
    android:padding="20dp"> 

    <EditText 
     android:id="@+id/skypeEmailAddress" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:padding="20dp" 
     android:hint="[email protected]" 
     android:inputType="textEmailAddress" 
     android:textSize="30sp"/> 

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="horizontal"> 

     <Button 
      android:id="@+id/skype_button" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_marginRight="20dp" 
      android:textSize="30sp" 
      android:text="@string/make_skype_call" /> 

     <CheckBox 
      android:id="@+id/videoCheck" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="@string/video_call" 
      android:textSize="30sp"/> 

    </LinearLayout> 
</LinearLayout> 

의 AndroidManifest.xml은

<!-- Skype Activity --> 
<activity 
    android:name="com.somwhere.myproject.SkypeActivity" 
    android:label="@string/skype_activity_title" 
    android:theme="@style/Theme.AppCompat"> 
    <meta-data 
     android:name="android.support.PARENT_ACTIVITY" 
     android:value=".MainActivity"/> 
</activity> 

그와

Intent intent = new Intent(activity, SkypeActivity.class); 
intent.putExtra(activity.getResources().getString(R.string.skypeEmailAddress), "[email protected]"); 
activity.startActivity(intent); 
0

, 비즈니스 의도에 대한 Skype를 호출이 사용

strings.xml의

<!-- skype --> 
<string name="skype_activity_title">Skype for Business call</string> 
<string name="make_skype_call">Make Skype Call</string> 
<string name="video_call">Video call</string> 
<string name="permission_rationale">"Contacts permissions are needed for providing email completions."</string> 
<string name="skypeEmailAddress">skypeEmailAddress</string> 

고해상도/레이아웃 : 나는 그것을 어떻게

다음
Intent intent = new Intent("android.intent.action.VIEW"); 
intent.setData(Uri.parse("ms-sfb://call?id=" + somePhoneNumber)); 
context.startActivity(intent); 
+0

(아마도 버튼 클릭)에 SkypeActivity.java

package com.somwhere.myproject; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.CheckBox; import android.widget.EditText; public class SkypeActivity extends AppCompatActivity { private static final String TAG = "SkypeActivity"; private static final int REQUEST_READ_CONTACTS = 0; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent intent = getIntent(); final String skypeEmailAddress = intent.getStringExtra(getResources().getString(R.string.skypeEmailAddress)); setContentView(R.layout.skype); final EditText skypeEmailAddressText = (EditText) findViewById(R.id.skypeEmailAddress); skypeEmailAddressText.setText(skypeEmailAddress); Button skypeButton = (Button) findViewById(R.id.skype_button); Log.i(TAG, "skypeEmailAddress: " + skypeEmailAddress); final CheckBox videoCall = (CheckBox) findViewById(R.id.videoCheck); skypeButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { String uriString = "ms-sfb://call?id=" + skypeEmailAddress; if (videoCall.isChecked()) { uriString += "&video=true"; } Uri uri = Uri.parse(uriString); Intent callIntent = new Intent(Intent.ACTION_VIEW, uri); startActivity(callIntent); } }); } } 

MainActivity.java 내가 얻을 : * ActivityNotFoundException : 없음 활동에 발견 handle id = (212) 555-1212} * –

+0

예제와 같이 id 매개 변수의 포맷을 시도 했습니까? ' "ms-sfb : // call? id = + 1425-555-1234"' –

관련 문제