Initial commit, searching contacts using Contactables table sample

Change-Id: I27975d456a2765c0cfa73b1ad5d877158d04b028
(cherry picked from commit 33f968fb3faacac202d0004529afb37bf3cc8816)
diff --git a/content/contacts/BasicContactables/BasicContactables/build.gradle b/content/contacts/BasicContactables/BasicContactables/build.gradle
new file mode 100644
index 0000000..d4023a9
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactables/build.gradle
@@ -0,0 +1,23 @@
+buildscript {
+    repositories {
+        mavenCentral()
+    }
+    dependencies {
+        classpath 'com.android.tools.build:gradle:0.4'
+    }
+}
+apply plugin: 'android'
+
+dependencies {
+    compile files('libs/android-support-v4.jar')
+}
+
+android {
+    compileSdkVersion 18
+    buildToolsVersion "17.0.0"
+
+    defaultConfig {
+        minSdkVersion 18
+        targetSdkVersion 18
+    }
+}
diff --git a/content/contacts/BasicContactables/BasicContactables/libs/android-support-v4.jar b/content/contacts/BasicContactables/BasicContactables/libs/android-support-v4.jar
new file mode 100644
index 0000000..428bdbc
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactables/libs/android-support-v4.jar
Binary files differ
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/AndroidManifest.xml b/content/contacts/BasicContactables/BasicContactables/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..b008e84
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactables/src/main/AndroidManifest.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<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) -->
+    <uses-sdk
+        android:minSdkVersion="18"
+        android:targetSdkVersion="18" />
+    <permission android:name="android"></permission>
+
+    <application
+        android:allowBackup="true"
+        android:icon="@drawable/ic_launcher"
+        android:label="@string/app_name"
+        android:theme="@style/Theme.Sample" >
+        <activity
+            android:name="com.example.android.basiccontactables.MainActivity"
+            android:label="@string/app_name"
+            android:launchMode="singleTop">
+            <meta-data 
+                android:name="android.app.searchable"
+                android:resource="@xml/searchable" />
+            <intent-filter>
+                <action android:name="android.intent.action.SEARCH" />
+            </intent-filter>
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+    </application>
+</manifest>
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/java/com/example/android/basiccontactables/ContactablesLoaderCallbacks.java b/content/contacts/BasicContactables/BasicContactables/src/main/java/com/example/android/basiccontactables/ContactablesLoaderCallbacks.java
new file mode 100644
index 0000000..e2fcf3d
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactables/src/main/java/com/example/android/basiccontactables/ContactablesLoaderCallbacks.java
@@ -0,0 +1,135 @@
+/*
+ * Copyright (C) 2012 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;
+
+import android.app.Activity;
+import android.app.LoaderManager;
+import android.content.Context;
+import android.content.CursorLoader;
+import android.content.Loader;
+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;
+
+/**
+ * Helper class to handle all the callbacks that occur when interacting with loaders.  Most of the
+ * interesting code in this sample app will be in this file.
+ */
+public class ContactablesLoaderCallbacks implements LoaderManager.LoaderCallbacks<Cursor> {
+
+    Context mContext;
+
+    public static final String QUERY_KEY = "query";
+
+    public static final String TAG = "ContactablesLoaderCallbacks";
+
+    public ContactablesLoaderCallbacks(Context context) {
+        mContext = context;
+    }
+
+    @Override
+    public Loader<Cursor> onCreateLoader(int loaderIndex, Bundle args) {
+        // Where the Contactables table excels is matching text queries,
+        // not just data dumps from Contacts db.  One search term is used to query
+        // display name, email address and phone number.  In this case, the query was extracted
+        // from an incoming intent in the handleIntent() method, via the
+        // intent.getStringExtra() method.
+
+        // BEGIN_INCLUDE(uri_with_query)
+        String query = args.getString(QUERY_KEY);
+        Uri uri = Uri.withAppendedPath(ContactsContract.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;
+
+        // Sort results such that rows for the same contact stay together.
+        String sortBy = ContactsContract.CommonDataKinds.Contactables.LOOKUP_KEY;
+
+        return new CursorLoader(
+                mContext,  // Context
+                uri,       // URI representing the table/resource to be queried
+                null,      // projection - the list of columns to return.  Null means "all"
+                selection, // selection - Which rows to return (condition rows must match)
+                null,      // selection args - can be provided separately and subbed into selection.
+                sortBy);   // string specifying sort order
+        // END_INCLUDE(cursor_loader)
+    }
+
+    @Override
+    public void onLoadFinished(Loader<Cursor> arg0, Cursor cursor) {
+        TextView tv  = (TextView) ((Activity)mContext).findViewById(R.id.sample_output);
+
+        // Reset text in case of a previous query
+        tv.setText(mContext.getText(R.string.intro_message) + "\n\n");
+
+        if (cursor.getCount() == 0) {
+            return;
+        }
+
+        // Pulling the relevant value from the cursor requires knowing the column index to pull
+        // it from.
+        // BEGIN_INCLUDE(get_columns)
+        int phoneColumnIndex = cursor.getColumnIndex(CommonDataKinds.Phone.NUMBER);
+        int emailColumnIndex = cursor.getColumnIndex(CommonDataKinds.Email.ADDRESS);
+        int nameColumnIndex = cursor.getColumnIndex(CommonDataKinds.Contactables.DISPLAY_NAME);
+        int lookupColumnIndex = cursor.getColumnIndex(CommonDataKinds.Contactables.LOOKUP_KEY);
+        int typeColumnIndex = cursor.getColumnIndex(CommonDataKinds.Contactables.MIMETYPE);
+        // END_INCLUDE(get_columns)
+
+        cursor.moveToFirst();
+        // Lookup key is the easiest way to verify a row of data is for the same
+        // contact as the previous row.
+        String lookupKey = "";
+        do {
+            // BEGIN_INCLUDE(lookup_key)
+            String currentLookupKey = cursor.getString(lookupColumnIndex);
+            if (!lookupKey.equals(currentLookupKey)) {
+                String displayName = cursor.getString(nameColumnIndex);
+                tv.append(displayName + "\n");
+                lookupKey = currentLookupKey;
+            }
+            // END_INCLUDE(lookup_key)
+
+            // 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)) {
+                tv.append("\tPhone Number: " + cursor.getString(phoneColumnIndex) + "\n");
+            } else if (mimeType.equals(ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE)) {
+                tv.append("\tEmail Address: " + cursor.getString(emailColumnIndex) + "\n");
+            }
+            // END_INCLUDE(retrieve_data)
+
+            // Look at DDMS to see all the columns returned by a query to Contactables.
+            // Behold, the firehose!
+            for(String column : cursor.getColumnNames()) {
+                Log.d(TAG, column + column + ": " +
+                        cursor.getString(cursor.getColumnIndex(column)) + "\n");
+            }
+        } while (cursor.moveToNext());
+    }
+
+    @Override
+    public void onLoaderReset(Loader<Cursor> cursorLoader) {
+    }
+}
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/java/com/example/android/basiccontactables/MainActivity.java b/content/contacts/BasicContactables/BasicContactables/src/main/java/com/example/android/basiccontactables/MainActivity.java
new file mode 100644
index 0000000..9448ada
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactables/src/main/java/com/example/android/basiccontactables/MainActivity.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2012 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;
+
+import android.app.Activity;
+import android.app.SearchManager;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.Menu;
+import android.widget.SearchView;
+
+/**
+ * Simple one-activity app that takes a search term via the Action Bar
+ * and uses it as a query to search the contacts database via the Contactables
+ * table.
+ */
+public class MainActivity extends Activity {
+
+    public static final int CONTACT_QUERY_LOADER = 0;
+    public static final String QUERY_KEY = "query";
+
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_main);
+
+        if (getIntent() != null) {
+            handleIntent(getIntent());
+        }
+    }
+
+    @Override
+    protected void onNewIntent(Intent intent) {
+        handleIntent(intent);
+    }
+
+    /**
+     * Assuming this activity was started with a new intent, process the incoming information and
+     * react accordingly.
+     * @param intent
+     */
+    private void handleIntent(Intent intent) {
+        // Special processing of the incoming intent only occurs if the if the action specified
+        // by the intent is ACTION_SEARCH.
+        if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
+            // SearchManager.QUERY is the key that a SearchManager will use to send a query string
+            // to an Activity.
+            String query = intent.getStringExtra(SearchManager.QUERY);
+
+            // We need to create a bundle containing the query string to send along to the
+            // LoaderManager, which will be handling querying the database and returning results.
+            Bundle bundle = new Bundle();
+            bundle.putString(QUERY_KEY, query);
+
+            ContactablesLoaderCallbacks loaderCallbacks = new ContactablesLoaderCallbacks(this);
+
+            // Start the loader with the new query, and an object that will handle all callbacks.
+            getLoaderManager().restartLoader(CONTACT_QUERY_LOADER, bundle, loaderCallbacks);
+        }
+    }
+
+    @Override
+    public boolean onCreateOptionsMenu(Menu menu) {
+        // Inflate the menu; this adds items to the action bar if it is present.
+        getMenuInflater().inflate(R.menu.main, menu);
+
+        // Associate searchable configuration with the SearchView
+        SearchManager searchManager =
+                (SearchManager) getSystemService(Context.SEARCH_SERVICE);
+        SearchView searchView =
+                (SearchView) menu.findItem(R.id.search).getActionView();
+        searchView.setSearchableInfo(
+                searchManager.getSearchableInfo(getComponentName()));
+
+        return true;
+    }
+}
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
new file mode 100755
index 0000000..22ce606
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactables/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/BasicContactables/src/main/res/drawable-hdpi/ic_search_api_holo_light.png
new file mode 100644
index 0000000..72e207b
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-hdpi/ic_search_api_holo_light.png
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
new file mode 100755
index 0000000..f21e17b
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactables/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/BasicContactables/src/main/res/drawable-mdpi/ic_search_api_holo_light.png
new file mode 100644
index 0000000..f2e26f8
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-mdpi/ic_search_api_holo_light.png
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
new file mode 100755
index 0000000..64b8059
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactables/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/BasicContactables/src/main/res/drawable-xhdpi/ic_search_api_holo_light.png
new file mode 100644
index 0000000..a4cdf1c
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-xhdpi/ic_search_api_holo_light.png
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
new file mode 100755
index 0000000..6b4434a
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactables/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/BasicContactables/src/main/res/layout/activity_main.xml
new file mode 100755
index 0000000..52dc311
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactables/src/main/res/layout/activity_main.xml
@@ -0,0 +1,28 @@
+<?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.
+  -->
+
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <TextView android:id="@+id/sample_output"
+        style="@style/Widget.SampleOutput"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text="@string/intro_message" />
+
+</ScrollView>
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/menu/main.xml b/content/contacts/BasicContactables/BasicContactables/src/main/res/menu/main.xml
new file mode 100644
index 0000000..4a530f1
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactables/src/main/res/menu/main.xml
@@ -0,0 +1,24 @@
+<?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.
+  -->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:id="@+id/search"
+          android:title="@string/search_title"
+          android:icon="@drawable/ic_search_api_holo_light"
+          android:showAsAction="collapseActionView|ifRoom"
+          android:actionViewClass="android.widget.SearchView" />
+</menu>
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
new file mode 100644
index 0000000..886b05f
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactables/src/main/res/values-sw600dp/dimens.xml
@@ -0,0 +1,4 @@
+<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
new file mode 100644
index 0000000..2bbb45f
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactables/src/main/res/values-sw600dp/styles.xml
@@ -0,0 +1,29 @@
+<?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
new file mode 100644
index 0000000..00059fc
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactables/src/main/res/values-sw720dp-land/dimens.xml
@@ -0,0 +1,5 @@
+<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-v11/styles.xml b/content/contacts/BasicContactables/BasicContactables/src/main/res/values-v11/styles.xml
new file mode 100644
index 0000000..2ba754c
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactables/src/main/res/values-v11/styles.xml
@@ -0,0 +1,20 @@
+<?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="Theme.Base" parent="android:Theme.Holo.Light" />
+</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
new file mode 100644
index 0000000..a83b995
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactables/src/main/res/values/dimens.xml
@@ -0,0 +1,28 @@
+<?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
new file mode 100755
index 0000000..31ceceb
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactables/src/main/res/values/strings.xml
@@ -0,0 +1,26 @@
+<?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/BasicContactables/src/main/res/values/styles.xml b/content/contacts/BasicContactables/BasicContactables/src/main/res/values/styles.xml
new file mode 100644
index 0000000..1c0e5aa
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactables/src/main/res/values/styles.xml
@@ -0,0 +1,36 @@
+<?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>
+
+    <!-- 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>
+        <item name="android:lineSpacingMultiplier">1.1</item>
+    </style>
+
+</resources>
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/xml/searchable.xml b/content/contacts/BasicContactables/BasicContactables/src/main/res/xml/searchable.xml
new file mode 100644
index 0000000..32fe1cc
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactables/src/main/res/xml/searchable.xml
@@ -0,0 +1,20 @@
+<?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.
+  -->
+  
+<searchable xmlns:android="http://schemas.android.com/apk/res/android"
+        android:label="@string/app_name"
+        android:hint="@string/search_title" />
diff --git a/content/contacts/BasicContactables/build.gradle b/content/contacts/BasicContactables/build.gradle
new file mode 100644
index 0000000..495c503
--- /dev/null
+++ b/content/contacts/BasicContactables/build.gradle
@@ -0,0 +1 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.