topic | products | languages | extensions | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sample |
|
|
|
Skype for Business Mobile URI SDK Sample
Table of contents
- Device requirement
- Prerequisites
- Configure the project
- Run the project
- Questions and comments
- Contributing
- Additional resources
Does your app show a people list that includes telephone numbers or Skype for Business Ids? How cool would it be if your app could launch a new chat, audio, or video call in the Skype for Business client installed on the Android device? With the code in this sample, all you need to do is ask a user to pick a person from your list (along with the associated phone number or Skype address), pick chat, audio, or video, and with a few lines of code, your app launches Skype in a new full screen activity. The call is already queued with the phone number or id.
##The code Just add the following code from the sample into your app.
Button skypeButton = (Button) findViewById(R.id.button);
final EditText SIPAddress = (EditText) findViewById(R.id.SIPAddress) ;
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="+SIPAddress.getText().toString();
if (videoCall.isChecked()){
uriString +="&video=true";
}
Uri uri = Uri.parse(uriString);
Intent callIntent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(callIntent);
}
} );
##The sample
The sample has only a main activity with a text box and button. So simple.
##Device requirement To run the Skype Android Mobile SDK samples project, your device must meet the following requirement:
- Android API level 17 or newer
- Skype for Business - Android App installed. Get Skype for Business for Android from Google Play
###Prerequisites To use the Skype Android Mobile SDK samples project, you need the following:
- The latest version of Android Studio.
- The Gradle build automation system version 2.2.1 or later.
- A Skype for Business or Skype for Business Online account.
- Java Development Kit (JDK) 7.
##Configure the project
- Download or clone the Skype-Android-Mobile-SDK-Samples.
- Start Android Studio.
- From the Welcome to Android Studio dialog box, choose Import project (Eclipse ADT, Gradle, etc).
- Select the settings.gradle file in the Skype-for-Business-Android-Uri-Sample folder, and then click OK.
- Respond to the dialog box ("Gradle Sync: Gradle settings for this project are not configured yet. Would you like the project to use the Gradle wrapper? ") by clicking the OK button to use the Gradle wrapper.
##Run the project After you've built the project you can run it on a device. Video calling is not currently supported on Android emulators.
- Run the project.
- Enter a telephone number with area code or enter a Skype for Business Id.
- Optionally, check the Video call checkbox.
- Click the MAKE SKYPE CALL button to start the call.
Questions and comments
We'd love to get your feedback about the Android Skype-Android-Mobile-SDK-Samples. You can send your feedback to us in the Issues section of this repository.
General questions about Office 365 development should be posted to Stack Overflow. Make sure that your questions are tagged with [Office365] and [API].
Contributing
You will need to sign a Contributor License Agreement before submitting your pull request. To complete the Contributor License Agreement (CLA), you will need to submit a request via the form and then electronically sign the CLA when you receive the email containing the link to the document.
This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Additional resources
- Skype for Business - Mobile URIs documentation
- Microsoft Office 365 API Tools
- Office Dev Center for Skype
- Office 365 APIs starter projects and code samples
Copyright
Copyright (c) 2015 Microsoft. All rights reserved.