Tools

Namespaces

Variants

Views

Actions

Search

Contents

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

[[File:Skydrive-logo-200.png]] is a Microsoft service that allow you to store files into a cloud in order to be automatically available from your phone and computers. You can share large files and photos or documents with your friends or collegues.

+

{{SeeAlso|

−

Although the service is available for many platforms such as Windows, Mac, iOS, Android all you need to access to your content is a web browser.<br />

[http://msdn.microsoft.com/en-us/live//default Live Connect] provides developers a set of controls and APIs that enable applications to integrate sign in with the user’s Microsoft account and enable users to access information from SkyDrive, Hotmail, and Messenger. At time of writing these APIs are not included by default on Windows Phone SDK.

+

SkyDrive is a Microsoft cloud service that allows you to access your files and documents on all your phones and computers, and to share them easily with your friends and colleagues. The service is available as an extension to the native file browser on many platforms (e.g. Windows, Mac, iOS, Android) and is also accessible from most web browsers. In addition, it is possible to access the service directly in your apps using the set of controls and APIs in the [http://msdn.microsoft.com/en-us/live//default Live Connect] SDK (these allow developers to integrate with SkyDrive, Hotmail, and Messenger).

−

Before start developing

+

[[File:Skydrive-logo-200.png|none]]

+

This article explains how to obtain the LiveConnect SDK, add the APIs to your project, login to the service, and upload a file. The code works on Windows Phone 8. To use it on Windows Phone 7.x you need some extra jobs described [http://blogs.msdn.com/b/bclteam/archive/2012/10/22/using-async-await-without-net-framework-4-5.aspx here].

+

+

== Prerequisites ==

+

At the time of writing this article, the LiveConnect APIs are not included by default on the Windows Phone SDK.

Bring up the Add Reference dialog and go to the .Net tab. Scroll down to find the Microsoft.Live and Microsoft.Live.Controls assemblies. Add them to your project.<br />

+

:[[File:SkyDrive-step-001.png|none|400px]]

−

[[File:SkyDrive-step-002.png]]<br />

+

−

Open MainPage.xaml in the designer. Bring the Toolbox in view and right-click to select Choose Items… Under Windows Phone Components tab, find the SignInButton control in the Microsoft.Live.Control namespace and add to your toolbox (You only need to do this once).<br />

+

Bring up the '''Add Reference''' dialog and go to the .Net tab. Scroll down and add the {{Icode|Microsoft.Live}} and {{Icode|Microsoft.Live.Controls}} assemblies to your project.

−

[[File:SkyDrive-step-003.png]]<br />

+

:[[File:SkyDrive-step-002.png|none|900px]]

−

If everything is well installed you should see the SignInButton control in your toolbox. Drag it onto your designer surface.<br />

+

−

[[File:SkyDrive-step-004.png]]<br />

+

Open '''MainPage.xaml''' in the designer. Bring the Toolbox in view and right-click to select Choose Items… Under Windows Phone Components tab, find the SignInButton control in the Microsoft.Live.Control namespace and add to your toolbox (You only need to do this once).

+

:[[File:SkyDrive-step-003.png|none|900px]]

+

+

If everything is well installed you should see the {{Icode|SignInButton}} control in your toolbox. Drag it onto your designer surface.

+

:[[File:SkyDrive-step-004.png|none]]

=== Scopes and permissions ===

=== Scopes and permissions ===

−

Before your app makes requests of the Live Connect APIs to work with Live Connect info, in most cases you must get permission from the user to access that info or to create new objects on behalf of the user. In the Live Connect APIs, this permission is called a scope. Each scope grants a different permission level.<br />

+

Before your app makes requests of the Live Connect APIs to work with Live Connect info, in most cases you must get permission from the user to access that info or to create new objects on behalf of the user. In the Live Connect APIs, this permission is called a scope. Each scope grants a different permission level.

−

There are three types of scopes:

+

+

There are three types of scopes:

* Core scopes are central to the Live Connect APIs and involve users' core profile and contact data.

* Core scopes are central to the Live Connect APIs and involve users' core profile and contact data.

* Extended scopes allow you to work with users' extended profile and contact data.

* Extended scopes allow you to work with users' extended profile and contact data.

Now we need to connect our application to Live Connect. Go to the [https://manage.dev.live.com/ application management site] and click the [https://manage.dev.live.com/AddApplication.aspx Create Application]. Create an application and provide a name for it.<br />

Now we need to connect our application to Live Connect. Go to the [https://manage.dev.live.com/ application management site] and click the [https://manage.dev.live.com/AddApplication.aspx Create Application]. Create an application and provide a name for it.<br />

−

[[File:SkyDrive-step-005.png]]<br />

+

:[[File:SkyDrive-step-005.png|none|frame]]

−

If everything goes well you will be provided with a ClientID and a Client secret code<br />

+

If everything goes well you will be provided with a {{Icode|ClientID}} and a Client secret code:

−

[[File:SkyDrive-step-006.png]]<br />

+

:[[File:SkyDrive-step-006.png|none|frame]]

−

Now let's add the ClientID to our SignInButton code<br />

+

+

Now let's add the {{Icode|ClientID}} to our {{Icode|SignInButton}} code:

SkyDrive is a Microsoft cloud service that allows you to access your files and documents on all your phones and computers, and to share them easily with your friends and colleagues. The service is available as an extension to the native file browser on many platforms (e.g. Windows, Mac, iOS, Android) and is also accessible from most web browsers. In addition, it is possible to access the service directly in your apps using the set of controls and APIs in the Live Connect SDK (these allow developers to integrate with SkyDrive, Hotmail, and Messenger).

This article explains how to obtain the LiveConnect SDK, add the APIs to your project, login to the service, and upload a file. The code works on Windows Phone 8. To use it on Windows Phone 7.x you need some extra jobs described here.

Bring up the Add Reference dialog and go to the .Net tab. Scroll down and add the Microsoft.Live and Microsoft.Live.Controls assemblies to your project.

Open MainPage.xaml in the designer. Bring the Toolbox in view and right-click to select Choose Items… Under Windows Phone Components tab, find the SignInButton control in the Microsoft.Live.Control namespace and add to your toolbox (You only need to do this once).

If everything is well installed you should see the SignInButton control in your toolbox. Drag it onto your designer surface.

Before your app makes requests of the Live Connect APIs to work with Live Connect info, in most cases you must get permission from the user to access that info or to create new objects on behalf of the user. In the Live Connect APIs, this permission is called a scope. Each scope grants a different permission level.

There are three types of scopes:

Core scopes are central to the Live Connect APIs and involve users' core profile and contact data.

Extended scopes allow you to work with users' extended profile and contact data.

Developer scopes allow you to work with developers' client IDs.

For our sample project we need the following scopes

Core scopes

Scope

Enables

wl.basic

Read access to a user's basic profile info. Also enables read access to a user's list of contacts.

wl.offline_access

The ability of an app to read and update a user's info at any time. Without this scope, an app can access the user's info only while the user is signed in to Live Connect and is using your app.

wl.signin

Single sign-in behavior. With single sign-in, users who are already signed in to Live Connect are also signed in to your website.