Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Understanding the Connect sample code

Ricardo Loo edited this page Nov 4, 2015 · 5 revisions

The Connect sample uses three classes, AuthenticationManager, DiscoveryManager, and MailManager to manage interactions with Office 365. Look at the AuthenticationManager.connect, DiscoveryManager.getServiceInfo, and MailManager.sendMail methods to see how the SDK objects are used.

The Connect sample tasks include:

Connect to Office 365

The sample provides the code required to display the Office 365 sign in page if there are no tokens available already in the local cache. The sample uses the Azure Active Directory Library for Android to manage the tokens required for the app to use Office 365 services.

For more details, check the AuthenticationManager class.

Discover service

Once your app has connected to Office 365, it's time to get service endpoints. The sample uses the Discovery Service to get the Mail Service endpoint.

For more details, check the DiscoveryManager class.

Send email

With the service endpoints, your app can use Office 365 services, such as Mail. The sample uses the Mail Service to send an email from your Office 365 account to the address of your choice.

For more details, check the MailManager class.

Note: The Connect sample declares the required dependencies in the build.gradle file. The dependencies are: