Thursday, August 21, 2014

Setting up the Azure Active Directory SDK for Android

Azure Active Directory (AAD) is a service that provides identity and access management capabilities in the cloud. If you're dealing with Office 365 APIs, I can guarantee you that you will definitely run into AAD, so best to get it out of the way as soon as possible.

I'll write another post shortly about AAD and why that's an integral part of the Office 365 authentication story, but for now, let's focus on getting the AAD Android SDK set up and configured.

1. Go to the Azure AD library for Android repository on GitHub to download the SDK. Just click on "Download Zip" (its on the lower-right of the screenshot below)

2. Unzip the file. If you run into a situation when the filename is too long when unzipping, move the zip file to C:/ root and try again. This is a known problem with the default Windows unzipping tool.

Go into the unzipped folder and see all the good stuff you've downloaded.

3. Go into the src/libs folder. Open "required-libs.txt". This shows you the dependencies - namely, gson and the Android support library. Super strange that you have to dig into this text file to find out the required libraries and it's not mentioned at all on the github page.

4. If you don't have it already, you can download gson here. You'll want to go for the gson-2.x.jar file. Save that file into the src/libs folder that you opened earlier in step 3.

5. Import the AAD Android project into Eclipse (Go to File > Import > Existing Android Code into Workspace)

You'll want to select the source code and sample project.

6. Notice that the project doesn't compile. There are squiggly red lines indicating dependencies that are not found.

7. Of course, we haven't yet added the Android support library. Add it by right clicking on the AuthenticationActivity project (i.e. the source code, not the sample) and then Android Tools > Add Support Library. Agree to the terms and conditions.

8. The AAD library is set up and ready to be used! To try it out, right-click on the sample project and select Run As > Android Application.

Tuesday, August 12, 2014

Common Questions and Answers to Getting Started with Office 365

Let's say you've signed up for an Office 365 developer account. The following is what you get access to:

Q: Can I download Word, Excel, PowerPoint, Outlook, OneNote for free now?
A: Yes, click on the red "Install now". I'm not sure if your developer account allows you to use them for the duration of your developer trial, but I'm pretty sure they won't work after your 30-day trial expires anyway. This isn't a way to get Microsoft Office for free. The point of having those apps there for you to download is to show that for any Office 365 user, they get installations of the Office apps that comes with their Office 365 subscription that they either purchased themselves or that their company purchased for them.

Q: Why does my "OneDrive" or "Sites" icon remain grayed out even after a few minutes?
A: SharePoint is still provisioning. When you set up an Office 365 tenant (remember: a tenant looks like or, you are saying that I'm buying Office 365 for all the users belonging to my company which has a domain name of or Office 365 doesn't only include Word, Excel, PowerPoint etc., it also includes SharePoint (a powerful intranet/file management and collaboration solution) and Exchange (an email server that allows you to provide email services for your company). SharePoint and Exchange used to be sold as software in boxes, but now they are all online as part of the Office 365 cloud solution. The icons "Sites" and "OneDrive" represents SharePoint. In particular, it may take some time for SharePoint for your or company to set up so be patient.

Q: It still remains grayed out even after 1 hour!
A: SharePoint probably failed to provision. This is something that we are aware of and working on fixing. Please post your problem on the community forums (click on "?" in the top right hand corner) and someone will work with you to fix your specific problem.

Q: What is the difference between OneDrive here and
A: "OneDrive for Business" is distinct from "" and "OneDrive". The Pro/Business solution is essentially a file management solution from SharePoint that is a cloud storage solution for your company. is cloud storage for individuals. Let's say you are working on an important proposal for a meeting next week at work. That would probably go onto OneDrive Pro and not But if you want to store your own photos taken at your kids' birthday party, that would go onto In the context of Office 365 tenants and developer accounts, the word "OneDrive" refers to "OneDrive for Business". Outside the context of the enterprise, the word "OneDrive" refers to "" or OneDrive for consumer services.

It's confusing, I know. That's why I'm here - feel free to post your questions in the comments below.

Register so you can use O365 APIs

There's lots of confusion over what you need to do before you can use Office 365 APIs so I'm clearing that up here.
You need an O365 developer account. Sign up here for a 30 day free trial. It costs $99/year thereafter.
=> If you are an MSDN subscriber (with Visual Studio Premium or Visual Studio Ultimate), you can get this developer account for FREE.
Let's say you want to sign up for the 30 day free trial.
First you enter your personal details:
Then you tell Microsoft what you want your tenant domain and username to be. Office 365 is aimed at enterprises, so imagine a situation where a company A has its own in house developer named B. So in this case, the tenant domain will be and the username will be developerB. So developer B's login account to Office 365 will be In this case because you are signing up for a free trial Microsoft doesn't have domains like to give away. You have to use but you can later associate this to your own domain.
The next step is a verification step:
Enter the verification code you receive:
Wait a few seconds while your account gets created:
Your account is created.

You will receive an email with your tenant domain and username. This is handy information in case you forget. Note that my user ID is - this is a completely different sort of account from a type of account. The former is an Office 365 tenant account where the latter is a Microsoft account. Think of the difference as the former being an enterprise log-in that you use at work, and the latter being your own personal account that you use for Bing,, and all of Microsoft's consumer services.

Now when you click on "Access your Office 365" in that email, or if you click on "You're ready to go..." in that registration screen, you get to this:
And there you have it! You've set up a developer account for Office 365.
If any of the "tile" icons representing Word Online, Excel Online, PowerPoint Online, OneDrive, Sites, Outlook, Calendar or People are grayed out, that means these services haven't finished provisioning yet. Give them a few more minutes, and when you refresh, they should be ready to use.

That's all you need to start using O365 APIs!

Sunday, August 10, 2014

Hello World!

My name is Kai, and I'm a Program Manager on the Office Developer Platform team at Microsoft. I'm creating this blog because I want to share the great secret that is the Office 365 API. This is a new powerful REST-based API with client libraries that allow you to consume SharePoint, Exchange and Azure Active Directory data in a single API.

Here are some things you can do with the Office 365 API:

- Request authorization from end-users to provide access to their mail, contacts, calendars and files to your app
- Create, organize and move files
- Access emails, folders and attachments
- Update calendar groups, calendars and appointments
- Create new contacts

This is a useful resource:, the official site for developing on Office. You can download tools, follow step-by-step tutorials and browse reference documentation.


All information on this blog are my own views and do not represent that of Microsoft. If there's anything inaccurate, please get in touch with me. You can leave a comment on any of my posts.