Large diffs are not rendered by default.

Binary file not shown.
BIN +3.47 MB (280%) SmartBarMobile/bin/classes.dex
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -21,8 +21,9 @@
android:id="@+id/drinkList"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="20dp"
android:layout_weight="1"
android:layout_marginTop="20dp">
android:textColor="@color/red" >
</ListView>

<View
@@ -81,7 +81,7 @@
android:layout_height="wrap_content"
android:text="@string/enter_age"
android:layout_marginTop="10dp"
android:textAppearance="?android:attr/textAppearanceLarge" />
android:textAppearance="?android:attr/textAppearanceLarge"/>"

<EditText
android:id="@+id/type_age"
@@ -5,7 +5,7 @@

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
@@ -21,25 +21,41 @@
android:contentDescription="@string/smart_bar_actionbar"
android:src="@drawable/smart_bar_logo" />

<TextView
android:id="@+id/smartBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:text="@string/smart_bar_actionbar"
android:textAppearance="?android:attr/textAppearanceLarge" />

<Button
android:id="@+id/oauthButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:onClick="oauthLogin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:text="@string/oauth_button" />
<TextView
android:id="@+id/smartBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:text="@string/smart_bar_actionbar"
android:textAppearance="?android:attr/textAppearanceLarge" />

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >

<com.google.android.gms.common.SignInButton
android:id="@+id/sign_in_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<Button
android:id="@+id/sign_out_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/sign_out_button_name"
android:enabled="false" />

<Button
android:id="@+id/revoke_access_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/revoke_access_button_name"
android:enabled="false" />

</LinearLayout>

<Button
android:id="@+id/loginButton"
@@ -9,6 +9,8 @@
<string name="smart_bar_actionbar">Smart Bar</string>
<string name="login_button">Login</string>
<string name="new_user_button">New User</string>
<string name="sign_out_button_name">Sign Out</string>
<string name="revoke_access_button_name">Revoke</string>

<!-- Login Activity -->
<string name="login_actionbar">Log In</string>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,3 +1,5 @@
# cache for current jar dependency. DO NOT EDIT.
# format is <lastModified> <length> <SHA-1> <path>
# Encoding is UTF-8
1427666938531 4221621 38c2f8e192dc24ddbf6cae2784f3d4267af66a3e C:\Users\lamperry\workspace\SmartBarMobile\libs\google-play-services.jar
1427666938531 4221621 38c2f8e192dc24ddbf6cae2784f3d4267af66a3e C:\Users\lamperry\workspace\google-play-services_lib\libs\google-play-services.jar
Binary file not shown.
@@ -8,44 +8,44 @@

public final class R {
public static final class dimen {
public static final int activity_horizontal_margin = 0x7f040000;
public static final int activity_vertical_margin = 0x7f040001;
public static final int activity_horizontal_margin = 0x7f050000;
public static final int activity_vertical_margin = 0x7f050001;
}
public static final class drawable {
public static final int ic_launcher = 0x7f020000;
public static final int ic_launcher = 0x7f02001a;
}
public static final class id {
public static final int btn_api_foursquare = 0x7f09001b;
public static final int btn_api_googleplus = 0x7f090013;
public static final int btn_api_googletasks = 0x7f090017;
public static final int btn_clear_foursquare = 0x7f09001c;
public static final int btn_clear_googleplus = 0x7f090014;
public static final int btn_clear_googletasks = 0x7f090018;
public static final int btn_oauth_foursquare = 0x7f09001a;
public static final int btn_oauth_googleplus = 0x7f090012;
public static final int btn_oauth_googletasks = 0x7f090016;
public static final int response_code = 0x7f09002a;
public static final int txt_oauth_foursquare = 0x7f09001d;
public static final int txt_oauth_googleplus = 0x7f090015;
public static final int txt_oauth_googletasks = 0x7f090019;
public static final int btn_api_foursquare = 0x7f0b0033;
public static final int btn_api_googleplus = 0x7f0b002b;
public static final int btn_api_googletasks = 0x7f0b002f;
public static final int btn_clear_foursquare = 0x7f0b0034;
public static final int btn_clear_googleplus = 0x7f0b002c;
public static final int btn_clear_googletasks = 0x7f0b0030;
public static final int btn_oauth_foursquare = 0x7f0b0032;
public static final int btn_oauth_googleplus = 0x7f0b002a;
public static final int btn_oauth_googletasks = 0x7f0b002e;
public static final int response_code = 0x7f0b0042;
public static final int txt_oauth_foursquare = 0x7f0b0035;
public static final int txt_oauth_googleplus = 0x7f0b002d;
public static final int txt_oauth_googletasks = 0x7f0b0031;
}
public static final class layout {
public static final int activity_intro = 0x7f030003;
public static final int activity_main = 0x7f030006;
}
public static final class string {
public static final int api_call = 0x7f050008;
public static final int app_name = 0x7f050000;
public static final int clear_credentials = 0x7f050003;
public static final int launch_oauth_flow = 0x7f050002;
public static final int oauth = 0x7f050007;
public static final int oauth_foursquare = 0x7f050006;
public static final int oauth_googleplus = 0x7f050004;
public static final int oauth_googletasks = 0x7f050005;
public static final int waiting_for_data = 0x7f050001;
public static final int api_call = 0x7f060008;
public static final int app_name = 0x7f060000;
public static final int clear_credentials = 0x7f060003;
public static final int launch_oauth_flow = 0x7f060002;
public static final int oauth = 0x7f060007;
public static final int oauth_foursquare = 0x7f060006;
public static final int oauth_googleplus = 0x7f060004;
public static final int oauth_googletasks = 0x7f060005;
public static final int waiting_for_data = 0x7f060001;
}
public static final class style {
public static final int AppBaseTheme = 0x7f060000;
public static final int AppTheme = 0x7f060001;
public static final int AppBaseTheme = 0x7f070000;
public static final int AppTheme = 0x7f070001;
}
}

