SlideShare ist ein Scribd-Unternehmen logo
1 von 31
Module 6: Hooking into SharePoint APIs with Android
Registration for Los Angeles June 16 2015
http://aka.ms/O365campLA
Course Agenda
Office Camp
Module 1: Introduction to the Day
Module 2: Setting up the Environments
Module 3: Hooking into Apps for SharePoint
Module 4: Hooking into Office 365 APIs
Module 5: Hooking into Apps for Office
Module 6: Hooking into SharePoint APIs with Android
Ivan Sanders
SharePoint MVP/MCT
ivan@dimension-si.com
@iasanders
http://developer.android.com/sdk/index.html
Android Client
Azure AD O365 SharePoint
Linked
JSON/REST
OAuth
Android Client
Azure AD O365 SharePoint
Linked
JSON/REST
OAuth
https://github.com/AzureAD/azure-activedirectory-
library-for-android
dependencies {
//Include the Active Directory Authentication Library
compile group: 'com.microsoft.aad', name: 'adal', version: '1.0.5'
}
<uses-permission android:name="android.permission.INTERNET" />
<application ...>
...
<activity
android:name="com.microsoft.aad.adal.AuthenticationActivity"
android:label="Authenticate with AD"
android:screenOrientation="portrait">
</activity>
</application>
//in Activity
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
//complete any authentication requests
mContext.onActivityResult(requestCode, resultCode, data);
}
//in Activity.onCreate()
mContext = new AuthenticationContext(application, authority, false);
mAuthContext.acquireToken(currentActivity,
sharepointUrl, //e.g. http://mydomain.sharepoint.com
clientId, //an Azure AD client id
redirectUrl, //e.g. "http://android/callback" (also configured with AD)
loginHint, //e.g. "user@mydomain.onmicrosoft.com"
promptBehaviour,
extraQueryArgs,
callback //e.g. new AuthenticationCallback<AuthenticationResult>() {...}
);
mAuthContext.acquireTokenSilently(
resource,
clientId,
userId, //acquired by call to acquireToken
callback
);
Start
Show splash screen
acquireToken()AuthenticationActivity
Show main screen
End
storeTokens() callback(accessToken)
Start
User initiates API call
acquireTokenSilently()
callback(accessToken)
Complete API call
End
Cache valid? NO
YES
refreshToken()
Success?YES NO
Restart app for auth
End
storeTokens()
Android Client
Azure AD O365 SharePoint
Linked
JSON/REST
OAuth
https://github.com/OfficeDev/Office-365-SDK-for-
Android
ListClient client = new ListClient(
sharePointUrl, //e.g. "http://mydomain.sharepoint.com/"
sharePointSitePath, //e.g. "/client/site"
credentials
);
Credentials credentials = new OAuthCredentials(accessToken);
final String listName = "My List";
//this produces the odata query: $filter=Title+eq+"My list"
Query query = QueryOperations.field("Title").eq(listName);
//we can attach callbacks to f which will run when the data is available
ListenableFuture<List<SPList>> f = client.getLists(query);
//Or... calling .get() will block this thread until the data is available
//DO NOT DO THIS ON THE UI THREAD!
List<SPList> results = f.get();
final String listName = "My List";
//this produces the odata query: $filter=startsWith(Title,"Item #")
Query query = QueryOperations.startsWith("Title", "Item #");
//we can attach callbacks to f which will run when the data is available
ListenableFuture<List<SPListItem>> f = client.getListItems(listName, query);
//Or... calling .get() will block this thread until the data is available
//DO NOT DO THIS ON THE UI THREAD!
List<SPListItem> results = f.get();
O365 DEVCamp Los Angeles June 16, 2015 Module 06 Hook into SharePoint APIs with ANDFROID
O365 DEVCamp Los Angeles June 16, 2015 Module 06 Hook into SharePoint APIs with ANDFROID

Weitere ähnliche Inhalte

Was ist angesagt?

Practical Business Intelligence in SharePoint 2013 - Helsinki Finalnd
Practical Business Intelligence in SharePoint 2013 - Helsinki FinalndPractical Business Intelligence in SharePoint 2013 - Helsinki Finalnd
Practical Business Intelligence in SharePoint 2013 - Helsinki Finalnd
Ivan Sanders
 
Microsoft Office Web Applications
Microsoft Office Web ApplicationsMicrosoft Office Web Applications
Microsoft Office Web Applications
pearce.alex
 
