To run the completed project in this folder, you need the following:
- Android Studio installed on your development machine. (Note: This tutorial was written with Android Studio version 4.1.3 and the Android 10.0 SDK. The steps in this guide may work with other versions, but that has not been tested.)
- Either a personal Microsoft account with a mailbox on Outlook.com, or a Microsoft work or school account.
If you don't have a Microsoft account, there are a couple of options to get a free account:
- You can sign up for a new personal Microsoft account.
- You can sign up for the Office 365 Developer Program to get a free Office 365 subscription.
-
Open a browser and navigate to the Azure Active Directory admin center and login using a personal account (aka: Microsoft Account) or Work or School Account.
-
Select Azure Active Directory in the left-hand navigation, then select App registrations under Manage.
-
Select New registration. On the Register an application page, set the values as follows.
- Set Name to
Android Graph Tutorial. - Set Supported account types to Accounts in any organizational directory and personal Microsoft accounts.
- Under Redirect URI, set the dropdown to Public client/native (mobile & desktop) and set the value to
msauth://YOUR_PACKAGE_NAME/callback, replacingYOUR_PACKAGE_NAMEwith your project's package name.
- Set Name to
-
Select Register. On the Android Graph Tutorial page, copy the value of the Application (client) ID and save it, you will need it in the next step.
- Rename the
msal_config.json.examplefile tomsal_config.jsonand move the file into theGraphTutorial/app/src/main/res/rawdirectory. - Edit the
msal_config.jsonfile and make the following changes.- Replace
YOUR_APP_ID_HEREwith the Application Id you got from the Azure portal. - Replace
com.example.graphtutorialwith your package name.
- Replace
In Android Studio, select Run 'app' on the Run menu.


