GithubHelp home page GithubHelp logo

microsoftgraph / android-java-connect-rest-sample Goto Github PK

View Code? Open in Web Editor NEW
12.0 33.0 13.0 1.27 MB

Use Microsoft Graph to access a user’s Microsoft account data from within an Android app. This sample uses the Microsoft Graph REST endpoint to work with the data, and uses the Azure AD v2.0 endpoint for authentication of users of personal or work or school accounts.

Home Page: https://graph.microsoft.io

License: MIT License

Java 100.00%
devxsample

android-java-connect-rest-sample's Introduction

Connect Sample for Android Using the Microsoft Graph REST endpoin

Note: We've updated this sample to use the recommended auth library for Android apps.

Building apps for enterprise customers? Your app may not work if your enterprise customer turns on enterprise mobility security features like conditional device access. In this case, you may not know and your customers may experience errors.

To support all enterprise customers across all enterprise scenarios, you must use the Azure AD endpoint and manage your apps using the Azure Management Portal. For more information, see Deciding between the Azure AD and Azure AD v2.0 endpoints.

Office 365 Connect sample

Connecting to Microsoft Graph is the first step every Android app must take to start working with Office 365 services and data. This sample shows how to connect and then call one API through the Microsoft Graph REST endpoint.

Device requirements

To run the Connect sample, your device needs to meet the following requirements:

  • A screen size of 800 x 480 or larger.
  • Android API level 16 or higher.

Prerequisites

To use the Connect sample for Android, you need the following:

Register and configure the app

  1. Sign into the App Registration Portal using either your personal or work or school account.

  2. Select Add an app.

  3. Enter a name for the app, and select Create application.

    The registration page displays, listing the properties of your app.

  4. Under Platforms, select Add platform.

  5. Select Mobile application.

  6. Copy the Application Id, you'll need it in the next section.

  7. Click Save.

Open the sample using Android Studio

  1. Install Android Studio and add the Android SDK packages according to the instructions on developer.android.com.

  2. Download or clone this sample.

  3. Start Android Studio.

    1. Close any projects that you might have open, and then choose Open an existing Android Studio project.
    2. Browse to your local repository and choose the Android-Connect project. Click OK.

    Note: Android Studio shows a Frameworks detected notification if you don't have the Android Support Repository installed. Open the SDK manager and add the Android Support Repository to avoid the Frameworks detected notification.

  4. Open the Constants.java file.

    • Replace ENTER_YOUR_CLIENT_ID with the application id from the previous section.

Once you've built the Connect sample, you can run it on an emulator or device. Pick a device with API level 16 or higher from the Choose device dialog.

To learn more about the sample, see Call Microsoft Graph in an Android app.

Contributing

If you'd like to contribute to this sample, see CONTRIBUTING.MD.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Questions and comments

We'd love to get your feedback about the Connect sample. You can send your questions and suggestions to us in the Issues section of this repository.

Questions about Microsoft Graph development in general should be posted to Stack Overflow. Make sure that your questions or comments are tagged with [MicrosoftGraph] and [API].

Next steps

This sample just shows the essentials that your apps need to work with Microsoft Graph. There is so much more that your apps can do using the Office 365 APIs, like helping your users to manage their work day with calendar, find just the information they need in all the files they store in OneDrive, or find the exact person they need from their list of contacts. We have more to share with you in the Snippets sample for Android.

Additional resources

Copyright

Copyright (c) 2016 Microsoft. All rights reserved.

android-java-connect-rest-sample's People

Contributors

andrewjmay avatar davidchesnut avatar iambmelt avatar jasonjoh avatar martellaj avatar nokafor avatar ricalo avatar tadaomachida avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-java-connect-rest-sample's Issues

cant connect to office 365

I have add My Application Client ID and Redirect URI,But When I connect to Office 365.It Show Me Error cant connect to office 365

Broken link

The final prerequisite contains a broken link.

"A client id and redirect uri values of an application registered in Azure. This sample application must be granted the Send mail as a user permission for Microsoft Graph. Add a native client application in Azure and grant proper permissions to it."

The link to 'Add a native client application in Azure' is broken.

I found the instructions needed here: https://msdn.microsoft.com/office/office365/HowTo/add-common-consent-manually ('Register your native app with the Azure Management Portal' section then follow 'Specify the Office 365 API permissions your app requires' for the permissions).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.