Add metadata to MediaBrowserService Sample
Change-Id: I4809bd6e9c43143522a176bd900ad62068433066
diff --git a/media/MediaBrowserService/Application/src/main/res/drawable-hdpi/ic_launcher.png b/media/MediaBrowserService/Application/src/main/res/drawable-hdpi/ic_launcher.png
index 47d6854..05ef6f6 100644
--- a/media/MediaBrowserService/Application/src/main/res/drawable-hdpi/ic_launcher.png
+++ b/media/MediaBrowserService/Application/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/media/MediaBrowserService/Application/src/main/res/drawable-mdpi/ic_launcher.png b/media/MediaBrowserService/Application/src/main/res/drawable-mdpi/ic_launcher.png
index 01b53fd..f894fb8 100644
--- a/media/MediaBrowserService/Application/src/main/res/drawable-mdpi/ic_launcher.png
+++ b/media/MediaBrowserService/Application/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/media/MediaBrowserService/Application/src/main/res/drawable-xhdpi/ic_launcher.png b/media/MediaBrowserService/Application/src/main/res/drawable-xhdpi/ic_launcher.png
index af762f2..43ade5e 100644
--- a/media/MediaBrowserService/Application/src/main/res/drawable-xhdpi/ic_launcher.png
+++ b/media/MediaBrowserService/Application/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/media/MediaBrowserService/Application/src/main/res/drawable-xxhdpi/ic_launcher.png b/media/MediaBrowserService/Application/src/main/res/drawable-xxhdpi/ic_launcher.png
index eef47aa..3058c27 100644
--- a/media/MediaBrowserService/Application/src/main/res/drawable-xxhdpi/ic_launcher.png
+++ b/media/MediaBrowserService/Application/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/media/MediaBrowserService/Application/src/main/res/drawable-xxxhdpi/ic_launcher.png b/media/MediaBrowserService/Application/src/main/res/drawable-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..6b4e4a2
--- /dev/null
+++ b/media/MediaBrowserService/Application/src/main/res/drawable-xxxhdpi/ic_launcher.png
Binary files differ
diff --git a/media/MediaBrowserService/screenshots/1-main.png b/media/MediaBrowserService/screenshots/1-main.png
new file mode 100644
index 0000000..1b17d0e
--- /dev/null
+++ b/media/MediaBrowserService/screenshots/1-main.png
Binary files differ
diff --git a/media/MediaBrowserService/screenshots/2-music-play.png b/media/MediaBrowserService/screenshots/2-music-play.png
new file mode 100644
index 0000000..1c1439c
--- /dev/null
+++ b/media/MediaBrowserService/screenshots/2-music-play.png
Binary files differ
diff --git a/media/MediaBrowserService/screenshots/3-music-notification.png b/media/MediaBrowserService/screenshots/3-music-notification.png
new file mode 100644
index 0000000..c86c045
--- /dev/null
+++ b/media/MediaBrowserService/screenshots/3-music-notification.png
Binary files differ
diff --git a/media/MediaBrowserService/screenshots/icon-web.png b/media/MediaBrowserService/screenshots/icon-web.png
new file mode 100644
index 0000000..99928a8
--- /dev/null
+++ b/media/MediaBrowserService/screenshots/icon-web.png
Binary files differ
diff --git a/media/MediaBrowserService/template-params.xml b/media/MediaBrowserService/template-params.xml
index 2d9f487..8f9b2e6 100644
--- a/media/MediaBrowserService/template-params.xml
+++ b/media/MediaBrowserService/template-params.xml
@@ -34,34 +34,71 @@
connected to Android Auto, the same service provides data and callback
to the Android Auto UI in the same manner as it provides them to the
local UI.
- ]]>
-<!-- TODO(mangini): when b/18612065 is fixed, restore the block below:
+]]></intro>
+ </strings>
+ <!-- The basic templates have already been enabled. Uncomment more as desired. -->
+ <template src="basebuild" />
+ <metadata>
+ <status>PUBLISHED</status>
+ <categories>Media</categories>
+ <technologies>Android</technologies>
+ <languages>Java</languages>
+ <solutions>Mobile</solutions>
+ <level>ADVANCED</level>
+ <icon>screenshots/icon-web.png</icon>
+ <screenshots>
+ <img>screenshots/1-main.png</img>
+ <img>screenshots/2-music-play.png</img>
+ <img>screenshots/3-music-notification.png</img>
+ </screenshots>
+ <api_refs>
+ <android>android.service.media.MediaBrowserService</android>
+ <android>android.media.browse.MediaBrowser</android>
+ <android>android.media.session.MediaSession</android>
+ <android>android.media.session.MediaController</android>
+ <android>android.app.Notification.MediaStyle</android>
+ </api_refs>
+ <description>
+<![CDATA[
+This sample shows how to implement an audio media app that provides
+media library metadata and playback controls through a standard
+service. It exposes a simple music library through the new
+MediaBrowserService and provides MediaSession callbacks. This allows
+it to be used in Android Auto, for example.
+When not connected to a car, the app has a very simple UI that browses
+the media library and provides simple playback controls. When
+connected to Android Auto, the same service provides data and callback
+to the Android Auto UI in the same manner as it provides them to the
+local UI.
+]]></description>
+ <intro>
+<![CDATA[
To implement a MediaBrowserService, you need to:
-- extend android.service.media.MediaBrowserService, implementing the media
+- Extend android.service.media.MediaBrowserService, implementing the media
browsing related methods onGetRoot and onLoadChildren;
-- in onCreate, start a new MediaSession and call super.setSessionToken() with
+- In onCreate, start a new MediaSession and call super.setSessionToken() with
this MediaSession's token;
-- set a MediaSession.Callback class on the MediaSession. The callback class
+- Set a MediaSession.Callback class on the MediaSession. The callback class
will receive all the user's actions, like play, pause, etc;
-- handle all the actual music playing using any method your app prefers
+- Handle all the actual music playing using any method your app prefers
(for example, the Android MediaPlayer class)
-- whenever it changes, update info about the playing item and the playing
+- Whenever it changes, update info about the playing item and the playing
queue using MediaSession corresponding methods (setMetadata,
setPlaybackState, setQueue, setQueueTitle, etc)
-- handle AudioManager focus change events and react appropriately
+- Handle AudioManager focus change events and react appropriately
(e.g. pause when audio focus is lost)
To make it compatible with Android Auto, you also need to:
-- declare a meta-data tag in AndroidManifest.xml linking to a xml resource
+- Declare a meta-data tag in AndroidManifest.xml linking to a xml resource
with a automotiveApp root element. For a media app, this must include
an <uses name="media"/> element as a child.
@@ -79,7 +116,7 @@
</automotiveApp>
```
-- declare and export the service in AndroidManifest.xml:
+- Declare and export the service in AndroidManifest.xml:
```
<service
android:name=".service.MusicService"
@@ -89,10 +126,6 @@
</intent-filter>
</service>
```
--->
- </intro>
- </strings>
-
- <!-- The basic templates have already been enabled. Uncomment more as desired. -->
- <template src="basebuild" />
+]]></intro>
+ </metadata>
</sample>