Awesome
[ARCHIVED] Office 365 Profile Sample for Android Using Microsoft Graph
Note: This repo is archived and no longer actively maintained. Security vulnerabilities may exist in the project, or its dependencies. If you plan to reuse or run any code from this repo, be sure to perform appropriate security checks on the code or dependencies first. Do not use this project as the starting point of a production Office Add-in. Always start your production code by using the Office/SharePoint development workload in Visual Studio, or the Yeoman generator for Office Add-ins, and follow security best practices as you develop the add-in.
The first page presents you with a list of users. The second page displays information about any user you choose to view. All of this information, including files shared with the user, the user's alias, hire date, manager, direct reports, and groups comes from Microsoft Graph (previously called Office 365 unified API).
The following image shows the user's page that displays the information mentioned above:
Device requirements
To run the Profile sample, your device needs to meet the following requirements:
- Android API level 14 or later.
Prerequisites
To use the Office 365 Profile sample for Android you need the following:
- Android Studio version 1.0 or later.
- An Office 365 account. You can join the Office 365 Developer Program and get a free 1 year subscription to Office 365 that includes the resources that you need to start building Office 365 apps. > Note: If you already have a subscription, the previous link sends you to a page that says Sorry, you can’t add that to your current account. In that case use an account from your current Office 365 subscription.
- A client ID and redirect URI values of an application registered in Microsoft Azure. The application must run the following permissions:
- Microsoft Graph
- Read items in all site collections
- Read all files that user can access
- Access directory as the signed in user
- Read all users' basic profiles
- Microsoft Graph
You can also add a native client application in Azure and grant proper permissions to it.
Open the sample using Android Studio
- Install Android Studio and add the Android SDK packages according to the instructions on developer.android.com.
- Download or clone this sample.
- Start Android Studio.
- Select Open an existing Android Studio project.
- Browse to your local repository and select the O365-Android-Profile project. Click OK.
- Open the Constants.java file.
-
Find the CLIENT_ID constant and set its String value equal to the client id you registered in Azure Active Directory.
-
Find the REDIRECT_URI constant and set its String value equal to the redirect URI you registered in Azure Active Directory.
Note: If you don't have CLIENT_ID and REDIRECT_URI values, add a native client application in Azure and take note of the CLIENT_ID and REDIRECT_URI.
-
Once you've built the Profile sample, you can run it on an emulator or device.
Questions and comments
We'd love to get your feedback on the O365 Android Profile project. You can send your questions and suggestions to us in the Issues section of this repository.
Questions about Office 365 development in general should be posted to Stack Overflow. Make sure that your questions or comments are tagged with [Office365] and [API].
Additional resources
- Office 365 APIs platform overview
- Overview of Microsoft Graph
- Office 365 SDK for Android
- Get started with Office 365 APIs in apps
- Office 365 API code samples and videos
- Other Office 365 Profile samples
- Office 365 Connect Sample for Android
- Office 365 Code Snippets for Android
- Office 365 APIs Starter Project for Android
Copyright
Copyright (c) 2015 Microsoft. All rights reserved.
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.