-
大小: 867KB文件类型: .zip金币: 2下载: 1 次发布日期: 2021-06-17
- 语言: Java
- 标签:
资源简介
Important: This preview SDK has been deprecated and is no longer being maintained. We recommend that you use Microsoft Graph and the associated Microsoft Graph SDKs instead.
Office 365 SDKs for Android
Easily integrate services and data from Office 365 into native Android apps using these Android/Java libraries.
:exclamation:NOTE: You are free to use this code and library according to the terms of its included LICENSE and to open issues in this repo for unofficial support.
Information about o
代码片段和文件信息
package com.microsoft.samples.o365quickstart;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.SettableFuture;
import com.microsoft.aad.adal.AuthenticationCallback;
import com.microsoft.aad.adal.AuthenticationContext;
import com.microsoft.aad.adal.AuthenticationResult;
import com.microsoft.aad.adal.PromptBehavior;
import com.microsoft.services.orc.auth.AuthenticationCredentials;
import com.microsoft.services.orc.core.DependencyResolver;
import com.microsoft.services.orc.http.Credentials;
import com.microsoft.services.orc.http.impl.LoggingInterceptor;
import com.microsoft.services.orc.http.impl.OAuthCredentials;
import com.microsoft.services.orc.http.impl.OkHttpTransport;
import com.microsoft.services.orc.serialization.impl.GsonSerializer;
import com.microsoft.services.outlook.Message;
import com.microsoft.services.outlook.fetchers.OutlookClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class MainActivity extends ActionBarActivity {
Logger logger = LoggerFactory.getLogger(MainActivity.class);
private static final String TAG = “MainActivity“;
private static final String outlookbaseUrl = “https://outlook.office.com/api/beta“;
private AuthenticationContext _authContext;
private DependencyResolver _resolver;
private OutlookClient _client;
private ListView lvMessages;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
lvMessages = (ListView) findViewById(R.id.lvMessages);
Futures.addCallback(logon() new FutureCallback() {
@Override
public void onSuccess(Boolean result) {
_client = new OutlookClient(outlookbaseUrl _resolver);
getMessages();
}
@Override
public void onFailure(Throwable t) {
logger.error(“authentication failed“ t);
}
});
}
public SettableFuture logon() {
final SettableFuture result = SettableFuture.create();
try {
_authContext = new AuthenticationContext(this “https://login.microsoftonline.com/common/v2.0“ true);
} catch (Exception e) {
Log.e(TAG “Failed to initialize Authentication Context with error: “ + e.getMessage());
_authContext = null;
result.setException(e);
}
if (_authContext != null) {
_authContext.acquireToken(
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-12-28 21:30 Office-365-SDK-for-Android-master\
文件 315 2017-12-28 21:30 Office-365-SDK-for-Android-master\.gitignore
文件 3478 2017-12-28 21:30 Office-365-SDK-for-Android-master\CHANGES.md
文件 595 2017-12-28 21:30 Office-365-SDK-for-Android-master\LICENSE
文件 11890 2017-12-28 21:30 Office-365-SDK-for-Android-master\NOTICES.md
文件 3735 2017-12-28 21:30 Office-365-SDK-for-Android-master\README.md
目录 0 2017-12-28 21:30 Office-365-SDK-for-Android-master\samples\
目录 0 2017-12-28 21:30 Office-365-SDK-for-Android-master\samples\O365QuickStart\
目录 0 2017-12-28 21:30 Office-365-SDK-for-Android-master\samples\O365QuickStart\app\
文件 694 2017-12-28 21:30 Office-365-SDK-for-Android-master\samples\O365QuickStart\app\build.gradle
文件 668 2017-12-28 21:30 Office-365-SDK-for-Android-master\samples\O365QuickStart\app\proguard-rules.pro
目录 0 2017-12-28 21:30 Office-365-SDK-for-Android-master\samples\O365QuickStart\app\src\
目录 0 2017-12-28 21:30 Office-365-SDK-for-Android-master\samples\O365QuickStart\app\src\main\
文件 770 2017-12-28 21:30 Office-365-SDK-for-Android-master\samples\O365QuickStart\app\src\main\AndroidManifest.xm
目录 0 2017-12-28 21:30 Office-365-SDK-for-Android-master\samples\O365QuickStart\app\src\main\java\
目录 0 2017-12-28 21:30 Office-365-SDK-for-Android-master\samples\O365QuickStart\app\src\main\java\com\
目录 0 2017-12-28 21:30 Office-365-SDK-for-Android-master\samples\O365QuickStart\app\src\main\java\com\microsoft\
目录 0 2017-12-28 21:30 Office-365-SDK-for-Android-master\samples\O365QuickStart\app\src\main\java\com\microsoft\samples\
目录 0 2017-12-28 21:30 Office-365-SDK-for-Android-master\samples\O365QuickStart\app\src\main\java\com\microsoft\samples\o365quickstart\
文件 7220 2017-12-28 21:30 Office-365-SDK-for-Android-master\samples\O365QuickStart\app\src\main\java\com\microsoft\samples\o365quickstart\MainActivity.java
目录 0 2017-12-28 21:30 Office-365-SDK-for-Android-master\samples\O365QuickStart\app\src\main\res\
目录 0 2017-12-28 21:30 Office-365-SDK-for-Android-master\samples\O365QuickStart\app\src\main\res\layout\
文件 626 2017-12-28 21:30 Office-365-SDK-for-Android-master\samples\O365QuickStart\app\src\main\res\layout\activity_main.xm
目录 0 2017-12-28 21:30 Office-365-SDK-for-Android-master\samples\O365QuickStart\app\src\main\res\menu\
文件 361 2017-12-28 21:30 Office-365-SDK-for-Android-master\samples\O365QuickStart\app\src\main\res\menu\menu_main.xm
目录 0 2017-12-28 21:30 Office-365-SDK-for-Android-master\samples\O365QuickStart\app\src\main\res\mipmap-hdpi\
文件 3418 2017-12-28 21:30 Office-365-SDK-for-Android-master\samples\O365QuickStart\app\src\main\res\mipmap-hdpi\ic_launcher.png
目录 0 2017-12-28 21:30 Office-365-SDK-for-Android-master\samples\O365QuickStart\app\src\main\res\mipmap-mdpi\
文件 2206 2017-12-28 21:30 Office-365-SDK-for-Android-master\samples\O365QuickStart\app\src\main\res\mipmap-mdpi\ic_launcher.png
目录 0 2017-12-28 21:30 Office-365-SDK-for-Android-master\samples\O365QuickStart\app\src\main\res\mipmap-xhdpi\
文件 4842 2017-12-28 21:30 Office-365-SDK-for-Android-master\samples\O365QuickStart\app\src\main\res\mipmap-xhdpi\ic_launcher.png
............此处省略525个文件信息
相关资源
- Android代码-多功能拨号盘源码.zip
- Android代码-安卓美颜相机
- Android代码-查询软件源代码身份证号号
- Android代码-旅游app的安卓端
- Android代码-英语单词记忆程序源码(
- Android代码-滴答词典源码.zip
- Android代码-本项目是基于XMPP的物联网
- Android代码-Android-ConvenientBanner
- Android代码-安卓手机时钟
- Android代码-仓库管理系统源码.zip
- Android代码-一款安卓答题软件
- Android代码-Sokoban.zip
- Android代码-韵音乐播放器
- Android代码-DouBan_Movie
- Android代码-在wifi下手机与电脑的sock
- Android代码-[安卓开源]校园商品交易系
- Android代码-Android上简洁轻量级的饼图
- Android代码-软件冰箱(安卓版)
- Android代码-国产音乐播放器项目听听音
- Android代码-[安卓开源]ImiFirewall.zip
- 本地音乐播放-Android代码
- BMI小程序android代码
- Android代码-支持全屏、小窗口的视频播
- Android代码-智能家居系统(安卓端)
- Android代码-小米文件管理器源码.zip
- Android代码-健康饮食搭配源码.zip
- Android代码-[安卓开源]空气质量检测客
- Android代码-SlideBar
- Android代码-数独游戏
- Android代码-记账本源码.zip
评论
共有 条评论