Permalink
Browse files

Update Play Services and Gradle Versions

  • Loading branch information...
kroikie committed Dec 17, 2015
1 parent c2830d8 commit 8a9ef69f50a9aefeba3fb95880f815382ed56b67
@@ -1,5 +1,4 @@
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 23
@@ -31,10 +30,12 @@ dependencies {
compile 'com.android.support:appcompat-v7:23.0.0'

// [START gradle_play_config]
compile 'com.google.android.gms:play-services-ads:8.3.0'
compile 'com.google.android.gms:play-services-ads:8.4.0'
// [END gradle_play_config]

androidTestCompile 'com.android.support.test.espresso:espresso-core:2.1'
androidTestCompile 'com.android.support.test:runner:0.2'
androidTestCompile 'com.android.support:support-annotations:23.0.0'
}

apply plugin: 'com.google.gms.google-services'
@@ -5,8 +5,8 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.google.gms:google-services:1.5.0'
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
classpath 'com.google.gms:google-services:2.0.0-alpha3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
@@ -24,5 +24,6 @@ dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:support-v4:23.0.0'
compile 'com.google.android.gms:play-services-analytics:8.3.0'

compile 'com.google.android.gms:play-services-analytics:8.4.0'
}
@@ -5,8 +5,8 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.google.gms:google-services:1.5.0'
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
classpath 'com.google.gms:google-services:2.0.0-alpha3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
@@ -22,5 +22,5 @@ android {
dependencies {
compile 'com.android.support:support-v4:23.0.0'

compile 'com.google.android.gms:play-services-appindexing:8.3.0'
compile 'com.google.android.gms:play-services-appindexing:8.4.0'
}
@@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
@@ -1,5 +1,4 @@
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 23
@@ -33,11 +32,13 @@ dependencies {
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'

compile 'com.google.android.gms:play-services-appinvite:8.3.0'
compile 'com.google.android.gms:play-services-appinvite:8.4.0'

// UiAutomatorTesting
androidTestCompile 'com.android.support.test:runner:0.3'
androidTestCompile 'com.android.support.test:rules:0.3'
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1'
androidTestCompile 'com.android.support:support-annotations:23.0.1'
}

apply plugin: 'com.google.gms.google-services'
@@ -33,7 +33,7 @@
import com.google.android.gms.common.api.ResultCallback;

/**
* Main Activity for sending App Invites and launching the DeepLinkActivity when an
* Main Activity for sending App Invites and launchings the DeepLinkActivity when an
* App Invite is received.
*/
public class MainActivity extends AppCompatActivity implements
@@ -54,6 +54,7 @@ protected void onCreate(Bundle savedInstanceState) {

// Invite button click listener
findViewById(R.id.invite_button).setOnClickListener(this);
findViewById(R.id.custom_invite_button).setOnClickListener(this);
// [END_EXCLUDE]

// Create an auto-managed GoogleApiClient with acccess to App Invites.
@@ -102,6 +103,31 @@ private void onInviteClicked() {
}
// [END on_invite_clicked]

/**
* User has clicked the 'Custom Invite' button, launch the invitation UI but pass in
* a custom HTML body and subject for email invites.
*/
// [START on_custom_invite_clicked]
private void onCustomInviteClicked() {
// When using the setEmailHtmlContent method, you must also set a subject using the
// setEmailSubject message and you may not use either setCustomImage or setCallToActionText
// in conjunction with the setEmailHtmlContent method.
//
// The "%%APPINVITE_LINK_PLACEHOLDER%%" token is replaced by the invitation server
// with the custom invitation deep link based on the other parameters you provide.
Intent intent = new AppInviteInvitation.IntentBuilder(getString(R.string.invitation_title))
.setMessage(getString(R.string.invitation_message))
.setDeepLink(Uri.parse(getString(R.string.invitation_deep_link)))
.setEmailHtmlContent("<html><body>" +
"<h1>App Invites</h1>" +
"<a href=\"%%APPINVITE_LINK_PLACEHOLDER%%\">Install Now!</a>" +
"<body></html>")
.setEmailSubject(getString(R.string.invitation_subject))
.build();
startActivityForResult(intent, REQUEST_INVITE);
}
// [END on_custom_invite_clicked]

// [START on_activity_result]
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
@@ -135,6 +161,9 @@ public void onClick(View view) {
case R.id.invite_button:
onInviteClicked();
break;
case R.id.custom_invite_button:
onCustomInviteClicked();
break;
}
}
}
@@ -23,11 +23,20 @@
android:id="@+id/invite_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/custom_invite_button"
android:layout_centerHorizontal="true"
android:text="@string/invite_friends"
android:theme="@style/ThemeOverlay.MyBlueButton"/>

