Templatized BasicContactables Sample - Base Template

Change-Id: Ia09a5d85310619b0bf71879e28051217b3900574
diff --git a/content/contacts/BasicContactables/BasicContactables/build.gradle b/content/contacts/BasicContactables/BasicContactables/build.gradle
deleted file mode 100644
index 10fb811..0000000
--- a/content/contacts/BasicContactables/BasicContactables/build.gradle
+++ /dev/null
@@ -1,10 +0,0 @@
-apply plugin: 'android'
-
-dependencies {
-    compile "com.android.support:support-v4:18.0.+"
-}
-
-android {
-    compileSdkVersion 18
-    buildToolsVersion "18.0.1"
-}
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-hdpi/ic_launcher.png b/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-hdpi/ic_launcher.png
deleted file mode 100755
index 22ce606..0000000
--- a/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-hdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-mdpi/ic_launcher.png b/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-mdpi/ic_launcher.png
deleted file mode 100755
index f21e17b..0000000
--- a/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-mdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-xhdpi/ic_launcher.png b/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-xhdpi/ic_launcher.png
deleted file mode 100755
index 64b8059..0000000
--- a/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-xhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-xxhdpi/ic_launcher.png b/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-xxhdpi/ic_launcher.png
deleted file mode 100755
index 6b4434a..0000000
--- a/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-xxhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/values-sw600dp/dimens.xml b/content/contacts/BasicContactables/BasicContactables/src/main/res/values-sw600dp/dimens.xml
deleted file mode 100644
index 886b05f..0000000
--- a/content/contacts/BasicContactables/BasicContactables/src/main/res/values-sw600dp/dimens.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<resources>
-    <!-- Customize dimensions originally defined in res/values/dimens.xml (such as
-         screen margins) for sw600dp devices (e.g. 7" tablets) here. -->
-</resources>
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/values-sw600dp/styles.xml b/content/contacts/BasicContactables/BasicContactables/src/main/res/values-sw600dp/styles.xml
deleted file mode 100644
index 2bbb45f..0000000
--- a/content/contacts/BasicContactables/BasicContactables/src/main/res/values-sw600dp/styles.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?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.
-  -->
-
-<resources>
-
-    <style name="Widget.SampleOutput">
-        <item name="android:paddingTop">@dimen/margin_medium</item>
-        <item name="android:paddingBottom">@dimen/margin_medium</item>
-        <item name="android:paddingLeft">@dimen/margin_huge</item>
-        <item name="android:paddingRight">@dimen/margin_huge</item>
-        <item name="android:textAppearance">?android:textAppearanceLarge</item>
-        <item name="android:lineSpacingMultiplier">1.2</item>
-    </style>
-
-</resources>
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/values-sw720dp-land/dimens.xml b/content/contacts/BasicContactables/BasicContactables/src/main/res/values-sw720dp-land/dimens.xml
deleted file mode 100644
index 00059fc..0000000
--- a/content/contacts/BasicContactables/BasicContactables/src/main/res/values-sw720dp-land/dimens.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<resources>
-    <!-- Customize dimensions originally defined in res/values/dimens.xml (such as
-         screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here. -->
-    <dimen name="activity_horizontal_margin">128dp</dimen>
-</resources>
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/values/dimens.xml b/content/contacts/BasicContactables/BasicContactables/src/main/res/values/dimens.xml
deleted file mode 100644
index a83b995..0000000
--- a/content/contacts/BasicContactables/BasicContactables/src/main/res/values/dimens.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?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.
-  -->
-
-<resources>
-
-    <!-- Define standard dimensions to comply with Holo-style grids and rhythm. -->
-
-    <dimen name="margin_tiny">4dp</dimen>
-    <dimen name="margin_small">8dp</dimen>
-    <dimen name="margin_medium">16dp</dimen>
-    <dimen name="margin_large">32dp</dimen>
-    <dimen name="margin_huge">64dp</dimen>
-
-</resources>
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/values/strings.xml b/content/contacts/BasicContactables/BasicContactables/src/main/res/values/strings.xml
deleted file mode 100755
index 31ceceb..0000000
--- a/content/contacts/BasicContactables/BasicContactables/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?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.
-  -->
-
-<resources>
-    <string name="app_name">Basic Contactables Query</string>
-    <string name="intro_message">Welcome to <b>Basic Contactables Query</b>!\n\n
-        Use the search box to enter a term, and find matching contacts in
-        Android\'s contact database!
-    </string>
-    <string name="sample_action">Sample action</string>
-    <string name="search_title">Search Contacts</string>
-</resources>
diff --git a/content/contacts/BasicContactables/BasicContactablesSample/.gitignore b/content/contacts/BasicContactables/BasicContactablesSample/.gitignore
new file mode 100644
index 0000000..6eb878d
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactablesSample/.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/content/contacts/BasicContactables/BasicContactablesSample/proguard-project.txt b/content/contacts/BasicContactables/BasicContactablesSample/proguard-project.txt
new file mode 100644
index 0000000..0d8f171
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactablesSample/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/content/contacts/BasicContactables/BasicContactables/src/main/AndroidManifest.xml b/content/contacts/BasicContactables/BasicContactablesSample/src/main/AndroidManifest.xml
similarity index 67%
rename from content/contacts/BasicContactables/BasicContactables/src/main/AndroidManifest.xml
rename to content/contacts/BasicContactables/BasicContactablesSample/src/main/AndroidManifest.xml
index b008e84..62b9812 100644
--- a/content/contacts/BasicContactables/BasicContactables/src/main/AndroidManifest.xml
+++ b/content/contacts/BasicContactables/BasicContactablesSample/src/main/AndroidManifest.xml
@@ -1,9 +1,25 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?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.basiccontactables"
     android:versionCode="1"
     android:versionName="1.0" >
-    
+
     <!-- BEGIN_INCLUDE(contacts_permission) -->
     <uses-permission android:name="android.permission.READ_CONTACTS"/>
     <!-- END_INCLUDE(contacts_permission) -->
@@ -21,7 +37,7 @@
             android:name="com.example.android.basiccontactables.MainActivity"
             android:label="@string/app_name"
             android:launchMode="singleTop">
-            <meta-data 
+            <meta-data
                 android:name="android.app.searchable"
                 android:resource="@xml/searchable" />
             <intent-filter>
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/java/com/example/android/basiccontactables/ContactablesLoaderCallbacks.java b/content/contacts/BasicContactables/BasicContactablesSample/src/main/java/com/example/android/basiccontactables/ContactablesLoaderCallbacks.java
similarity index 89%
rename from content/contacts/BasicContactables/BasicContactables/src/main/java/com/example/android/basiccontactables/ContactablesLoaderCallbacks.java
rename to content/contacts/BasicContactables/BasicContactablesSample/src/main/java/com/example/android/basiccontactables/ContactablesLoaderCallbacks.java
index c583dac..4fc4da7 100644
--- a/content/contacts/BasicContactables/BasicContactables/src/main/java/com/example/android/basiccontactables/ContactablesLoaderCallbacks.java
+++ b/content/contacts/BasicContactables/BasicContactablesSample/src/main/java/com/example/android/basiccontactables/ContactablesLoaderCallbacks.java
@@ -23,7 +23,6 @@
 import android.database.Cursor;
 import android.net.Uri;
 import android.os.Bundle;
-import android.provider.ContactsContract;
 import android.provider.ContactsContract.CommonDataKinds;
 import android.util.Log;
 import android.widget.TextView;
@@ -55,17 +54,17 @@
         // BEGIN_INCLUDE(uri_with_query)
         String query = args.getString(QUERY_KEY);
         Uri uri = Uri.withAppendedPath(
-                ContactsContract.CommonDataKinds.Contactables.CONTENT_FILTER_URI, query);
+                CommonDataKinds.Contactables.CONTENT_FILTER_URI, query);
         // END_INCLUDE(uri_with_query)
 
 
         // BEGIN_INCLUDE(cursor_loader)
         // Easy way to limit the query to contacts with phone numbers.
         String selection =
-                ContactsContract.CommonDataKinds.Contactables.HAS_PHONE_NUMBER + " = " + 1;
+                CommonDataKinds.Contactables.HAS_PHONE_NUMBER + " = " + 1;
 
         // Sort results such that rows for the same contact stay together.
-        String sortBy = ContactsContract.CommonDataKinds.Contactables.LOOKUP_KEY;
+        String sortBy = CommonDataKinds.Contactables.LOOKUP_KEY;
 
         return new CursorLoader(
                 mContext,  // Context
@@ -80,6 +79,13 @@
     @Override
     public void onLoadFinished(Loader<Cursor> arg0, Cursor cursor) {
         TextView tv  = (TextView) ((Activity)mContext).findViewById(R.id.sample_output);
+        if(tv == null) {
+            Log.e(TAG, "TextView is null?!");
+        } else if (mContext == null) {
+            Log.e(TAG, "Context is null?");
+        } else {
+            Log.e(TAG, "Nothing is null?!");
+        }
 
         // Reset text in case of a previous query
         tv.setText(mContext.getText(R.string.intro_message) + "\n\n");
@@ -115,9 +121,9 @@
             // BEGIN_INCLUDE(retrieve_data)
             // The data type can be determined using the mime type column.
             String mimeType = cursor.getString(typeColumnIndex);
-            if (mimeType.equals(ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE)) {
+            if (mimeType.equals(CommonDataKinds.Phone.CONTENT_ITEM_TYPE)) {
                 tv.append("\tPhone Number: " + cursor.getString(phoneColumnIndex) + "\n");
-            } else if (mimeType.equals(ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE)) {
+            } else if (mimeType.equals(CommonDataKinds.Email.CONTENT_ITEM_TYPE)) {
                 tv.append("\tEmail Address: " + cursor.getString(emailColumnIndex) + "\n");
             }
             // END_INCLUDE(retrieve_data)
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/java/com/example/android/basiccontactables/MainActivity.java b/content/contacts/BasicContactables/BasicContactablesSample/src/main/java/com/example/android/basiccontactables/MainActivity.java
similarity index 98%
rename from content/contacts/BasicContactables/BasicContactables/src/main/java/com/example/android/basiccontactables/MainActivity.java
rename to content/contacts/BasicContactables/BasicContactablesSample/src/main/java/com/example/android/basiccontactables/MainActivity.java
index 9448ada..b8b074e 100644
--- a/content/contacts/BasicContactables/BasicContactables/src/main/java/com/example/android/basiccontactables/MainActivity.java
+++ b/content/contacts/BasicContactables/BasicContactablesSample/src/main/java/com/example/android/basiccontactables/MainActivity.java
@@ -37,7 +37,7 @@
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_main);
+        setContentView(R.layout.sample_main);
 
         if (getIntent() != null) {
             handleIntent(getIntent());
diff --git a/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-hdpi/ic_launcher.png b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-hdpi/ic_launcher.png
new file mode 100644
index 0000000..b1efaf4
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-hdpi/ic_search_api_holo_light.png b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-hdpi/ic_search_api_holo_light.png
similarity index 100%
rename from content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-hdpi/ic_search_api_holo_light.png
rename to content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-hdpi/ic_search_api_holo_light.png
Binary files differ
diff --git a/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-mdpi/ic_launcher.png b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-mdpi/ic_launcher.png
new file mode 100644
index 0000000..f5f9244
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-mdpi/ic_search_api_holo_light.png b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-mdpi/ic_search_api_holo_light.png
similarity index 100%
rename from content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-mdpi/ic_search_api_holo_light.png
rename to content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-mdpi/ic_search_api_holo_light.png
Binary files differ
diff --git a/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-xhdpi/ic_launcher.png b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..5d07b3f
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-xhdpi/ic_search_api_holo_light.png b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-xhdpi/ic_search_api_holo_light.png
similarity index 100%
rename from content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-xhdpi/ic_search_api_holo_light.png
rename to content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-xhdpi/ic_search_api_holo_light.png
Binary files differ
diff --git a/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-xxhdpi/ic_launcher.png b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..6ef21e1
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/layout/activity_main.xml b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/layout/sample_main.xml
similarity index 100%
rename from content/contacts/BasicContactables/BasicContactables/src/main/res/layout/activity_main.xml
rename to content/contacts/BasicContactables/BasicContactablesSample/src/main/res/layout/sample_main.xml
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/menu/main.xml b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/menu/main.xml
similarity index 100%
rename from content/contacts/BasicContactables/BasicContactables/src/main/res/menu/main.xml
rename to content/contacts/BasicContactables/BasicContactablesSample/src/main/res/menu/main.xml
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/values-v11/styles.xml b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/values/strings.xml
old mode 100644
new mode 100755
similarity index 85%
rename from content/contacts/BasicContactables/BasicContactables/src/main/res/values-v11/styles.xml
rename to content/contacts/BasicContactables/BasicContactablesSample/src/main/res/values/strings.xml
index 2ba754c..a499fd2
--- a/content/contacts/BasicContactables/BasicContactables/src/main/res/values-v11/styles.xml
+++ b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/values/strings.xml
@@ -16,5 +16,6 @@
   -->
 
 <resources>
-    <style name="Theme.Base" parent="android:Theme.Holo.Light" />
+    <string name="sample_action">Sample action</string>
+    <string name="search_title">Search Contacts</string>
 </resources>
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/values/styles.xml b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/values/styles.xml
similarity index 84%
rename from content/contacts/BasicContactables/BasicContactables/src/main/res/values/styles.xml
rename to content/contacts/BasicContactables/BasicContactablesSample/src/main/res/values/styles.xml
index 1c0e5aa..c3a400d 100644
--- a/content/contacts/BasicContactables/BasicContactables/src/main/res/values/styles.xml
+++ b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/values/styles.xml
@@ -16,17 +16,8 @@
   -->
 
 <resources>
-
-    <!-- Activity themes -->
-
-    <style name="Theme.Base" parent="android:Theme.Light" />
-
-    <style name="Theme.Sample" parent="Theme.Base" />
-
     <!-- Widget styling -->
 
-    <style name="Widget" />
-
     <style name="Widget.SampleOutput">
         <item name="android:padding">@dimen/margin_medium</item>
         <item name="android:textAppearance">?android:textAppearanceMedium</item>
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/xml/searchable.xml b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/xml/searchable.xml
similarity index 100%
rename from content/contacts/BasicContactables/BasicContactables/src/main/res/xml/searchable.xml
rename to content/contacts/BasicContactables/BasicContactablesSample/src/main/res/xml/searchable.xml
diff --git a/content/contacts/BasicContactables/BasicContactablesSample/tests/AndroidManifest.xml b/content/contacts/BasicContactables/BasicContactablesSample/tests/AndroidManifest.xml
new file mode 100644
index 0000000..87b785f
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactablesSample/tests/AndroidManifest.xml
@@ -0,0 +1,42 @@
+<?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.
+  -->
+<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+          package="${sample.package}.tests"
+          android:versionCode="1"
+          android:versionName="1.0">
+
+    <uses-sdk
+            android:minSdkVersion="18"
+            android:targetSdkVersion="19" />
+
+    <!-- We add an application tag here just so that we can indicate that
+         this package needs to link against the android.test library,
+         which is needed when building test cases. -->
+    <application>
+        <uses-library android:name="android.test.runner" />
+    </application>
+
+    <!--
+    Specifies the instrumentation test runner used to run the tests.
+    -->
+    <instrumentation
+            android:name="android.test.InstrumentationTestRunner"
+            android:targetPackage="${sample.package}"
+            android:label="Tests for ${sample.package}" />
+
+</manifest>
\ No newline at end of file
diff --git a/content/contacts/BasicContactables/BasicContactablesSample/tests/src/com/example/android/basiccontactables/tests/SampleTests.java b/content/contacts/BasicContactables/BasicContactablesSample/tests/src/com/example/android/basiccontactables/tests/SampleTests.java
new file mode 100644
index 0000000..dd48bf2
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactablesSample/tests/src/com/example/android/basiccontactables/tests/SampleTests.java
@@ -0,0 +1,79 @@
+/*
+* 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.
+*/
+
+
+
+/*
+* 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.
+*/
+package com.example.android.basiccontactables.tests;
+
+import com.example.android.basiccontactables.*;
+
+import android.test.ActivityInstrumentationTestCase2;
+
+/**
+* Tests for BasicContactables sample.
+*/
+public class SampleTests extends ActivityInstrumentationTestCase2<MainActivity> {
+
+    private MainActivity mTestActivity;
+    private BasicContactablesFragment mTestFragment;
+
+    public SampleTests() {
+        super(MainActivity.class);
+    }
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        // Starts the activity under test using the default Intent with:
+        // action = {@link Intent#ACTION_MAIN}
+        // flags = {@link Intent#FLAG_ACTIVITY_NEW_TASK}
+        // All other fields are null or empty.
+        mTestActivity = getActivity();
+        mTestFragment = (BasicContactablesFragment)
+            mTestActivity.getSupportFragmentManager().getFragments().get(1);
+    }
+
+    /**
+    * Test if the test fixture has been set up correctly.
+    */
+    public void testPreconditions() {
+        //Try to add a message to add context to your assertions. These messages will be shown if
+        //a tests fails and make it easy to understand why a test failed
+        assertNotNull("mTestActivity is null", mTestActivity);
+        assertNotNull("mTestFragment is null", mTestFragment);
+    }
+
+    /**
+    * Add more tests below.
+    */
+
+}
\ No newline at end of file
diff --git a/content/contacts/BasicContactables/README.txt b/content/contacts/BasicContactables/README.txt
deleted file mode 100644
index 38608df..0000000
--- a/content/contacts/BasicContactables/README.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Build Instructions
--------------------
-This sample uses the Gradle build system. To build this project, use the
-"gradlew build" command.
-
-To see a list of all available commands, run "gradlew tasks".
\ No newline at end of file
diff --git a/content/contacts/BasicContactables/_index.jd b/content/contacts/BasicContactables/_index.jd
new file mode 100644
index 0000000..3bab7ea
--- /dev/null
+++ b/content/contacts/BasicContactables/_index.jd
@@ -0,0 +1,11 @@
+page.tags="BasicContactables"
+sample.group=NoGroup
+@jd:body
+
+<p>
+            
+    Welcome to Basic Contactables Query sample!\n\n
+    Use the search box to enter a term, and find matching contacts in
+    Android\'s contact database!
+
+</p>
diff --git a/content/contacts/BasicContactables/build.gradle b/content/contacts/BasicContactables/build.gradle
index 036abc8..ffb5c2f 100644
--- a/content/contacts/BasicContactables/build.gradle
+++ b/content/contacts/BasicContactables/build.gradle
@@ -1,8 +1,11 @@
-buildscript {
-    repositories {
-        mavenCentral()
-    }
-    dependencies {
-        classpath 'com.android.tools.build:gradle:0.5.+'
-    }
+
+
+
+
+// BEGIN_EXCLUDE
+apply from: "../../../../../build/build.gradle"
+samplegen {
+  pathToBuild "../../../../../build"
+  pathToSamplesCommon "../../../common"
 }
+// END_EXCLUDE
diff --git a/content/contacts/BasicContactables/buildSrc/build.gradle b/content/contacts/BasicContactables/buildSrc/build.gradle
new file mode 100644
index 0000000..e344a8c
--- /dev/null
+++ b/content/contacts/BasicContactables/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/content/contacts/BasicContactables/gradle/wrapper/gradle-wrapper.properties b/content/contacts/BasicContactables/gradle/wrapper/gradle-wrapper.properties
index 055ba6f..861eddc 100644
--- a/content/contacts/BasicContactables/gradle/wrapper/gradle-wrapper.properties
+++ b/content/contacts/BasicContactables/gradle/wrapper/gradle-wrapper.properties
@@ -1,7 +1,6 @@
-#
-#Mon Jul 22 11:40:20 PDT 2013
+#Wed Apr 10 15:27:10 PDT 2013
 distributionBase=GRADLE_USER_HOME
 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/content/contacts/BasicContactables/settings.gradle b/content/contacts/BasicContactables/settings.gradle
index 111067c..5fec49c 100644
--- a/content/contacts/BasicContactables/settings.gradle
+++ b/content/contacts/BasicContactables/settings.gradle
@@ -1 +1,4 @@
-include ':BasicContactables'
+
+
+
+include 'BasicContactablesSample'
diff --git a/content/contacts/BasicContactables/template-params.xml b/content/contacts/BasicContactables/template-params.xml
new file mode 100644
index 0000000..c3e0ce0
--- /dev/null
+++ b/content/contacts/BasicContactables/template-params.xml
@@ -0,0 +1,44 @@
+<?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>BasicContactables</name>
+    <group>NoGroup</group>
+    <package>com.example.android.basiccontactables</package>
+
+
+
+    <!-- change minSdk if needed-->
+    <minSdk>18</minSdk>
+
+
+    <strings>
+        <intro>
+            <![CDATA[
+            This sample demonstrates how to use the Contactables table to search for contacts.
+            \n\nQuery strings sent to the Contactables table will match both contact names and phone numbers,
+            reducing the number of queries your application needs to use when searching the contacts database!
+            ]]>
+        </intro>
+    </strings>
+
+    <template src="base"/>
+    <common src="logger"/>
+
+</sample>