diff --git a/samples/wearable/AgendaData/Application/build.gradle b/samples/wearable/AgendaData/Application/build.gradle index 9c68a1864..19aeb471b 100644 --- a/samples/wearable/AgendaData/Application/build.gradle +++ b/samples/wearable/AgendaData/Application/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'android' android { - compileSdkVersion 20 + compileSdkVersion 18 buildToolsVersion '20' defaultConfig { minSdkVersion 18 - targetSdkVersion 20 + targetSdkVersion 19 versionCode 1 versionName "1.0" } @@ -23,4 +23,4 @@ dependencies { compile 'com.google.android.gms:play-services:5.0.+@aar' compile "com.android.support:support-v4:20.0.+" wearApp project(':Wearable') -} \ No newline at end of file +} diff --git a/samples/wearable/AgendaData/Application/src/main/AndroidManifest.xml b/samples/wearable/AgendaData/Application/src/main/AndroidManifest.xml index d96efd8d5..7f070ffd0 100644 --- a/samples/wearable/AgendaData/Application/src/main/AndroidManifest.xml +++ b/samples/wearable/AgendaData/Application/src/main/AndroidManifest.xml @@ -2,8 +2,6 @@ - - diff --git a/samples/wearable/AgendaData/Wearable/build.gradle b/samples/wearable/AgendaData/Wearable/build.gradle index a1921f0d5..0e23b4d56 100644 --- a/samples/wearable/AgendaData/Wearable/build.gradle +++ b/samples/wearable/AgendaData/Wearable/build.gradle @@ -20,7 +20,6 @@ android { } dependencies { - compile 'com.google.android.gms:play-services:5.+@aar' - compile "com.android.support:support-v4:20.0.+" + compile 'com.google.android.gms:play-services-wearable:+' compile "com.google.android.support:wearable:1.0.+" } \ No newline at end of file diff --git a/samples/wearable/AgendaData/Wearable/src/main/AndroidManifest.xml b/samples/wearable/AgendaData/Wearable/src/main/AndroidManifest.xml index f986b3aa3..2bb042ddc 100644 --- a/samples/wearable/AgendaData/Wearable/src/main/AndroidManifest.xml +++ b/samples/wearable/AgendaData/Wearable/src/main/AndroidManifest.xml @@ -2,8 +2,6 @@ - - - - - - - - - - - - - - - - - - - - + package="com.example.android.wearable.gridviewpager" > - - - - - - - - - - + package="com.example.android.wearable.recipeassistant" > - - - - + android:theme="@android:style/Theme.DeviceDefault.Light" + android:allowBackup="true"> diff --git a/samples/wearable/Timer/Wearable/src/main/java/com/example/android/wearable/timer/SetTimerActivity.java b/samples/wearable/Timer/Wearable/src/main/java/com/example/android/wearable/timer/SetTimerActivity.java index 92dbfc043..2d0ec2f85 100644 --- a/samples/wearable/Timer/Wearable/src/main/java/com/example/android/wearable/timer/SetTimerActivity.java +++ b/samples/wearable/Timer/Wearable/src/main/java/com/example/android/wearable/timer/SetTimerActivity.java @@ -19,14 +19,13 @@ package com.example.android.wearable.timer; import android.app.Activity; import android.app.AlarmManager; import android.app.Notification; +import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.content.res.Resources; import android.os.Bundle; import android.provider.AlarmClock; -import android.support.v4.app.NotificationCompat; -import android.support.v4.app.NotificationManagerCompat; import android.util.Log; import android.view.View; import android.widget.AdapterView; @@ -35,21 +34,15 @@ import android.widget.ListView; import com.example.android.wearable.timer.util.Constants; import com.example.android.wearable.timer.util.TimerFormat; -import com.google.android.gms.common.ConnectionResult; -import com.google.android.gms.common.api.GoogleApiClient; -import com.google.android.gms.wearable.Wearable; /** This class sets a timer. */ -public class SetTimerActivity extends Activity - implements AdapterView.OnItemClickListener, GoogleApiClient.ConnectionCallbacks, - GoogleApiClient.OnConnectionFailedListener { +public class SetTimerActivity extends Activity implements AdapterView.OnItemClickListener { public static final int NUMBER_OF_TIMES = 10; public static final String TAG = "SetTimerActivity"; private ListViewItem[] mTimeOptions = new ListViewItem[NUMBER_OF_TIMES]; private ListView mListView; - private GoogleApiClient mGoogleApiClient; @Override @@ -82,24 +75,6 @@ public class SetTimerActivity extends Activity android.R.layout.simple_list_item_1, mTimeOptions); mListView.setAdapter(arrayAdapter); mListView.setOnItemClickListener(this); - - mGoogleApiClient = new GoogleApiClient.Builder(this) - .addApi(Wearable.API) - .addConnectionCallbacks(this) - .addOnConnectionFailedListener(this) - .build(); - } - - @Override - protected void onStart() { - super.onStart(); - mGoogleApiClient.connect(); - } - - @Override - protected void onStop() { - super.onStop(); - mGoogleApiClient.disconnect(); } /** @@ -107,7 +82,8 @@ public class SetTimerActivity extends Activity * milliseconds. */ private void setupTimer(long duration) { - NotificationManagerCompat notifyMgr = NotificationManagerCompat.from(this); + NotificationManager notifyMgr = + ((NotificationManager) getSystemService(NOTIFICATION_SERVICE)); // Delete dataItem and cancel a potential old countdown. cancelCountdown(notifyMgr); @@ -165,7 +141,7 @@ public class SetTimerActivity extends Activity .getService(this, 0, deleteIntent, PendingIntent.FLAG_UPDATE_CURRENT); // Create countdown notification using a chronometer style. - return new NotificationCompat.Builder(this) + return new Notification.Builder(this) .setSmallIcon(R.drawable.ic_cc_alarm) .setContentTitle(getString(R.string.timer_time_left)) .setContentText(TimerFormat.getTimeString(duration)) @@ -185,7 +161,7 @@ public class SetTimerActivity extends Activity * * @param notifyMgr the notification manager. */ - private void cancelCountdown(NotificationManagerCompat notifyMgr) { + private void cancelCountdown(NotificationManager notifyMgr) { notifyMgr.cancel(Constants.NOTIFICATION_TIMER_EXPIRED); } @@ -208,15 +184,4 @@ public class SetTimerActivity extends Activity } } - @Override - public void onConnected(Bundle connectionHint) { - } - - @Override - public void onConnectionSuspended(int cause) { - } - - @Override - public void onConnectionFailed(ConnectionResult result) { - } } diff --git a/samples/wearable/Timer/Wearable/src/main/java/com/example/android/wearable/timer/TimerNotificationService.java b/samples/wearable/Timer/Wearable/src/main/java/com/example/android/wearable/timer/TimerNotificationService.java index 344d84c0c..11437e67c 100644 --- a/samples/wearable/Timer/Wearable/src/main/java/com/example/android/wearable/timer/TimerNotificationService.java +++ b/samples/wearable/Timer/Wearable/src/main/java/com/example/android/wearable/timer/TimerNotificationService.java @@ -19,27 +19,18 @@ package com.example.android.wearable.timer; import android.app.AlarmManager; import android.app.IntentService; import android.app.Notification; +import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; -import android.os.Bundle; -import android.support.v4.app.NotificationCompat; -import android.support.v4.app.NotificationManagerCompat; import android.util.Log; import com.example.android.wearable.timer.util.Constants; -import com.google.android.gms.common.ConnectionResult; -import com.google.android.gms.common.api.GoogleApiClient; -import com.google.android.gms.wearable.Wearable; - -import java.util.concurrent.TimeUnit; /** * Service class that manages notifications of the timer. */ -public class TimerNotificationService extends IntentService - implements GoogleApiClient.ConnectionCallbacks, - GoogleApiClient.OnConnectionFailedListener { +public class TimerNotificationService extends IntentService { public static final String TAG = "TimerNotificationSvc"; @@ -94,7 +85,8 @@ public class TimerNotificationService extends IntentService } private void cancelCountdownNotification() { - NotificationManagerCompat notifyMgr = NotificationManagerCompat.from(this); + NotificationManager notifyMgr = + ((NotificationManager) getSystemService(NOTIFICATION_SERVICE)); notifyMgr.cancel(Constants.NOTIFICATION_TIMER_COUNTDOWN); } @@ -109,8 +101,9 @@ public class TimerNotificationService extends IntentService .getService(this, 0, restartIntent, PendingIntent.FLAG_UPDATE_CURRENT); // Create notification that timer has expired. - NotificationManagerCompat notifyMgr = NotificationManagerCompat.from(this); - Notification notif = new NotificationCompat.Builder(this) + NotificationManager notifyMgr = + ((NotificationManager) getSystemService(NOTIFICATION_SERVICE)); + Notification notif = new Notification.Builder(this) .setSmallIcon(R.drawable.ic_cc_alarm) .setContentTitle(getString(R.string.timer_done)) .setContentText(getString(R.string.timer_done)) @@ -123,15 +116,4 @@ public class TimerNotificationService extends IntentService notifyMgr.notify(Constants.NOTIFICATION_TIMER_EXPIRED, notif); } - @Override - public void onConnected(Bundle connectionHint) { - } - - @Override - public void onConnectionSuspended(int cause) { - } - - @Override - public void onConnectionFailed(ConnectionResult result) { - } } diff --git a/samples/wearable/Timer/build.gradle b/samples/wearable/Timer/build.gradle index e33f14283..8bd4ffc49 100644 --- a/samples/wearable/Timer/build.gradle +++ b/samples/wearable/Timer/build.gradle @@ -1,5 +1,3 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - buildscript { repositories { mavenCentral() diff --git a/samples/wearable/WatchViewStub/Wearable/build.gradle b/samples/wearable/WatchViewStub/Wearable/build.gradle index 2a520308a..b9450ca9a 100644 --- a/samples/wearable/WatchViewStub/Wearable/build.gradle +++ b/samples/wearable/WatchViewStub/Wearable/build.gradle @@ -20,6 +20,5 @@ android { } dependencies { - compile "com.android.support:support-v13:20.0.+" compile "com.google.android.support:wearable:1.0.+" } diff --git a/samples/wearable/WatchViewStub/Wearable/src/main/AndroidManifest.xml b/samples/wearable/WatchViewStub/Wearable/src/main/AndroidManifest.xml index 21925469e..ea6d7b225 100644 --- a/samples/wearable/WatchViewStub/Wearable/src/main/AndroidManifest.xml +++ b/samples/wearable/WatchViewStub/Wearable/src/main/AndroidManifest.xml @@ -2,8 +2,6 @@ - -