aboutsummaryrefslogtreecommitdiff
path: root/wearable/wear/WearMessagingApp
diff options
context:
space:
mode:
authorBenjamin Baxter <benbaxter@google.com>2017-08-25 14:37:06 -0700
committerBenjamin Baxter <benbaxter@google.com>2017-08-28 14:55:28 -0700
commit4c82d9a9c6eac3498905bd9b28081e8e9085eb14 (patch)
tree6176a0c381913237a818d62cf5a2bc56eb8bc585 /wearable/wear/WearMessagingApp
parent00a58f92033ea5faa9f8ccdd5ea75b07da3184c1 (diff)
downloadandroid-4c82d9a9c6eac3498905bd9b28081e8e9085eb14.tar.gz
Add meta data to template-params.xml
Bug: 34841755 Test: Manually tested on device. Change-Id: I8f596b6e00291f4ee5ddb1f66c82252885cb7701
Diffstat (limited to 'wearable/wear/WearMessagingApp')
-rw-r--r--wearable/wear/WearMessagingApp/Wearable/build.gradle35
-rw-r--r--wearable/wear/WearMessagingApp/Wearable/google-services.json32
-rw-r--r--wearable/wear/WearMessagingApp/Wearable/src/main/AndroidManifest.xml4
-rw-r--r--wearable/wear/WearMessagingApp/Wearable/src/main/res/values/strings.xml2
-rw-r--r--wearable/wear/WearMessagingApp/build.gradle2
-rw-r--r--wearable/wear/WearMessagingApp/screenshots/chat.pngbin0 -> 58619 bytes
-rw-r--r--wearable/wear/WearMessagingApp/screenshots/chat_list.pngbin0 -> 59040 bytes
-rw-r--r--wearable/wear/WearMessagingApp/screenshots/contacts.pngbin0 -> 55396 bytes
-rw-r--r--wearable/wear/WearMessagingApp/template-params.xml113
9 files changed, 138 insertions, 50 deletions
diff --git a/wearable/wear/WearMessagingApp/Wearable/build.gradle b/wearable/wear/WearMessagingApp/Wearable/build.gradle
index 8ff40822..1a0d3d13 100644
--- a/wearable/wear/WearMessagingApp/Wearable/build.gradle
+++ b/wearable/wear/WearMessagingApp/Wearable/build.gradle
@@ -1,22 +1,36 @@
+buildscript {
+ repositories {
+ jcenter()
+ }
+
+ dependencies {
+ classpath 'com.android.tools.build:gradle:2.2.3'
+ }
+}
apply plugin: 'com.android.application'
+
+
dependencies {
compile 'com.android.support:appcompat-v7:25.3.1'
- compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-v13:25.3.1'
-
+ compile 'com.android.support:design:25.3.1'
compile 'com.google.android.gms:play-services-wearable:10.2.6'
compile 'com.google.android.gms:play-services-auth:10.2.6'
+ compile 'com.github.bumptech.glide:glide:3.8.0'
+ compile 'com.google.code.gson:gson:2.8.0'
- provided 'com.google.android.wearable:wearable:2.0.2'
- compile 'com.google.android.support:wearable:2.0.2'
- compile 'com.google.code.gson:gson:2.8.0'
+ compile 'com.google.android.gms:play-services-wearable:10.0.1'
+ compile 'com.android.support:support-v13:25.1.1'
+
+ provided 'com.google.android.wearable:wearable:2.0.0'
+
+ compile 'com.google.android.support:wearable:2.0.0'
- compile 'com.github.bumptech.glide:glide:3.8.0'
}
// The sample build uses multiple directories to
@@ -36,7 +50,7 @@ android {
versionCode 1
versionName "1.0"
- minSdkVersion 22
+ minSdkVersion 24
targetSdkVersion 25
}
@@ -55,13 +69,6 @@ android {
}
androidTest.setRoot('tests')
androidTest.java.srcDirs = ['tests/src']
- }
- packagingOptions {
- exclude 'META-INF/LICENSE.txt'
- exclude 'META-INF/NOTICE'
- exclude 'META-INF/LICENSE'
}
-
}
-apply plugin: 'com.google.gms.google-services' \ No newline at end of file
diff --git a/wearable/wear/WearMessagingApp/Wearable/google-services.json b/wearable/wear/WearMessagingApp/Wearable/google-services.json
new file mode 100644
index 00000000..9dc37f16
--- /dev/null
+++ b/wearable/wear/WearMessagingApp/Wearable/google-services.json
@@ -0,0 +1,32 @@
+{
+ "project_info": {
+ "project_number": "TODO: Add your information here. Check this page for more details: https://developers.google.com/identity/sign-in/android/start-integrating#get-config",
+ "project_id": "TODO: Replace entire block below with your information."
+ },
+ "client": [
+ {
+ "client_info": {
+ "mobilesdk_app_id": "...",
+ "android_client_info": {
+ "package_name": "com.example.android.wearable.wear.messaging"
+ }
+ },
+ "oauth_client": [
+ {
+ "client_id": "...",
+ "client_type": 1,
+ "android_info": {
+ "package_name": "com.example.android.wearable.wear.messaging",
+ "certificate_hash": "..."
+ }
+ }
+ ],
+ "api_key": [
+ {
+ "current_key": "..."
+ }
+ ]
+ }
+ ],
+ "configuration_version": "1"
+}
diff --git a/wearable/wear/WearMessagingApp/Wearable/src/main/AndroidManifest.xml b/wearable/wear/WearMessagingApp/Wearable/src/main/AndroidManifest.xml
index d625a9da..f7c11c42 100644
--- a/wearable/wear/WearMessagingApp/Wearable/src/main/AndroidManifest.xml
+++ b/wearable/wear/WearMessagingApp/Wearable/src/main/AndroidManifest.xml
@@ -32,6 +32,10 @@
android:name="com.google.android.wearable.standalone"
android:value="true" />
+ <uses-library
+ android:name="com.google.android.wearable"
+ android:required="false" />
+
<!--
Important Note: When you have a local/native Android Wear app that creates it's own
notifications, you will want to disable the bridge to the phone.
diff --git a/wearable/wear/WearMessagingApp/Wearable/src/main/res/values/strings.xml b/wearable/wear/WearMessagingApp/Wearable/src/main/res/values/strings.xml
index 4af172bd..d28a3bd8 100644
--- a/wearable/wear/WearMessagingApp/Wearable/src/main/res/values/strings.xml
+++ b/wearable/wear/WearMessagingApp/Wearable/src/main/res/values/strings.xml
@@ -17,6 +17,8 @@
<resources>
<string name="app_name">Wear Messaging App</string>
+ <string name="default_web_client_id">Enter your id here (from Google Developer console)</string>
+
<string name="holder_text">This is long holder text given the display on a watch</string>
<string name="plus_icon">plus icon</string>
diff --git a/wearable/wear/WearMessagingApp/build.gradle b/wearable/wear/WearMessagingApp/build.gradle
index 1cb45e1c..df8f8350 100644
--- a/wearable/wear/WearMessagingApp/build.gradle
+++ b/wearable/wear/WearMessagingApp/build.gradle
@@ -18,7 +18,7 @@ buildscript {
}
dependencies {
- classpath 'com.android.tools.build:gradle:2.3.1'
+ classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.0.0'
}
}
diff --git a/wearable/wear/WearMessagingApp/screenshots/chat.png b/wearable/wear/WearMessagingApp/screenshots/chat.png
new file mode 100644
index 00000000..9c171112
--- /dev/null
+++ b/wearable/wear/WearMessagingApp/screenshots/chat.png
Binary files differ
diff --git a/wearable/wear/WearMessagingApp/screenshots/chat_list.png b/wearable/wear/WearMessagingApp/screenshots/chat_list.png
new file mode 100644
index 00000000..6a4d1041
--- /dev/null
+++ b/wearable/wear/WearMessagingApp/screenshots/chat_list.png
Binary files differ
diff --git a/wearable/wear/WearMessagingApp/screenshots/contacts.png b/wearable/wear/WearMessagingApp/screenshots/contacts.png
new file mode 100644
index 00000000..5a3c7fda
--- /dev/null
+++ b/wearable/wear/WearMessagingApp/screenshots/contacts.png
Binary files differ
diff --git a/wearable/wear/WearMessagingApp/template-params.xml b/wearable/wear/WearMessagingApp/template-params.xml
index 78afc120..af0183a8 100644
--- a/wearable/wear/WearMessagingApp/template-params.xml
+++ b/wearable/wear/WearMessagingApp/template-params.xml
@@ -20,43 +20,34 @@
and replaced with the "categories" tags below. -->
<package>com.example.android.wearable.wear.messaging</package>
- <minSdk>22</minSdk>
+ <minSdk>24</minSdk>
<targetSdkVersion>25</targetSdkVersion>
<targetSdkVersionWear>25</targetSdkVersionWear>
- <wearable>
- <has_handheld_app>true</has_handheld_app>
- </wearable>
-
- <!-- Include additional dependencies here.-->
- <!-- dependency>com.google.android.gms:play-services:5.0.+</dependency -->
-
- <dependency>com.android.support:appcompat-v7:25.3.1</dependency>
- <dependency>com.android.support:cardview-v7:25.3.1</dependency>
- <dependency>com.android.support:design:25.3.1</dependency>
-
- <dependency>com.google.android.gms:play-services-wearable:10.2.6</dependency>
- <dependency>com.google.android.gms:play-services-auth:10.2.6</dependency>
-
- <dependency>com.github.bumptech.glide:glide:3.8.0</dependency>
- <dependency>com.google.code.gson:gson:2.8.0</dependency>
-
<dependency_wearable>com.android.support:appcompat-v7:25.3.1</dependency_wearable>
+ <dependency_wearable>com.android.support:support-v13:25.3.1</dependency_wearable>
<dependency_wearable>com.android.support:design:25.3.1</dependency_wearable>
+ <dependency_wearable>com.google.android.gms:play-services-wearable:10.2.6</dependency_wearable>
+ <dependency_wearable>com.google.android.gms:play-services-auth:10.2.6</dependency_wearable>
+
+ <dependency_wearable>com.github.bumptech.glide:glide:3.8.0</dependency_wearable>
+ <dependency_wearable>com.google.code.gson:gson:2.8.0</dependency_wearable>
+
<strings>
<intro>
- <![CDATA[
- Sample demonstrates best practices for building a messaging experience on Android Wear.
- ]]>
+<![CDATA[
+Sample demonstrates best practices for building a messaging experience on Android Wear.
+]]>
</intro>
</strings>
+ <template src="base-build" />
<template src="Wear" />
<metadata>
<!-- Values: {DRAFT | PUBLISHED | INTERNAL | DEPRECATED | SUPERCEDED} -->
- <status>DRAFT</status>
+ <status>PUBLISHED</status>
<!-- See http://go/sample-categories for details on the next 4 fields. -->
<!-- Most samples just need to udpate the Categories field. This is a comma-
seperated list of topic tags. Unlike the old category system, samples
@@ -84,8 +75,9 @@
<icon>screenshots/icon-web.png</icon>
<!-- Path to screenshots. Use <img> tags for each. -->
<screenshots>
- <img>screenshots/1-main.png</img>
- <img>screenshots/2-settings.png</img>
+ <img>screenshots/chat_list.png</img>
+ <img>screenshots/chat.png</img>
+ <img>screenshots/contacts.png</img>
</screenshots>
<!-- List of APIs that this sample should be cross-referenced under. Use <android>
for fully-qualified Framework class names ("android:" namespace).
@@ -93,7 +85,13 @@
Use <ext> for custom namespaces, if needed. See "Samples Index API" documentation
for more details. -->
<api_refs>
- <android>android.app.ActionBar</android>
+ <android>com.google.android.gms.auth.api.Auth</android>
+ <android>com.google.android.gms.auth.api.signin.GoogleSignInAccount</android>
+ <android>com.google.android.gms.common.api.GoogleApiClient</android>
+ <android>android.support.wearable.view.WearableRecyclerView</android>
+ <android>android.support.wearable.view.drawer.WearableActionDrawer</android>
+ <android>android.support.wearable.view.drawer.WearableDrawerLayout</android>
+ <android>android.support.v7.util.SortedList</android>
</api_refs>
<!-- 1-3 line description of the sample here.
@@ -101,22 +99,67 @@
Avoid simply rearranging the sample's title. What does this sample actually
accomplish, and how does it do it? -->
<description>
- Sample demonstrating how to instantiate an ActionBar on Android, define
- action items, and set an "up" navigation link. Uses the Support Library
- for compatibility with pre-3.0 devices.
+<![CDATA[
+Sample demonstrating how to build a messaging app with the following features: contacts list,
+chat list, send messages, message style notification, and sign-in with Google.
+]]>
</description>
<!-- Multi-paragraph introduction to sample, from an educational point-of-view.
Makrdown formatting allowed. This will be used to generate a mini-article for the
sample on DAC. -->
<intro>
- Long intro here.
-
- Multi-paragraph introduction to sample, from an educational point-of-view.
- *Makrdown* formatting allowed. See [Markdown Documentation][1]
- for details.
-
- [1]: http://daringfireball.net/projects/markdown/syntax
+<![CDATA[
+Getting Started
+---------------
+
+This project demonstrates Google Sign-in. You will need to follow the setup instructions for
+integrating Google Sign-in into an Android app at the link below. Remember to use the package name
+com.example.android.wearable.wear.messaging when configuring your project and credentials, or
+otherwise modify the sample appropriately if you want to use a different package name.
+
+https://developers.google.com/identity/sign-in/android/start-integrating
+
+After you finish setting up the ___google-services.json___ file for Google Sign-in, update the
+___strings.xml___ file for the string value ___default\_web\_client\_id___ to the value for the
+OAuth web client id created.
+
+Features
+---------------
+The project demonstrates the following features:
+
+- Chat list
+- Contacts list
+- Authentication with Google
+- Sending a chat message
+- Receiving a chat message
+- Replying from a notification
+
+Each feature is contained in it's own package:
+
+- _com.example.android.wearable.wear.messaging.____chat___
+ - Displays a conversation
+ - Handles incoming messages from a mocked back end server.
+ - Replies to messages from a notification
+- _com.example.android.wearable.wear.messaging.____chatlist___
+ - Displays all of the conversations you are involved in.
+- _com.example.android.wearable.wear.messaging.____contacts___
+ - Displays a list your contacts. In this sample, the contacts are mocked out. You will want to
+ replace the backing datasource with your own contacts solution.
+- _com.example.android.wearable.wear.messaging.____mock___
+ - A local mock database.
+- _com.example.android.wearable.wear.messaging.____model___
+ - Objects that are displayed in the UI. These objects also act as entities and are persisted in
+ the mock database.
+
+
+To see other examples of Google Sign-in, check out the [Android Wear Google Sign-In Sample][1].
+
+To see other examples of notifications, check out the [Android WearNotifications Sample][2]
+
+[1]: https://github.com/googlesamples/android-WearStandaloneGoogleSignIn
+[2]: https://github.com/googlesamples/android-WearNotifications
+]]>
</intro>
</metadata>
</sample>