BasicMediaDecoder: Use new build system

Migrate BasicMediaDecoder to use new templatized build system for
conformity with other samples.

Also moved common/src/com/example/android/common/media to
common/src/java/com/example/android/common/media, in order to make it
visible to the template system.

Change-Id: I11613d27bb61f45b92893cfd08b70f788fdc1fc1
diff --git a/common/src/com/example/android/common/media/CameraHelper.java b/common/src/java/com/example/android/common/media/CameraHelper.java
similarity index 100%
rename from common/src/com/example/android/common/media/CameraHelper.java
rename to common/src/java/com/example/android/common/media/CameraHelper.java
diff --git a/common/src/com/example/android/common/media/MediaCodecWrapper.java b/common/src/java/com/example/android/common/media/MediaCodecWrapper.java
similarity index 100%
rename from common/src/com/example/android/common/media/MediaCodecWrapper.java
rename to common/src/java/com/example/android/common/media/MediaCodecWrapper.java
diff --git a/media/BasicMediaDecoder/BasicMediaDecoder/build.gradle b/media/BasicMediaDecoder/BasicMediaDecoder/build.gradle
deleted file mode 100644
index b89e935..0000000
--- a/media/BasicMediaDecoder/BasicMediaDecoder/build.gradle
+++ /dev/null
@@ -1,23 +0,0 @@
-buildscript {
-    repositories {
-        mavenCentral()
-    }
-    dependencies {
-        classpath 'com.android.tools.build:gradle:0.5.+'
-    }
-}
-apply plugin: 'android'
-
-dependencies {
-    compile files('libs/android-support-v4.jar')
-}
-
-android {
-    compileSdkVersion 17
-    buildToolsVersion "18.0.1"
-
-    defaultConfig {
-        minSdkVersion 16
-        targetSdkVersion 16
-    }
-}
diff --git a/media/BasicMediaDecoder/BasicMediaDecoder/src/main/AndroidManifest.xml b/media/BasicMediaDecoder/BasicMediaDecoder/src/main/AndroidManifest.xml
deleted file mode 100644
index 889f1f2..0000000
--- a/media/BasicMediaDecoder/BasicMediaDecoder/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-          package="com.example.android.media.basicmediadecoder"
-          android:versionCode="1"
-          android:versionName="1.0">
-
-    <uses-sdk android:minSdkVersion="17"/>
-    <application
-        android:label="@string/app_name" android:icon="@drawable/ic_launcher">
-        <activity
-            android:name=".MainActivity"
-            android:screenOrientation="landscape"
-            android:label="@string/app_name">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN"/>
-                <category android:name="android.intent.category.LAUNCHER"/>
-            </intent-filter>
-        </activity>
-    </application>
-</manifest>
diff --git a/media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/layout/activity_main.xml b/media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/layout/activity_main.xml
deleted file mode 100644
index 2926e81..0000000
--- a/media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/layout/activity_main.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
-              android:orientation="vertical"
-              android:layout_width="fill_parent"
-              android:layout_height="fill_parent"
-    >
-    <TextureView
-        android:id="@+id/PlaybackView"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"/>
-    <TextView
-            android:id="@+id/AttribView"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_gravity="right|bottom"
-            android:visibility="gone"
-            android:textColor="@android:color/holo_blue_bright"
-            android:text="@string/app_video_attrib"/>
-</FrameLayout>
-
diff --git a/media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/menu/action_menu.xml b/media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/menu/action_menu.xml
deleted file mode 100644
index b2a2a4d..0000000
--- a/media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/menu/action_menu.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<menu xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:id="@+id/menu_play"
-          android:icon="@drawable/selector_play"
-          android:title="Play"
-          android:showAsAction="ifRoom|withText" />
-</menu>
\ No newline at end of file
diff --git a/media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/raw b/media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/raw
deleted file mode 120000
index 0905975..0000000
--- a/media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/raw
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../common/assets/video/
\ No newline at end of file
diff --git a/media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/values/strings.xml b/media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/values/strings.xml
deleted file mode 100644
index 68e5c22..0000000
--- a/media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <string name="app_name">BasicMediaDecoder</string>
-    <string name="app_video_attrib">(c) copyright 2008, Blender Foundation / www.bigbuckbunny.org
-    </string>
-</resources>
diff --git a/media/BasicMediaDecoder/BasicMediaDecoderSample/.gitignore b/media/BasicMediaDecoder/BasicMediaDecoderSample/.gitignore
new file mode 100644
index 0000000..6eb878d
--- /dev/null
+++ b/media/BasicMediaDecoder/BasicMediaDecoderSample/.gitignore
@@ -0,0 +1,16 @@
+# Copyright 2013 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+src/template/
+src/common/
+build.gradle
diff --git a/media/BasicMediaDecoder/BasicMediaDecoderSample/proguard-project.txt b/media/BasicMediaDecoder/BasicMediaDecoderSample/proguard-project.txt
new file mode 100644
index 0000000..0d8f171
--- /dev/null
+++ b/media/BasicMediaDecoder/BasicMediaDecoderSample/proguard-project.txt
@@ -0,0 +1,20 @@
+ To enable ProGuard in your project, edit project.properties
+# to define the proguard.config property as described in that file.
+#
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in ${sdk.dir}/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the ProGuard
+# include property in project.properties.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
diff --git a/media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/AndroidManifest.xml b/media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..d191491
--- /dev/null
+++ b/media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/AndroidManifest.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2013 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.example.android.basicmediadecoder"
+    android:versionCode="1"
+    android:versionName="1.0">
+
+    <uses-sdk android:minSdkVersion="17"/>
+    <application
+        android:label="@string/app_name" android:icon="@drawable/ic_launcher">
+        <activity
+            android:name=".MainActivity"
+            android:screenOrientation="landscape"
+            android:label="@string/app_name">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN"/>
+                <category android:name="android.intent.category.LAUNCHER"/>
+            </intent-filter>
+        </activity>
+    </application>
+
+</manifest>
diff --git a/media/BasicMediaDecoder/BasicMediaDecoder/src/main/java/com/example/android/media/basicmediadecoder/MainActivity.java b/media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/java/com/example/android/basicmediadecoder/MainActivity.java
similarity index 93%
rename from media/BasicMediaDecoder/BasicMediaDecoder/src/main/java/com/example/android/media/basicmediadecoder/MainActivity.java
rename to media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/java/com/example/android/basicmediadecoder/MainActivity.java
index 96e7d60..cac5bf2 100644
--- a/media/BasicMediaDecoder/BasicMediaDecoder/src/main/java/com/example/android/media/basicmediadecoder/MainActivity.java
+++ b/media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/java/com/example/android/basicmediadecoder/MainActivity.java
@@ -14,25 +14,30 @@
  * limitations under the License.
  */
 