Large diffs are not rendered by default.

@@ -0,0 +1,238 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.google.android.gms;

public final class R {
public static final class attr {
public static final int adSize = 0x7f010000;
public static final int adSizes = 0x7f010001;
public static final int adUnitId = 0x7f010002;
public static final int appTheme = 0x7f010016;
public static final int buyButtonAppearance = 0x7f01001d;
public static final int buyButtonHeight = 0x7f01001a;
public static final int buyButtonText = 0x7f01001c;
public static final int buyButtonWidth = 0x7f01001b;
public static final int cameraBearing = 0x7f010007;
public static final int cameraTargetLat = 0x7f010008;
public static final int cameraTargetLng = 0x7f010009;
public static final int cameraTilt = 0x7f01000a;
public static final int cameraZoom = 0x7f01000b;
public static final int circleCrop = 0x7f010005;
public static final int environment = 0x7f010017;
public static final int fragmentMode = 0x7f010019;
public static final int fragmentStyle = 0x7f010018;
public static final int imageAspectRatio = 0x7f010004;
public static final int imageAspectRatioAdjust = 0x7f010003;
public static final int liteMode = 0x7f01000c;
public static final int mapType = 0x7f010006;
public static final int maskedWalletDetailsBackground = 0x7f010020;
public static final int maskedWalletDetailsButtonBackground = 0x7f010022;
public static final int maskedWalletDetailsButtonTextAppearance = 0x7f010021;
public static final int maskedWalletDetailsHeaderTextAppearance = 0x7f01001f;
public static final int maskedWalletDetailsLogoImageType = 0x7f010024;
public static final int maskedWalletDetailsLogoTextColor = 0x7f010023;
public static final int maskedWalletDetailsTextAppearance = 0x7f01001e;
public static final int uiCompass = 0x7f01000d;
public static final int uiMapToolbar = 0x7f010015;
public static final int uiRotateGestures = 0x7f01000e;
public static final int uiScrollGestures = 0x7f01000f;
public static final int uiTiltGestures = 0x7f010010;
public static final int uiZoomControls = 0x7f010011;
public static final int uiZoomGestures = 0x7f010012;
public static final int useViewLifecycle = 0x7f010013;
public static final int windowTransitionStyle = 0x7f010025;
public static final int zOrderOnTop = 0x7f010014;
}
public static final class color {
public static final int common_action_bar_splitter = 0x7f080009;
public static final int common_signin_btn_dark_text_default = 0x7f080000;
public static final int common_signin_btn_dark_text_disabled = 0x7f080002;
public static final int common_signin_btn_dark_text_focused = 0x7f080003;
public static final int common_signin_btn_dark_text_pressed = 0x7f080001;
public static final int common_signin_btn_default_background = 0x7f080008;
public static final int common_signin_btn_light_text_default = 0x7f080004;
public static final int common_signin_btn_light_text_disabled = 0x7f080006;
public static final int common_signin_btn_light_text_focused = 0x7f080007;
public static final int common_signin_btn_light_text_pressed = 0x7f080005;
public static final int common_signin_btn_text_dark = 0x7f08001e;
public static final int common_signin_btn_text_light = 0x7f08001f;
public static final int wallet_bright_foreground_disabled_holo_light = 0x7f08000f;
public static final int wallet_bright_foreground_holo_dark = 0x7f08000a;
public static final int wallet_bright_foreground_holo_light = 0x7f080010;
public static final int wallet_dim_foreground_disabled_holo_dark = 0x7f08000c;
public static final int wallet_dim_foreground_holo_dark = 0x7f08000b;
public static final int wallet_dim_foreground_inverse_disabled_holo_dark = 0x7f08000e;
public static final int wallet_dim_foreground_inverse_holo_dark = 0x7f08000d;
public static final int wallet_highlighted_text_holo_dark = 0x7f080014;
public static final int wallet_highlighted_text_holo_light = 0x7f080013;
public static final int wallet_hint_foreground_holo_dark = 0x7f080012;
public static final int wallet_hint_foreground_holo_light = 0x7f080011;
public static final int wallet_holo_blue_light = 0x7f080015;
public static final int wallet_link_text_light = 0x7f080016;
public static final int wallet_primary_text_holo_light = 0x7f080020;
public static final int wallet_secondary_text_holo_dark = 0x7f080021;
}
public static final class drawable {
public static final int common_full_open_on_phone = 0x7f020000;
public static final int common_ic_googleplayservices = 0x7f020001;
public static final int common_signin_btn_icon_dark = 0x7f020002;
public static final int common_signin_btn_icon_disabled_dark = 0x7f020003;
public static final int common_signin_btn_icon_disabled_focus_dark = 0x7f020004;
public static final int common_signin_btn_icon_disabled_focus_light = 0x7f020005;
public static final int common_signin_btn_icon_disabled_light = 0x7f020006;
public static final int common_signin_btn_icon_focus_dark = 0x7f020007;
public static final int common_signin_btn_icon_focus_light = 0x7f020008;
public static final int common_signin_btn_icon_light = 0x7f020009;
public static final int common_signin_btn_icon_normal_dark = 0x7f02000a;
public static final int common_signin_btn_icon_normal_light = 0x7f02000b;
public static final int common_signin_btn_icon_pressed_dark = 0x7f02000c;
public static final int common_signin_btn_icon_pressed_light = 0x7f02000d;
public static final int common_signin_btn_text_dark = 0x7f02000e;
public static final int common_signin_btn_text_disabled_dark = 0x7f02000f;
public static final int common_signin_btn_text_disabled_focus_dark = 0x7f020010;
public static final int common_signin_btn_text_disabled_focus_light = 0x7f020011;
public static final int common_signin_btn_text_disabled_light = 0x7f020012;
public static final int common_signin_btn_text_focus_dark = 0x7f020013;
public static final int common_signin_btn_text_focus_light = 0x7f020014;
public static final int common_signin_btn_text_light = 0x7f020015;
public static final int common_signin_btn_text_normal_dark = 0x7f020016;
public static final int common_signin_btn_text_normal_light = 0x7f020017;
public static final int common_signin_btn_text_pressed_dark = 0x7f020018;
public static final int common_signin_btn_text_pressed_light = 0x7f020019;
public static final int ic_plusone_medium_off_client = 0x7f02001b;
public static final int ic_plusone_small_off_client = 0x7f02001c;
public static final int ic_plusone_standard_off_client = 0x7f02001d;
public static final int ic_plusone_tall_off_client = 0x7f02001e;
public static final int powered_by_google_dark = 0x7f02001f;
public static final int powered_by_google_light = 0x7f020020;
}
public static final class id {
public static final int adjust_height = 0x7f0b0000;
public static final int adjust_width = 0x7f0b0001;
public static final int book_now = 0x7f0b0010;
public static final int buyButton = 0x7f0b000c;
public static final int buy_now = 0x7f0b0011;
public static final int buy_with_google = 0x7f0b0012;
public static final int classic = 0x7f0b0014;
public static final int donate_with_google = 0x7f0b0013;
public static final int grayscale = 0x7f0b0015;
public static final int holo_dark = 0x7f0b0007;
public static final int holo_light = 0x7f0b0008;
public static final int hybrid = 0x7f0b0003;
public static final int match_parent = 0x7f0b000e;
public static final int monochrome = 0x7f0b0016;
public static final int none = 0x7f0b0002;
public static final int normal = 0x7f0b0004;
public static final int production = 0x7f0b0009;
public static final int sandbox = 0x7f0b000a;
public static final int satellite = 0x7f0b0005;
public static final int selectionDetails = 0x7f0b000d;
public static final int slide = 0x7f0b0017;
public static final int strict_sandbox = 0x7f0b000b;
public static final int terrain = 0x7f0b0006;
public static final int wrap_content = 0x7f0b000f;
}
public static final class integer {
public static final int google_play_services_version = 0x7f090000;
}
public static final class raw {
public static final int gtm_analytics = 0x7f040000;
}
public static final class string {
public static final int accept = 0x7f06000b;
public static final int common_android_wear_notification_needs_update_text = 0x7f060012;
public static final int common_android_wear_update_text = 0x7f06001f;
public static final int common_android_wear_update_title = 0x7f06001d;
public static final int common_google_play_services_enable_button = 0x7f06001b;
public static final int common_google_play_services_enable_text = 0x7f06001a;
public static final int common_google_play_services_enable_title = 0x7f060019;
public static final int common_google_play_services_error_notification_requested_by_msg = 0x7f060014;
public static final int common_google_play_services_install_button = 0x7f060018;
public static final int common_google_play_services_install_text_phone = 0x7f060016;
public static final int common_google_play_services_install_text_tablet = 0x7f060017;
public static final int common_google_play_services_install_title = 0x7f060015;
public static final int common_google_play_services_invalid_account_text = 0x7f060023;
public static final int common_google_play_services_invalid_account_title = 0x7f060022;
public static final int common_google_play_services_needs_enabling_title = 0x7f060013;
public static final int common_google_play_services_network_error_text = 0x7f060021;
public static final int common_google_play_services_network_error_title = 0x7f060020;
public static final int common_google_play_services_notification_needs_installation_title = 0x7f060010;
public static final int common_google_play_services_notification_needs_update_title = 0x7f060011;
public static final int common_google_play_services_notification_ticker = 0x7f06000f;
public static final int common_google_play_services_sign_in_failed_text = 0x7f06002d;
public static final int common_google_play_services_sign_in_failed_title = 0x7f06002c;
public static final int common_google_play_services_unknown_issue = 0x7f060024;
public static final int common_google_play_services_unsupported_text = 0x7f060026;
public static final int common_google_play_services_unsupported_title = 0x7f060025;
public static final int common_google_play_services_update_button = 0x7f060027;
public static final int common_google_play_services_update_text = 0x7f06001e;
public static final int common_google_play_services_update_title = 0x7f06001c;
public static final int common_open_on_phone = 0x7f06002a;
public static final int common_signin_button_text = 0x7f060028;
public static final int common_signin_button_text_long = 0x7f060029;
public static final int commono_google_play_services_api_unavailable_text = 0x7f06002b;
public static final int create_calendar_message = 0x7f06000e;
public static final int create_calendar_title = 0x7f06000d;
public static final int decline = 0x7f06000c;
public static final int store_picture_message = 0x7f06000a;
public static final int store_picture_title = 0x7f060009;
public static final int wallet_buy_button_place_holder = 0x7f06002e;
}
public static final class style {
public static final int Theme_IAPTheme = 0x7f070002;
public static final int WalletFragmentDefaultButtonTextAppearance = 0x7f070005;
public static final int WalletFragmentDefaultDetailsHeaderTextAppearance = 0x7f070004;
public static final int WalletFragmentDefaultDetailsTextAppearance = 0x7f070003;
public static final int WalletFragmentDefaultStyle = 0x7f070006;
}
public static final class styleable {
public static final int[] AdsAttrs = { 0x7f010000, 0x7f010001, 0x7f010002 };
public static final int AdsAttrs_adSize = 0;
public static final int AdsAttrs_adSizes = 1;
public static final int AdsAttrs_adUnitId = 2;
public static final int[] CustomWalletTheme = { 0x7f010025 };
public static final int CustomWalletTheme_windowTransitionStyle = 0;
public static final int[] LoadingImageView = { 0x7f010003, 0x7f010004, 0x7f010005 };
public static final int LoadingImageView_circleCrop = 2;
public static final int LoadingImageView_imageAspectRatio = 1;
public static final int LoadingImageView_imageAspectRatioAdjust = 0;
public static final int[] MapAttrs = { 0x7f010006, 0x7f010007, 0x7f010008, 0x7f010009, 0x7f01000a, 0x7f01000b, 0x7f01000c, 0x7f01000d, 0x7f01000e, 0x7f01000f, 0x7f010010, 0x7f010011, 0x7f010012, 0x7f010013, 0x7f010014, 0x7f010015 };
public static final int MapAttrs_cameraBearing = 1;
public static final int MapAttrs_cameraTargetLat = 2;
public static final int MapAttrs_cameraTargetLng = 3;
public static final int MapAttrs_cameraTilt = 4;
public static final int MapAttrs_cameraZoom = 5;
public static final int MapAttrs_liteMode = 6;
public static final int MapAttrs_mapType = 0;
public static final int MapAttrs_uiCompass = 7;
public static final int MapAttrs_uiMapToolbar = 15;
public static final int MapAttrs_uiRotateGestures = 8;
public static final int MapAttrs_uiScrollGestures = 9;
public static final int MapAttrs_uiTiltGestures = 10;
public static final int MapAttrs_uiZoomControls = 11;
public static final int MapAttrs_uiZoomGestures = 12;
public static final int MapAttrs_useViewLifecycle = 13;
public static final int MapAttrs_zOrderOnTop = 14;
public static final int[] WalletFragmentOptions = { 0x7f010016, 0x7f010017, 0x7f010018, 0x7f010019 };
public static final int WalletFragmentOptions_appTheme = 0;
public static final int WalletFragmentOptions_environment = 1;
public static final int WalletFragmentOptions_fragmentMode = 3;
public static final int WalletFragmentOptions_fragmentStyle = 2;
public static final int[] WalletFragmentStyle = { 0x7f01001a, 0x7f01001b, 0x7f01001c, 0x7f01001d, 0x7f01001e, 0x7f01001f, 0x7f010020, 0x7f010021, 0x7f010022, 0x7f010023, 0x7f010024 };
public static final int WalletFragmentStyle_buyButtonAppearance = 3;
public static final int WalletFragmentStyle_buyButtonHeight = 0;
public static final int WalletFragmentStyle_buyButtonText = 2;
public static final int WalletFragmentStyle_buyButtonWidth = 1;
public static final int WalletFragmentStyle_maskedWalletDetailsBackground = 6;
public static final int WalletFragmentStyle_maskedWalletDetailsButtonBackground = 8;
public static final int WalletFragmentStyle_maskedWalletDetailsButtonTextAppearance = 7;
public static final int WalletFragmentStyle_maskedWalletDetailsHeaderTextAppearance = 5;
public static final int WalletFragmentStyle_maskedWalletDetailsLogoImageType = 10;
public static final int WalletFragmentStyle_maskedWalletDetailsLogoTextColor = 9;
public static final int WalletFragmentStyle_maskedWalletDetailsTextAppearance = 4;
}
}
Binary file not shown.
@@ -0,0 +1 @@
doc=../../../docs/reference
@@ -12,4 +12,5 @@

