• Home
Name Date Size #Lines LOC

..--

Application/03-May-2024-1,118635

buildSrc/03-May-2024-1613

gradle/wrapper/03-May-2024-76

screenshots/03-May-2024-

CONTRIB.mdD03-May-20241.6 KiB3627

LICENSED03-May-202411.1 KiB202169

README.mdD03-May-20243.2 KiB8765

build.gradleD03-May-2024251 129

gradlewD03-May-20245 KiB165122

gradlew.batD03-May-20242.3 KiB9166

packaging.yamlD03-May-2024490 1610

settings.gradleD03-May-202422 21

template-params.xmlD03-May-20243.7 KiB10075

README.md

1Android MessagingService Sample
2==============================
3
4This sample shows a simple service that sends notifications using
5NotificationCompat. In addition to sending a notification, it also extends
6the notification with a CarExtender to make it compatible with Android Auto.
7Each unread conversation from a user is sent as a distinct notification.
8
9Checklist while building a messaging app that supports Android Auto:
10-------------------------------------------------------------------
111. Ensure that Message notifications are extended using
12NotificationCompat.Builder.extend(new CarExtender()...)
132. Declare a meta-data tag to your AndroidManifest.xml to specify that your app
14is automotive enabled.
15
16example: AndroidManifest.xml
17
18```
19       <meta-data android:name="com.google.android.gms.car.application"
20                   android:resource="@xml/automotive_app_desc"/>
21```
22
23Include the following to indicate that the application wants to show notifications on
24the Android Auto overview screen.
25
26res/xml/automotive\_app\_desc.xml
27```
28<automotiveApp>
29    <uses name="notification"/>
30</automotiveApp>
31```
32
33Flow
34-----
35MessagingFragment is shown to the user. Depending on the button clicked, the MessagingService is
36sent a message. MessagingService in turn creates notifications which can be viewed either on the
37device or in the messaging-simulator.
38When a message is read, the associated PendingIntent is called and MessageReadReceiver is called
39with the appropriate conversationId. Similarly, when a reply is received, the MessageReplyReceiver
40is called with the appropriate conversationId. MessageLogger logs each event and shows them in a
41TextView in MessagingFragment for correlation.
42
43
44Pre-requisites
45--------------
46
47- Android SDK v21
48- Android Support Repository
49
50Getting Started
51---------------
52
53This sample uses the Gradle build system. To build this project, use the
54"gradlew build" command or use "Import Project" in Android Studio.
55
56Support
57-------
58
59- Google+ Community: https://plus.google.com/communities/105153134372062985968
60- Stack Overflow: http://stackoverflow.com/questions/tagged/android
61
62If you've found an error in this sample, please file an issue:
63https://github.com/googlesamples/android-MessagingService
64
65Patches are encouraged, and may be submitted by forking this project and
66submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.
67
68License
69-------
70
71Copyright 2014 The Android Open Source Project, Inc.
72
73Licensed to the Apache Software Foundation (ASF) under one or more contributor
74license agreements.  See the NOTICE file distributed with this work for
75additional information regarding copyright ownership.  The ASF licenses this
76file to you under the Apache License, Version 2.0 (the "License"); you may not
77use this file except in compliance with the License.  You may obtain a copy of
78the License at
79
80  http://www.apache.org/licenses/LICENSE-2.0
81
82Unless required by applicable law or agreed to in writing, software
83distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
84WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
85License for the specific language governing permissions and limitations under
86the License.
87