Technical Overview of Microsoft SharePoint Online - Presented by Atidan
Technical Overview of Microsoft SharePoint Online - Presented by AtidanTechnical Overview of Microsoft SharePoint Online - Presented by Atidan
Technical Overview of Microsoft SharePoint Online - Presented by Atidan
David J Rosenthal
 

Was ist angesagt? (20)

How to create custom Connector for Microsoft Flow
How to create custom Connector for Microsoft FlowHow to create custom Connector for Microsoft Flow
How to create custom Connector for Microsoft Flow
 
Using office add ins to solve business problems-SharePoint Saturday Redmond 2015
Using office add ins to solve business problems-SharePoint Saturday Redmond 2015Using office add ins to solve business problems-SharePoint Saturday Redmond 2015
Using office add ins to solve business problems-SharePoint Saturday Redmond 2015
 
Practical Business Intelligence in SharePoint 2013 - Helsinki Finalnd
Practical Business Intelligence in SharePoint 2013 - Helsinki FinalndPractical Business Intelligence in SharePoint 2013 - Helsinki Finalnd
Practical Business Intelligence in SharePoint 2013 - Helsinki Finalnd
 
So You Want To Be A SharePoint Developer-SPS Silicon Valley 2015
So You Want To Be A SharePoint Developer-SPS Silicon Valley 2015So You Want To Be A SharePoint Developer-SPS Silicon Valley 2015
So You Want To Be A SharePoint Developer-SPS Silicon Valley 2015
 
How to: Create a custom connector for Microsoft Flow
How to: Create a custom connector for Microsoft FlowHow to: Create a custom connector for Microsoft Flow
How to: Create a custom connector for Microsoft Flow
 
Introducción a las Apps para SharePoint
Introducción a las Apps para SharePointIntroducción a las Apps para SharePoint
Introducción a las Apps para SharePoint
 
Deep dive into office 365 ap is for calendar mail and contacts
Deep dive into office 365 ap is for calendar mail and contactsDeep dive into office 365 ap is for calendar mail and contacts
Deep dive into office 365 ap is for calendar mail and contacts
 
How to create custom connector for Microsoft Flow - SPSNL18
How to create custom connector for Microsoft Flow - SPSNL18How to create custom connector for Microsoft Flow - SPSNL18
How to create custom connector for Microsoft Flow - SPSNL18
 
Introducción a las Apps para Office
Introducción a las Apps para OfficeIntroducción a las Apps para Office
Introducción a las Apps para Office
 
Getting started with Office 365 API's
Getting started with Office 365 API'sGetting started with Office 365 API's
Getting started with Office 365 API's
 
Deep dive into office 365 api for one drive for business
Deep dive into office 365 api for one drive for businessDeep dive into office 365 api for one drive for business
Deep dive into office 365 api for one drive for business
 
SharePoint Framework SPS Madrid 2016
SharePoint Framework SPS Madrid 2016SharePoint Framework SPS Madrid 2016
SharePoint Framework SPS Madrid 2016
 
Microsoft Office Web Applications
Microsoft Office Web ApplicationsMicrosoft Office Web Applications
Microsoft Office Web Applications
 
Office 365 Development Overview
Office 365 Development OverviewOffice 365 Development Overview
Office 365 Development Overview
 
Technical Overview of Microsoft SharePoint Online - Presented by Atidan
Technical Overview of Microsoft SharePoint Online - Presented by AtidanTechnical Overview of Microsoft SharePoint Online - Presented by Atidan
Technical Overview of Microsoft SharePoint Online - Presented by Atidan
 
Build & Ignite Cloud Notes
Build & Ignite Cloud NotesBuild & Ignite Cloud Notes
Build & Ignite Cloud Notes
 
Office 365 - Introduction to SharePoint Online Development - SharePoint Conne...
Office 365 - Introduction to SharePoint Online Development - SharePoint Conne...Office 365 - Introduction to SharePoint Online Development - SharePoint Conne...
Office 365 - Introduction to SharePoint Online Development - SharePoint Conne...
 
Apps for SharePoint Online 2013
Apps for SharePoint Online 2013Apps for SharePoint Online 2013
Apps for SharePoint Online 2013
 
Microsoft PowerApps Let’s change the way we build business apps
Microsoft PowerApps Let’s change the way we build business appsMicrosoft PowerApps Let’s change the way we build business apps
Microsoft PowerApps Let’s change the way we build business apps
 