# Project target.
target=android-19
android.library.reference.1=..\\Oauth\\GoogleEx
android.library.reference.1=..\\google-play-services_lib
android.library.reference.2=../Oauth/GoogleEx
@@ -21,8 +21,9 @@
android:id="@+id/drinkList"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="20dp"
android:layout_weight="1"
android:layout_marginTop="20dp">
android:textColor="@color/red" >
</ListView>

<View
@@ -81,7 +81,7 @@
android:layout_height="wrap_content"
android:text="@string/enter_age"
android:layout_marginTop="10dp"
android:textAppearance="?android:attr/textAppearanceLarge" />
android:textAppearance="?android:attr/textAppearanceLarge"/>"

<EditText
android:id="@+id/type_age"
@@ -5,7 +5,7 @@

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
@@ -21,25 +21,41 @@
android:contentDescription="@string/smart_bar_actionbar"
android:src="@drawable/smart_bar_logo" />

<TextView
android:id="@+id/smartBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:text="@string/smart_bar_actionbar"
android:textAppearance="?android:attr/textAppearanceLarge" />

<Button
android:id="@+id/oauthButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:onClick="oauthLogin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:text="@string/oauth_button" />
<TextView
android:id="@+id/smartBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:text="@string/smart_bar_actionbar"
android:textAppearance="?android:attr/textAppearanceLarge" />

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >

<com.google.android.gms.common.SignInButton
android:id="@+id/sign_in_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<Button
android:id="@+id/sign_out_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/sign_out_button_name"
android:enabled="false" />

<Button
android:id="@+id/revoke_access_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/revoke_access_button_name"
android:enabled="false" />

</LinearLayout>

<Button
android:id="@+id/loginButton"
@@ -9,6 +9,8 @@
<string name="smart_bar_actionbar">Smart Bar</string>
<string name="login_button">Login</string>
<string name="new_user_button">New User</string>
<string name="sign_out_button_name">Sign Out</string>
<string name="revoke_access_button_name">Revoke</string>

<!-- Login Activity -->
<string name="login_actionbar">Log In</string>
@@ -7,7 +7,7 @@
import android.view.inputmethod.InputMethodManager;

/*
* This class holds the global app-wide variables (number, username, logged in)
* This class holds the global app-wide variables (number, user name, logged in)
*/
public class MyApplication extends Application {

@@ -68,10 +68,7 @@ public void retrieveAndStoreAccessToken(String authorizationCode) throws IOExcep
Log.i(Constants.TAG, "Refresh Token : " + tokenResponse.getRefreshToken());
flow.createAndStoreCredential(tokenResponse, oauth2Params.getUserId());
}





public String executeApiCall() throws IOException {
Log.i(Constants.TAG,"Executing API call at url " + this.oauth2Params.getApiUrl());
return HTTP_TRANSPORT.createRequestFactory(loadCredential()).buildGetRequest(new GenericUrl(this.oauth2Params.getApiUrl())).execute().parseAsString();
@@ -5,6 +5,8 @@
*
* @author davydewaele
*/


import java.net.URLDecoder;

import android.annotation.SuppressLint;
@@ -21,6 +23,7 @@
import android.webkit.WebView;
import android.webkit.WebViewClient;


/**
* Execute the OAuthRequestTokenTask to retrieve the request, and authorize the request.
* After the request is authorized by the user, the callback URL will be intercepted here.
@@ -31,6 +34,11 @@ public class OAuthAccessTokenActivity extends Activity {
// Initializations
private SharedPreferences prefs;
private OAuth2Helper oAuth2Helper;

private WebView webview;

boolean handled=false;
private boolean hasLoggedIn;

@Override
public void onCreate(Bundle savedInstanceState) {
@@ -51,7 +59,7 @@ public void onCreate(Bundle savedInstanceState) {
webview.setWebViewClient(new WebViewClient() {

@Override
public void onPageStarted(WebView view, String url,Bitmap bitmap) {
public void onPageStarted(WebView view, String url,Bitmap bitmap) {
Log.d(Constants.TAG, "onPageStarted : " + url + " handled = " + handled);
}

@@ -70,17 +78,11 @@ public void onPageFinished(final WebView view, final String url) {
webview.setVisibility(View.VISIBLE);
}
}

});
});

webview.loadUrl(authorizationUrl);
webview.loadUrl(authorizationUrl);
}

private WebView webview;

boolean handled=false;
private boolean hasLoggedIn;

@Override
protected void onResume() {
super.onResume();
@@ -89,7 +91,6 @@ protected void onResume() {
finish();
}
}


/**
* Background task to extract authorization code from url and retrieve access token associated with the code.
@@ -1,32 +1,112 @@
package com.example.smartbarmobile;

/*
/**
* Modified from com.ecs.android.sample.oauth2
*
* @author davydewaele
*/

import android.app.Activity;
import android.app.PendingIntent;
import android.content.Intent;
import android.content.IntentSender.SendIntentException;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;

/*
import com.google.android.gms.common.api.CommonStatusCodes;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks;
import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener;
import com.google.android.gms.common.api.ResultCallback;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.SignInButton;
import com.google.android.gms.plus.People.LoadPeopleResult;
import com.google.android.gms.plus.Plus;
import com.google.android.gms.plus.model.people.PersonBuffer;
import com.google.android.gms.plus.model.people.Person;

/**
* This class defines the behavior for the startup screen of the mobile app.
* Directs user to create account, login via SmartBar, login via Google authentication.
* Directs user to create account, login via SmartBar, login via Google.
*/
public class StartupActivity extends Activity {
public class StartupActivity extends Activity implements ConnectionCallbacks, OnConnectionFailedListener, OnClickListener, ResultCallback<LoadPeopleResult> {

private static final String TAG = "smartbar GoogleAPiClient";

private static final int STATE_DEFAULT = 0;
private static final int STATE_SIGN_IN = 1;
private static final int STATE_IN_PROGRESS = 2;

private static final String SAVED_PROGRESS = "Sign in progress";

/* Request code used to invoke sign in user interactions. */
private static final int RC_SIGN_IN = 0;

/* Client used to interact with Google APIs. */
private GoogleApiClient mGoogleApiClient;

// We use mSignInProgress to track whether user has clicked sign in.
// mSignInProgress can be one of three values:
//
// STATE_DEFAULT: The default state of the application before the user
// has clicked 'sign in', or after they have clicked
// 'sign out'. In this state we will not attempt to
// resolve sign in errors and so will display our
// Activity in a signed out state.
// STATE_SIGN_IN: This state indicates that the user has clicked 'sign
// in', so resolve successive errors preventing sign in
// until the user has successfully authorized an account
// for our app.
// STATE_IN_PROGRESS: This state indicates that we have started an intent to
// resolve an error, and so we should not start further
// intents until the current intent completes.
private int mSignInProgress;

/*
* Used to store the PendingIntent most recently returned by Google Play Services until the user clicks sign in.
*/
private PendingIntent mSignInIntent;

private SignInButton mSignInButton;
private Button mSignOutButton;
private Button mRevokeButton;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_startup);

// initializes app wide global boolean to false
((MyApplication)this.getApplication()).setLoggedIn(false);
}
((MyApplication)this.getApplication()).setLoggedIn(false);

// for back navigation
mSignInButton = (SignInButton) findViewById(R.id.sign_in_button);
mSignOutButton = (Button) findViewById(R.id.sign_out_button);
mRevokeButton = (Button) findViewById(R.id.revoke_access_button);

mSignInButton.setOnClickListener(this);
mSignOutButton.setOnClickListener(this);
mRevokeButton.setOnClickListener(this);

if (savedInstanceState != null) {
mSignInProgress = savedInstanceState.getInt(SAVED_PROGRESS, STATE_DEFAULT);
}

/**
* When we build the GoogleApiClient we specify where connected and connection failed callbacks should be returned,
* which Google APIs our app uses and which OAuth 2.0 scopes our app requests.
*/
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(Plus.API, Plus.PlusOptions.builder().build())
.addScope(Plus.SCOPE_PLUS_LOGIN)
.build();
}