-package com.example.android.media.basicmediadecoder;
+package com.example.android.basicmediadecoder;
 
 
-import com.example.android.common.media.MediaCodecWrapper;
-
 import android.animation.TimeAnimator;
 import android.app.Activity;
 import android.media.MediaCodec;
 import android.media.MediaExtractor;
 import android.net.Uri;
 import android.os.Bundle;
-import android.view.*;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+import android.view.Surface;
+import android.view.TextureView;
+import android.view.View;
 import android.widget.TextView;
 
+import com.example.android.common.media.MediaCodecWrapper;
+
 import java.io.IOException;
 
 /**
- * This activity uses a {@link TextureView} to render the frames of a video decoded using
- * {@link MediaCodec} API.
+ * This activity uses a {@link android.view.TextureView} to render the frames of a video decoded using
+ * {@link android.media.MediaCodec} API.
  */
 public class MainActivity extends Activity {
 
@@ -52,7 +57,7 @@
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_main);
+        setContentView(R.layout.sample_main);
         mPlaybackView = (TextureView) findViewById(R.id.PlaybackView);
         mAttribView =  (TextView)findViewById(R.id.AttribView);
 
diff --git a/media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/drawable-hdpi/ic_action_play.png b/media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/drawable-hdpi/ic_action_play.png
similarity index 100%
rename from media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/drawable-hdpi/ic_action_play.png
rename to media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/drawable-hdpi/ic_action_play.png
Binary files differ
diff --git a/media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/drawable-hdpi/ic_action_play_disabled.png b/media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/drawable-hdpi/ic_action_play_disabled.png
similarity index 100%
rename from media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/drawable-hdpi/ic_action_play_disabled.png
rename to media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/drawable-hdpi/ic_action_play_disabled.png
Binary files differ
diff --git a/media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/drawable-hdpi/ic_launcher.png b/media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/drawable-hdpi/ic_launcher.png
similarity index 100%
rename from media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/drawable-hdpi/ic_launcher.png
rename to media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/drawable-mdpi/ic_action_play.png b/media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/drawable-mdpi/ic_action_play.png
similarity index 100%
rename from media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/drawable-mdpi/ic_action_play.png
rename to media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/drawable-mdpi/ic_action_play.png
Binary files differ
diff --git a/media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/drawable-mdpi/ic_action_play_disabled.png b/media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/drawable-mdpi/ic_action_play_disabled.png
similarity index 100%
rename from media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/drawable-mdpi/ic_action_play_disabled.png
rename to media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/drawable-mdpi/ic_action_play_disabled.png
Binary files differ
diff --git a/media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/drawable-mdpi/ic_launcher.png b/media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/drawable-mdpi/ic_launcher.png
similarity index 100%
rename from media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/drawable-mdpi/ic_launcher.png
rename to media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/drawable-xhdpi/ic_action_play.png b/media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/drawable-xhdpi/ic_action_play.png
similarity index 100%
rename from media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/drawable-xhdpi/ic_action_play.png
rename to media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/drawable-xhdpi/ic_action_play.png
Binary files differ
diff --git a/media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/drawable-xhdpi/ic_action_play_disabled.png b/media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/drawable-xhdpi/ic_action_play_disabled.png
similarity index 100%
rename from media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/drawable-xhdpi/ic_action_play_disabled.png
rename to media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/drawable-xhdpi/ic_action_play_disabled.png
Binary files differ
diff --git a/media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/drawable-xhdpi/ic_launcher.png b/media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/drawable-xhdpi/ic_launcher.png
similarity index 100%
rename from media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/drawable-xhdpi/ic_launcher.png
rename to media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/drawable-xxhdpi/ic_launcher.png b/media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/drawable-xxhdpi/ic_launcher.png
similarity index 100%
rename from media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/drawable-xxhdpi/ic_launcher.png
rename to media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/drawable/selector_play.xml b/media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/drawable/selector_play.xml
similarity index 100%
rename from media/BasicMediaDecoder/BasicMediaDecoder/src/main/res/drawable/selector_play.xml
rename to media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/drawable/selector_play.xml
diff --git a/media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/layout/sample_main.xml b/media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/layout/sample_main.xml
new file mode 100644
index 0000000..7543120
--- /dev/null
+++ b/media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/layout/sample_main.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2013 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+              android:orientation="vertical"
+              android:layout_width="fill_parent"
+              android:layout_height="fill_parent"
+    >
+    <TextureView
+        android:id="@+id/PlaybackView"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"/>
+    <TextView
+            android:id="@+id/AttribView"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="right|bottom"
+            android:visibility="gone"
+            android:textColor="@android:color/holo_blue_bright"
+            android:text="@string/app_video_attrib"/>
+</FrameLayout>
+
diff --git a/media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/menu/action_menu.xml b/media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/menu/action_menu.xml
new file mode 100644
index 0000000..2b31a86
--- /dev/null
+++ b/media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/menu/action_menu.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2013 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:id="@+id/menu_play"
+          android:icon="@drawable/selector_play"
+          android:title="Play"
+          android:showAsAction="ifRoom|withText" />
+</menu>
\ No newline at end of file
diff --git a/common/assets/video/vid_bigbuckbunny.mp4 b/media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/raw/vid_bigbuckbunny.mp4
similarity index 100%
rename from common/assets/video/vid_bigbuckbunny.mp4
rename to media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/raw/vid_bigbuckbunny.mp4
Binary files differ
diff --git a/media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/values/strings.xml b/media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/values/strings.xml
new file mode 100644
index 0000000..2cf79ab
--- /dev/null
+++ b/media/BasicMediaDecoder/BasicMediaDecoderSample/src/main/res/values/strings.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2013 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resources>
+    <string name="app_video_attrib">(c) copyright 2008, Blender Foundation / www.bigbuckbunny.org
+    </string>
+</resources>
diff --git a/media/BasicMediaDecoder/build.gradle b/media/BasicMediaDecoder/build.gradle
index 495c503..c886d80 100644
--- a/media/BasicMediaDecoder/build.gradle
+++ b/media/BasicMediaDecoder/build.gradle
@@ -1 +1,11 @@
-// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+
+
+
+// BEGIN_EXCLUDE
+apply from: "../../../../build/build.gradle"
+samplegen {
+  pathToBuild "../../../../build"
+  pathToSamplesCommon "../../common"
+}
+// END_EXCLUDE
diff --git a/media/BasicMediaDecoder/buildSrc/build.gradle b/media/BasicMediaDecoder/buildSrc/build.gradle
new file mode 100644
index 0000000..29282af
--- /dev/null
+++ b/media/BasicMediaDecoder/buildSrc/build.gradle
@@ -0,0 +1,18 @@
+
+
+
+repositories {
+    mavenCentral()
+}
+dependencies {
+    compile 'org.freemarker:freemarker:2.3.20'
+}
+
+sourceSets {
+    main {
+        groovy {
+            srcDir new File(rootDir, "../../../../../build/buildSrc/src/main/groovy")
+        }
+    }
+}
+
diff --git a/media/BasicMediaDecoder/gradle/wrapper/gradle-wrapper.properties b/media/BasicMediaDecoder/gradle/wrapper/gradle-wrapper.properties
index 5c22dec..861eddc 100644
--- a/media/BasicMediaDecoder/gradle/wrapper/gradle-wrapper.properties
+++ b/media/BasicMediaDecoder/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=http\://services.gradle.org/distributions/gradle-1.6-bin.zip
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip
diff --git a/media/BasicMediaDecoder/settings.gradle b/media/BasicMediaDecoder/settings.gradle
index 217721c..1e76e09 100644
--- a/media/BasicMediaDecoder/settings.gradle
+++ b/media/BasicMediaDecoder/settings.gradle
@@ -1 +1,4 @@
-include ':BasicMediaDecoder'
+
+
+
+include 'BasicMediaDecoderSample'
diff --git a/media/BasicMediaDecoder/template-params.xml b/media/BasicMediaDecoder/template-params.xml
new file mode 100644
index 0000000..8d412dc
--- /dev/null
+++ b/media/BasicMediaDecoder/template-params.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2013 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+
+
+<sample>
+    <name>BasicMediaDecoder</name>
+    <group>Media</group>
+    <package>com.example.android.basicmediadecoder</package>
+
+    <!-- change minSdk if needed-->
+    <minSdk>17</minSdk>
+
+    <strings>
+        <intro>
+            <![CDATA[
+             This activity uses a TextureView to render the frames of a video decoded using the
+             MediaCodec API.
+            ]]>
+        </intro>
+    </strings>
+
+    <template src="base"/>
+    <common src="media"/>
+</sample>