O365con14 - the new sharepoint online apps - napa in action
O365con14 - the new sharepoint online apps - napa in actionO365con14 - the new sharepoint online apps - napa in action
O365con14 - the new sharepoint online apps - napa in action
 

Andere mochten auch

Overview of Office 365 - Presentation By Sajid
Overview of Office 365  - Presentation By Sajid Overview of Office 365  - Presentation By Sajid
Overview of Office 365 - Presentation By Sajid
srafiq
 

Andere mochten auch (8)

Overview of Office 365 - Presentation By Sajid
Overview of Office 365  - Presentation By Sajid Overview of Office 365  - Presentation By Sajid
Overview of Office 365 - Presentation By Sajid
 
Introduction to O365 E5 Plan
Introduction to O365 E5 Plan Introduction to O365 E5 Plan
Introduction to O365 E5 Plan
 
O365 Groups- Best Practices and Solutions
O365 Groups- Best Practices and SolutionsO365 Groups- Best Practices and Solutions
O365 Groups- Best Practices and Solutions
 
36.5 Office 365 Features That Will Increase Your Productivity
36.5 Office 365 Features That Will Increase Your Productivity36.5 Office 365 Features That Will Increase Your Productivity
36.5 Office 365 Features That Will Increase Your Productivity
 
Office 365 Sales Presentation
Office 365 Sales PresentationOffice 365 Sales Presentation
Office 365 Sales Presentation
 
Office 365 presentation
Office 365 presentationOffice 365 presentation
Office 365 presentation
 
Microsoft Office 365 Presentation
Microsoft Office 365 PresentationMicrosoft Office 365 Presentation
Microsoft Office 365 Presentation
 
Office 365 introduction and technical overview
Office 365 introduction and technical overviewOffice 365 introduction and technical overview
Office 365 introduction and technical overview
 

Ähnlich wie O365 DEVCamp Los Angeles June 16, 2015 Module 06 Hook into SharePoint APIs with ANDFROID