<Button
android:id="@+id/custom_invite_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="75dp"
android:theme="@style/ThemeOverlay.MyBlueButton"
android:text="@string/invite_friends"/>
android:text="@string/custom_invite"
android:theme="@style/ThemeOverlay.MyBlueButton"/>

<FrameLayout
android:id="@+id/snackbar_layout"
@@ -17,6 +17,7 @@
<string name="invitation_deep_link">http://example.com/offer/five_dollar_offer</string>
<string name="invitation_custom_image">https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png</string>
<string name="invitation_cta">Install!</string>
<string name="invitation_subject">Try this great app!</string>

<string name="deep_link_fmt" formatted="false">Deep Link: %s</string>
<string name="invitation_id_fmt" formatted="false">Invitation ID: %s</string>
@@ -26,4 +27,5 @@
<string name="invite_dialog_title">You got an invitation!</string>

<string name="google_play_services_error">Google Play Services Error</string>
<string name="custom_invite">Custom Invite</string>
</resources>
@@ -5,8 +5,8 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.google.gms:google-services:1.5.0'
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
classpath 'com.google.gms:google-services:2.0.0-alpha3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
@@ -23,6 +23,14 @@ Getting Started
- A notification containing the GCM message should be displayed on the
device.

NOTE
----

The GcmSender module in this project is emulating a server for the purposes of
this sample, but it's not meant to serve as an example for a production app
server. For information on GCM server implementaion
see [About GCM Connection Server](https://developers.google.com/cloud-messaging/server)

Screenshots
-----------
![Screenshot](app/src/main/gcm-sample.png)
@@ -1,5 +1,4 @@
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 23
@@ -27,7 +26,7 @@ android {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services-gcm:8.3.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'

compile 'com.android.support:appcompat-v7:23.0.0'

@@ -36,3 +35,5 @@ dependencies {
androidTestCompile 'com.android.support.test:runner:0.2'
androidTestCompile 'com.android.support:support-annotations:23.0.0'
}

apply plugin: 'com.google.gms.google-services'
@@ -5,8 +5,8 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.google.gms:google-services:1.5.0'
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
classpath 'com.google.gms:google-services:2.0.0-alpha3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -26,6 +26,12 @@
import java.net.HttpURLConnection;
import java.net.URL;

// NOTE:
// This class emulates a server for the purposes of this sample,
// but it's not meant to serve as an example for a production app server.
// This class should also not be included in the client (Android) applicaiton
// since it includes the server's API key. For information on GCM server
// implementaion see: https://developers.google.com/cloud-messaging/server
public class GcmSender {

public static final String API_KEY = "API_KEY";
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
@@ -1,5 +1,4 @@
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 23
@@ -46,3 +45,5 @@ dependencies {
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.0'
androidTestCompile 'com.android.support:support-annotations:23.0.1'
}

apply plugin: 'com.google.gms.google-services'
@@ -1,5 +1,4 @@
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 23
@@ -38,11 +37,14 @@ dependencies {
compile 'com.android.support:design:23.0.1'

// Dependency for Google Sign-In
compile 'com.google.android.gms:play-services-auth:8.3.0'
compile 'com.google.android.gms:play-services-auth:8.4.0'

// UiAutomatorTesting
androidTestCompile 'com.android.support.test:runner:0.2'
androidTestCompile 'com.android.support.test:rules:0.2'
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.0'
androidTestCompile 'com.android.support:support-annotations:23.0.1'
}

apply plugin: 'com.google.gms.google-services'

@@ -102,7 +102,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
// [START get_id_token]
GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
Log.d(TAG, "onActivityResult:GET_TOKEN:success:" + result.getStatus().isSuccess());

if (result.isSuccess()) {
GoogleSignInAccount acct = result.getSignInAccount();
String idToken = acct.getIdToken();
@@ -5,8 +5,8 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.google.gms:google-services:1.5.0'
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
classpath 'com.google.gms:google-services:2.0.0-alpha3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files

0 comments on commit 8a9ef69

Please sign in to comment.