@Override
public void onBackPressed() {
}
@@ -43,16 +123,201 @@ public void startupToNewUser(View view) {
Intent intent = new Intent(this, NewUserActivity.class);
startActivity(intent);
}

// when 'sign in with gmail' clicked
public void oauthLogin(View view) {
startOauthFlow(Oauth2Params.GOOGLE_PLUS);
}

// starts google oauth authentication
private void startOauthFlow(Oauth2Params oauth2Params) {
Constants.OAUTH2PARAMS = oauth2Params;
Intent intent = new Intent(this, OAuthAccessTokenActivity.class);

@Override
protected void onStart() {
super.onStart();
mGoogleApiClient.connect();
}

@Override
protected void onStop() {
super.onStop();

if (mGoogleApiClient.isConnected()) {
mGoogleApiClient.disconnect();
}
}

@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putInt(SAVED_PROGRESS, mSignInProgress);
}

@Override
public void onClick(View view) {
if (!mGoogleApiClient.isConnecting()) {
// We only process button clicks when GoogleApiClient is not transition-ing between connected and not connected.
switch(view.getId()) {
case R.id.sign_in_button:
Toast.makeText(this, "Signing in...", Toast.LENGTH_SHORT).show();
resolveSignInError();
break;
case R.id.sign_out_button:
Toast.makeText(this, "Signing out...", Toast.LENGTH_SHORT).show();
// Clear the default account on sign out so that Google Play services will not return an onConnected
// callback without user interaction.
Plus.AccountApi.clearDefaultAccount(mGoogleApiClient);
mGoogleApiClient.disconnect();
mGoogleApiClient.connect();
break;
case R.id.revoke_access_button:
// After we revoke permissions for the user with a GoogleApiClient instance, we must discard it and
// create a new one.
Plus.AccountApi.clearDefaultAccount(mGoogleApiClient);
// Want to normally register a callback on revokeAccessAndDisconnect to delete user data so that
// we comply with Google developer policies.
Plus.AccountApi.revokeAccessAndDisconnect(mGoogleApiClient);
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(Plus.API, Plus.PlusOptions.builder().build())
.addScope(Plus.SCOPE_PLUS_LOGIN)
.build();
mGoogleApiClient.connect();
break;
default:
break;
}
}
}