[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
lanslote
 
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
Kiril Iliev
 

Ähnlich wie O365 DEVCamp Los Angeles June 16, 2015 Module 06 Hook into SharePoint APIs with ANDFROID (20)

Hooking SharePoint APIs with Android
Hooking SharePoint APIs with AndroidHooking SharePoint APIs with Android
Hooking SharePoint APIs with Android
 
Office 365 api vs share point app model
Office 365 api vs share point app modelOffice 365 api vs share point app model
Office 365 api vs share point app model
 
Security enforcement of Java Microservices with Apiman & Keycloak
Security enforcement of Java Microservices with Apiman & KeycloakSecurity enforcement of Java Microservices with Apiman & Keycloak
Security enforcement of Java Microservices with Apiman & Keycloak
 
Webinar - Office 365 & PowerShell : A Match Made in Heaven
Webinar - Office 365 & PowerShell : A Match Made in HeavenWebinar - Office 365 & PowerShell : A Match Made in Heaven
Webinar - Office 365 & PowerShell : A Match Made in Heaven
 
SharePoint Saturday Ottawa 2015 - Office 365 and PowerShell - A match made in...
SharePoint Saturday Ottawa 2015 - Office 365 and PowerShell - A match made in...SharePoint Saturday Ottawa 2015 - Office 365 and PowerShell - A match made in...
SharePoint Saturday Ottawa 2015 - Office 365 and PowerShell - A match made in...
 
Android intermediatte Full
Android intermediatte FullAndroid intermediatte Full
Android intermediatte Full
 
Android Intermediatte IAK full
Android Intermediatte IAK fullAndroid Intermediatte IAK full
Android Intermediatte IAK full
 
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
 
API Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIsAPI Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIs
 
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
 
Introduction to the SharePoint Client Object Model and REST API
Introduction to the SharePoint Client Object Model and REST APIIntroduction to the SharePoint Client Object Model and REST API
Introduction to the SharePoint Client Object Model and REST API
 
2013 - Back to the Future with Client/Server Development
2013 - Back to the Future with Client/Server Development 2013 - Back to the Future with Client/Server Development
2013 - Back to the Future with Client/Server Development
 
SPConnect2014 Office 365 APIs
SPConnect2014 Office 365 APIsSPConnect2014 Office 365 APIs
SPConnect2014 Office 365 APIs
 
Developing Apps with Azure AD
Developing Apps with Azure ADDeveloping Apps with Azure AD
Developing Apps with Azure AD
 
Introduction to Google App Engine
Introduction to Google App EngineIntroduction to Google App Engine
Introduction to Google App Engine
 
Charla desarrollo de apps con sharepoint y office 365
Charla   desarrollo de apps con sharepoint y office 365Charla   desarrollo de apps con sharepoint y office 365
Charla desarrollo de apps con sharepoint y office 365
 
Develop iOS and Android apps with SharePoint/Office 365
Develop iOS and Android apps with SharePoint/Office 365Develop iOS and Android apps with SharePoint/Office 365
Develop iOS and Android apps with SharePoint/Office 365
 
Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.
 
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
 
REST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in CodeigniterREST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in Codeigniter
 

Mehr von Ivan Sanders

Practical businerss intelligence in share point 2013
Practical businerss intelligence in share point 2013Practical businerss intelligence in share point 2013
Practical businerss intelligence in share point 2013
Ivan Sanders
 
SharePoint Saturday Sacramento Business Intelligence with SharePoint 2010
SharePoint Saturday Sacramento  Business Intelligence with SharePoint 2010SharePoint Saturday Sacramento  Business Intelligence with SharePoint 2010
SharePoint Saturday Sacramento Business Intelligence with SharePoint 2010
Ivan Sanders
 

Mehr von Ivan Sanders (20)

Real world business workflow with SharePoint designer 2013
Real world business workflow with SharePoint designer 2013Real world business workflow with SharePoint designer 2013
Real world business workflow with SharePoint designer 2013
 
Practical Business Intelligence with SharePoint 2013
Practical Business Intelligence with SharePoint 2013Practical Business Intelligence with SharePoint 2013
Practical Business Intelligence with SharePoint 2013
 
SharePoint 2013 Business Intelligence Demos to build your businesss 2.0
SharePoint 2013 Business Intelligence Demos to build your businesss 2.0SharePoint 2013 Business Intelligence Demos to build your businesss 2.0
SharePoint 2013 Business Intelligence Demos to build your businesss 2.0
 
Self-Service Business Intelligence in SharePoint 2013
Self-Service Business Intelligence in SharePoint 2013Self-Service Business Intelligence in SharePoint 2013
Self-Service Business Intelligence in SharePoint 2013
 
Practical businerss intelligence in share point 2013
Practical businerss intelligence in share point 2013Practical businerss intelligence in share point 2013
Practical businerss intelligence in share point 2013
 
San Fernando Valley SharePoint UserGroup Jully 11, 2012
San Fernando Valley SharePoint UserGroup Jully 11, 2012San Fernando Valley SharePoint UserGroup Jully 11, 2012
San Fernando Valley SharePoint UserGroup Jully 11, 2012
 
Enterprise Content Management in SharePoint 2010 inplace autotagging with ter...
Enterprise Content Management in SharePoint 2010 inplace autotagging with ter...Enterprise Content Management in SharePoint 2010 inplace autotagging with ter...
Enterprise Content Management in SharePoint 2010 inplace autotagging with ter...
 
Creating Business Intelligence With Share Point 2010
Creating Business Intelligence With Share Point 2010Creating Business Intelligence With Share Point 2010
Creating Business Intelligence With Share Point 2010
 
SharePoint Saturday Orlando 2012 Creating Business Intelligence with SharePoi...
SharePoint Saturday Orlando 2012 Creating Business Intelligence with SharePoi...SharePoint Saturday Orlando 2012 Creating Business Intelligence with SharePoi...
SharePoint Saturday Orlando 2012 Creating Business Intelligence with SharePoi...
 
SharePoint 2010 Application Lifecycle Management
SharePoint 2010 Application Lifecycle ManagementSharePoint 2010 Application Lifecycle Management
SharePoint 2010 Application Lifecycle Management
 
SharePoint Saturday Houston 2012
SharePoint Saturday Houston 2012SharePoint Saturday Houston 2012
SharePoint Saturday Houston 2012
 
Creating Business Intelligence with SharePoint 2010
Creating Business Intelligence  with SharePoint 2010Creating Business Intelligence  with SharePoint 2010
Creating Business Intelligence with SharePoint 2010
 
SharePoint Intelligence Real World Business Workflow With Share Point Designe...
SharePoint Intelligence Real World Business Workflow With Share Point Designe...SharePoint Intelligence Real World Business Workflow With Share Point Designe...
SharePoint Intelligence Real World Business Workflow With Share Point Designe...
 
SharePoint Intelligence Introduction To Share Point Designer Workflows
SharePoint Intelligence Introduction To Share Point Designer WorkflowsSharePoint Intelligence Introduction To Share Point Designer Workflows
SharePoint Intelligence Introduction To Share Point Designer Workflows
 
SharePoint Intelligence Extending Share Point Designer 2010 Workflows With Cu...
SharePoint Intelligence Extending Share Point Designer 2010 Workflows With Cu...SharePoint Intelligence Extending Share Point Designer 2010 Workflows With Cu...
SharePoint Intelligence Extending Share Point Designer 2010 Workflows With Cu...
 
SharePoint Saturday NYC - Business Intelligence
SharePoint Saturday NYC - Business IntelligenceSharePoint Saturday NYC - Business Intelligence
SharePoint Saturday NYC - Business Intelligence
 
SharePoint Saturday Sacramento Business Intelligence with SharePoint 2010
SharePoint Saturday Sacramento  Business Intelligence with SharePoint 2010SharePoint Saturday Sacramento  Business Intelligence with SharePoint 2010
SharePoint Saturday Sacramento Business Intelligence with SharePoint 2010
 
Ep structured share point development - v.4
Ep   structured share point development - v.4Ep   structured share point development - v.4
Ep structured share point development - v.4
 
Developer application lifecycle process and tools - v.5
Developer application lifecycle process and tools - v.5Developer application lifecycle process and tools - v.5
Developer application lifecycle process and tools - v.5
 
SharePoint Connections Coast to Coast Developer Boot Camp Crash Course v3
SharePoint Connections Coast to Coast Developer Boot Camp Crash Course v3SharePoint Connections Coast to Coast Developer Boot Camp Crash Course v3
SharePoint Connections Coast to Coast Developer Boot Camp Crash Course v3
 

Kürzlich hochgeladen

( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
nilamkumrai
 
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
nirzagarg
 
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
imonikaupta
 
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men 🔝mehsana🔝 Escorts...
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men  🔝mehsana🔝   Escorts...➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men  🔝mehsana🔝   Escorts...
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men 🔝mehsana🔝 Escorts...
nirzagarg
 
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
@Chandigarh #call #Girls 9053900678 @Call #Girls in @Punjab 9053900678
 

Kürzlich hochgeladen (20)

Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
 
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
 
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men 🔝mehsana🔝 Escorts...
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men  🔝mehsana🔝   Escorts...➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men  🔝mehsana🔝   Escorts...
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men 🔝mehsana🔝 Escorts...
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
 
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
 
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
 

O365 DEVCamp Los Angeles June 16, 2015 Module 06 Hook into SharePoint APIs with ANDFROID

Hinweis der Redaktion

  1. Android Studio is the current state-of-the-art for Android development. It is built on top of the IntelliJ IDEA IDE, a popular Java IDE developed by JetBrains. The editor will feel familiar for users of JetBrain’s popular ReSharper plugin for Visual Studio.
  2. Gradle makes the world go round. Dependencies can be pulled from e.g. Maven Central or jCenter. Android Studio automatically keeps it’s own project files in sync with the Gradle build files, so adding a dependency to a project is as simple as adding a line to the appropriate build.gradle file. The above line of code adds a dependency on the Active Directory Authentication Library for Android, a library maintained by MSOpenTech. The dependency is automatically downloaded in the background, so you immediately get autocomplete on all types in that library.
  3. Use the Android SDK manager to download different SDK Levels. The hands-on-lab will be targeting API Level 21 (Android 5.0.1 Lollipop), but should run fine on devices running API Levels as low as 18 (Android 4.3.1 KitKat).
  4. This is the high-level architecture of our app and the services which it consumes. Authentication is provided directly by Azure AD, via OAuth. After authentication, we communicate with the O365 SharePoint instance via its REST APIs.
  5. In this section we will look at authenticating an Android app with Azure AD using the Active Directory Library for Android
  6. ADAL simplifies authentication with Azure AD. Provides support for user authentication via sign-in (UI) or refresh tokens. Can be found on GitHub at https://github.com/AzureAD/azure-activedirectory-library-for-android
  7. This does require you to have access to the Azure Active Directory for your O365 Instance. You can do this by Adding a new Active Directory to your Azure Subscription, and selecting the “Use existing directory” option. After completing this step, creating the Application is simple – we cover that in the lab.
  8. First we must update the build.gradle file to include the ADAL. Android Studio will prompt you to Sync the changes to the Gradle file – this downloads the dependency and puts it in the right place for the IDE to find it, enabling autocompletion etc.
  9. Next we update the AndroidManifest.xml file with some permissions that ADAL requires (Internet/network permissions) We must also register the AuthenticationActivity activity which does the heavy-lifting of the OAuth flow. ADAL launches this activity which allows the user to enter their credentials.
  10. These basic code snippets must be added to your Activity class. Step 4 is only required if you intend to call mContext.acquireToken which will automatically launch an instance AuthenticationActivity. The onActivityResult function is invoked when that activity completes with a result.
  11. acquireToken launches the Oauth UI, and prompts the user to sign in with their O365 SharePoint credentials. The returned AuthenticationResult instance contains an Access Token (which will expire) and a Refresh Token. The refresh token will also eventually expire, but only after a much longer time. The callback argument is an instance of the AuthenticationCallback interface. Generally this is done using a Java Anonymous Class. The callback is invoked by mContext.onActivityResult from the previous slide, so it is important to call that if you are using this function. Note: ADAL automatically caches the access token and refresh token securely, so you don’t have to! It uses the Android secure keychain to do so.
  12. The callback argument is an instance of the AuthenticationCallback interface. Generally this is done using a Java Anonymous Class. Generally you will invoke acquireToken only when the user first starts the application, and then use acquireTokenSilently from then on. The ADAL automatically caches the Access Token and Refresh Token securely in the Android Keychain, and acquireTokenSilently attempts the following: Return the current Access Token (if still valid) Acquire a new Access Token using the current Refresh Token (if still valid) If this function fails, you must prompt the user to sign in using acquireToken. This function returns a new Access Token.
  13. In this pattern full authentication is only done on application startup. The Splash Screen here is the gateway to your app – the user must authenticate to continue. The app launches and starts the default activity or splash screen. The user clicks “sign in” button, which invokes acquireToken() The AuthenticationActivity is launched and the OAuth flow takes place – the user authenticates with Azure AD. The authentication result (an Access Token and a Refresh Token) is cached securely. The Access Token is returned to the app. The splash screen logic resumes and launches the next Activity. Finally, the splash screen calls finish() to remove itself from the activity stack.
  14. Next we write some code to support re-entrancy into potentially any location within the app. The user may at any time dismiss our app, do some work and then return to our app after their token has expired. In this situation we may need to refresh the Access Token or re-authenticate (or we may not). The user initiates some action (e.g. Refresh the current view) We first call acquireTokenSilently() to acquire an access token. We need to pass a callback because this function may asynchronously refresh the token. If the cached token is still valid then acquireTokenSilently returns it immediately and we continue with the API call (this may happen completely synchronously). Otherwise, the ADAL attempts to refresh the token using a cached refresh token. This happens asynchronously and requires an internet connection. If successful, we continue with the API call. If the refresh operation fails, then we must prompt the user to let them know, and restart the app so that they may authenticate again. We can wrap all of this behaviour into a few helper methods.
  15. Demo the authentication flow in StartActivity. Demo the refresh token handling code in AuthUtil.ensureAuthenticated, DefaultAuthHandler and the two activites ListTasksActivity and EditTaskActivity.
  16. The O365 SDK takes care of setting headers, serialization etc. Queries are automatically executed asynchronously on a background thread, so library functions may be safely called from the UI thread. Can be found on GitHub at https://github.com/OfficeDev/Office-365-SDK-for-Android.
  17. To use the SDK… Create am OAuthCredentials object from the Access Token obtained using ADAL (you must already be authenticated to use this class). Create an instance of ListClient. This class allows you to query and update SharePoint lists. This library supports: Authentication via Azure AD with OAuthCredentials Basic authentication with BasicAuthenticationCredentials Cookie authentication with CookieCredentials
  18. This simple code queries sharepoint for all Lists with the title “My List”. The object returned is a Future, also known as a Promise, which will be resolved when the call completes and the data is available. This means that the getLists call is non-blocking and can be safely used from the UI thread. Warning! The final line calls ListenableFuture.get(), which blocks the current thread until the results are available. Do no use this on the UI thread!
  19. This simple code queries sharepoint for all list items in the list with the name “My List”. The object returned is a Future, also known as a Promise, which will be resolved when the call completes and the data is available. This means that the getListItems call is non-blocking and can be safely used from the UI thread. Warning! The final line calls ListenableFuture.get(), which blocks the current thread until the results are available. Do no use this on the UI thread!
  20. Demo the sharepoint data access code in TaskListItemDataSource. Note that these functions are blocking and can only safely be called from a background thread!