Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add information about configuring CLIENT_ID.

Add information in the README about CLIENT_ID
Add check in SignInActivity to see if the CLIENT_ID has been changed.
  • Loading branch information...
commit 702e1df3353b4bd57ee55b4f7409370737baff6c 1 parent 01273ca
Simon Krueger skrueger authored
9 README
@@ -57,7 +57,14 @@ The Java Compiler must be version 1.6 or higher.
57 57
58 58 Visit: http://dev.live.com and click the "Documentation" link.
59 59
60   -4. Known issues:
  60 +4. Sample project
  61 +There is a sample project located in the sample directory. Using eclipse this project can be added
  62 +using the File > Import > General > Existing Projects into Workspace wizard. Before the project can be
  63 +properly used, the static variable com.microsoft.live.sample.Config.CLIENT_ID (see Config.java) must
  64 +be changed to your own client ID. For help on obtaining a client ID, please see
  65 +http://go.microsoft.com/fwlink/?LinkId=220871
  66 +
  67 +5. Known issues:
61 68
62 69 1) Login dialog is destroyed on screen rotation if the Activity is not set to
63 70 ignore orientation changes in AndroidManifest.xml.
2  sample/src/com/microsoft/live/sample/Config.java
@@ -5,7 +5,7 @@
5 5 package com.microsoft.live.sample;
6 6
7 7 final public class Config {
8   - public static final String CLIENT_ID = "YOUR_CLIENT_ID_HERE";
  8 + public static final String CLIENT_ID = "YOUR CLIENT ID HERE";
9 9
10 10 public static final String[] SCOPES = {
11 11 "wl.signin",
59 sample/src/com/microsoft/live/sample/SignInActivity.java
@@ -43,30 +43,43 @@ protected void onCreate(Bundle savedInstanceState) {
43 43
44 44 mBeginTextView = (TextView) findViewById(R.id.beginTextView);
45 45 mSignInButton = (Button) findViewById(R.id.signInButton);
46   - mSignInButton.setOnClickListener(new OnClickListener() {
47   - @Override
48   - public void onClick(View v) {
49   - mAuthClient.login(SignInActivity.this,
50   - Arrays.asList(Config.SCOPES),
51   - new LiveAuthListener() {
52   - @Override
53   - public void onAuthComplete(LiveStatus status,
54   - LiveConnectSession session,
55   - Object userState) {
56   - if (status == LiveStatus.CONNECTED) {
57   - launchMainActivity(session);
58   - } else {
59   - showToast("Login did not connect. Status is " + status + ".");
  46 +
  47 + // Check to see if the CLIENT_ID has been changed.
  48 + if (Config.CLIENT_ID.equals("YOUR CLIENT ID HERE")) {
  49 + mSignInButton.setOnClickListener(new OnClickListener() {
  50 + @Override
  51 + public void onClick(View v) {
  52 + showToast("In order to use the sample, you must first place your client id " +
  53 + "in com.microsoft.live.sample.Config.CLIENT_ID. For more " +
  54 + "information see http://go.microsoft.com/fwlink/?LinkId=220871");
  55 + }
  56 + });
  57 + } else {
  58 + mSignInButton.setOnClickListener(new OnClickListener() {
  59 + @Override
  60 + public void onClick(View v) {
  61 + mAuthClient.login(SignInActivity.this,
  62 + Arrays.asList(Config.SCOPES),
  63 + new LiveAuthListener() {
  64 + @Override
  65 + public void onAuthComplete(LiveStatus status,
  66 + LiveConnectSession session,
  67 + Object userState) {
  68 + if (status == LiveStatus.CONNECTED) {
  69 + launchMainActivity(session);
  70 + } else {
  71 + showToast("Login did not connect. Status is " + status + ".");
  72 + }
60 73 }
61   - }
62   -
63   - @Override
64   - public void onAuthError(LiveAuthException exception, Object userState) {
65   - showToast(exception.getMessage());
66   - }
67   - });
68   - }
69   - });
  74 +
  75 + @Override
  76 + public void onAuthError(LiveAuthException exception, Object userState) {
  77 + showToast(exception.getMessage());
  78 + }
  79 + });
  80 + }
  81 + });
  82 + }
70 83 }
71 84
72 85 @Override

0 comments on commit 702e1df

Please sign in to comment.
Something went wrong with that request. Please try again.