/**
* onConnected is called when our Activity successfully connects to Google Play services. onConnected indicates that an account
* was selected on the device, that the selected account has granted any requested permissions to our app and that we were able
* to establish a service connection to Google Play Services.
*/
@Override
public void onConnected(Bundle connectionHint) {
Log.v(TAG, "onConnected reached");
Toast.makeText(this, "User is Connected!", Toast.LENGTH_SHORT).show();

// Update the user interface to reflect that the user is signed in.
mSignInButton.setEnabled(false);
mSignOutButton.setEnabled(true);
mRevokeButton.setEnabled(true);

// Retrieve some profile information to personalize our app for the user
Person currentUser = Plus.PeopleApi.getCurrentPerson(mGoogleApiClient);
String mEmail = Plus.AccountApi.getAccountName(mGoogleApiClient);
((MyApplication)this.getApplication()).myUsername = mEmail;
((MyApplication)this.getApplication()).myPassword = mEmail;

Log.v(TAG, "Signed in as " + currentUser.getDisplayName());
Plus.PeopleApi.loadVisible(mGoogleApiClient, null).setResultCallback(this);

// Indicate that the sign in process is complete.
mSignInProgress = STATE_DEFAULT;

// Proceed to normal application flow
Intent intent = new Intent(this, WelcomeActivity.class);
startActivity(intent);
}

/**
* onConnectionFailed is called when our Activity could not connect to Google Play Services. onConnectionFailed indicates that
* the user needs to select an account, grant permissions or resolve an error in order for sign in.
*/
@Override
public void onConnectionFailed(ConnectionResult result) {
// Refer to the JavaDoc for ConnectionResult to see what error codes might be returned in onConnectionFailed.
Log.i(TAG, "onConnectionFailed: ConnectionResult.getErrorCode() = " + result.getErrorCode());

if (result.getErrorCode() == ConnectionResult.API_UNAVAILABLE) {
// The device's current configuration might not be supported with the requested API or a requested API or a required
// component may not be installed.

} else if (mSignInProgress != STATE_IN_PROGRESS) {
// We do not have an intent in progress so we should store the latest error resolution intent for use when the sign
// in button is clicked.
mSignInIntent = result.getResolution();

if (mSignInProgress == STATE_SIGN_IN) {
// STATE_SIGN_IN indicates the user already clicked the sign in button so we should continue processing errors until
// the user is signed in or they click cancel.
resolveSignInError();
}
}
onSignedOut();
}

/**
* Starts an appropriate intent or dialog for user interaction to resolve the current error preventing the user from being
* signed in. This could be a dialog allowing the user to select an account, an activity allowing the user to consent to the
* permissions being requested by your app, a setting to enable device networking, etc.
*/
private void resolveSignInError() {
if (mSignInIntent != null) {
// We have an intent which will allow our user to sign in or resolve an error. For example, if the user needs to
// select an account to sign in with, or if they need consent to the permissions your app is requesting.
try {
// Send the pending intent that we stored on the most recent OnConnectionFailed callback. This will allow the
// user to resolve the error currently preventing our connection to Google Play Services.
mSignInProgress = STATE_IN_PROGRESS;
startIntentSenderForResult(mSignInIntent.getIntentSender(), RC_SIGN_IN, null, 0, 0, 0);
} catch (SendIntentException e) {
Log.i(TAG, "Sign in intent could not be sent: " + e.getLocalizedMessage());
// The intent was cancelled before it was sent. Return to the default state and attempt to connect to get an updated ConnectionResult.
mSignInProgress = STATE_SIGN_IN;
mGoogleApiClient.connect();
}
} else {
// Google Play Services wasn't able to provide an intent for some error types, so we show the default Google Play
// Services error dialog which may still start an intent on our behalf if the user can resolve the issue.
Log.v(TAG, "Unable to provide intent");
}
}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case RC_SIGN_IN:
if (resultCode == RESULT_OK) {
// If the error resolution was successful we should continue processing errors.
mSignInProgress = STATE_SIGN_IN;
} else {
// If the error resolution was not successful or the user cancelled, we should stop processing errors.
mSignInProgress = STATE_DEFAULT;
}
if (!mGoogleApiClient.isConnecting()) {
// If Google Play Services resolved the issue with a dialog then onStart is not called so we need to re-attempt
// connection here.
mGoogleApiClient.connect();
}
break;
}
}

@Override
public void onResult(LoadPeopleResult peopleData) {
if (peopleData.getStatus().getStatusCode() == CommonStatusCodes.SUCCESS) {
PersonBuffer personBuffer = peopleData.getPersonBuffer();
try {
int count = personBuffer.getCount();
Log.d(TAG, "mCirclesList starting");
for (int i = 0; i < count; i++) {
Log.d(TAG, "Display name: " + personBuffer.get(i).getDisplayName());
}
} finally {
personBuffer.close();
}
} else {
Log.e(TAG, "Error requesting visible circiles: " + peopleData.getStatus());
}
}

private void onSignedOut() {
// Update the UI to reflect that the user signed out
mSignInButton.setEnabled(true);
mSignOutButton.setEnabled(false);
mRevokeButton.setEnabled(false);
}

public void onConnectionSuspended(int cause) {
// Connection to Google Play Services was lost. Call connect() to attempt to re-establish the connection or get a
// ConnectionResult that we can attempt to resolve.
mGoogleApiClient.connect();
}
}