added android application skeleton. Necessary because of gerrit commit size constraints

Change-Id: I8d125414c11418a78a2d3d36700822a4fe026fa6
diff --git a/permissions/README.md b/permissions/README.md
new file mode 100644
index 0000000..33f3729
--- /dev/null
+++ b/permissions/README.md
@@ -0,0 +1,6 @@
+# permission
+
+#Setup
+This application requires firebase. Set it up by following these instructions (https://firebase.google.com/docs/android/setup)
+1. add application package to a project in the firebase console (https://firebase.corp.google.com/)
+2. add the generated google-services.json to the /app folder.
diff --git a/permissions/app/.gitignore b/permissions/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/permissions/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/permissions/app/build.gradle b/permissions/app/build.gradle
new file mode 100644
index 0000000..97a1af4
--- /dev/null
+++ b/permissions/app/build.gradle
@@ -0,0 +1,38 @@
+apply plugin: 'com.android.application'
+
+android {
+    compileSdkVersion 23
+    buildToolsVersion "23.0.3"
+
+    defaultConfig {
+        applicationId "examples.baku.io.permissions"
+        minSdkVersion 22
+        targetSdkVersion 23
+        versionCode 1
+        versionName "1.0"
+    }
+    buildTypes {
+        release {
+            minifyEnabled false
+            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+        }
+    }
+}
+
+dependencies {
+    compile fileTree(include: ['*.jar'], dir: 'libs')
+    testCompile 'junit:junit:4.12'
+    compile 'com.android.support:appcompat-v7:23.4.0'
+    compile 'com.android.support:design:23.4.0'
+    compile 'com.android.support:cardview-v7:23.4.0'
+    compile 'com.google.firebase:firebase-database:9.0.2'
+    compile 'com.google.firebase:firebase-messaging:9.0.2'
+    compile 'com.google.code.gson:gson:2.6.2'
+    compile 'com.android.support:support-v4:23.4.0'
+    compile 'com.android.support:recyclerview-v7:23.4.0'
+    compile 'com.google.guava:guava:19.0'
+    compile 'org.bitbucket.cowwoc.diff-match-patch:diff-match-patch:1.0'
+}
+
+
+apply plugin: 'com.google.gms.google-services'
\ No newline at end of file
diff --git a/permissions/app/src/main/AndroidManifest.xml b/permissions/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..5eda784
--- /dev/null
+++ b/permissions/app/src/main/AndroidManifest.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="examples.baku.io.permissions">
+
+    <uses-permission android:name="android.permission.VIBRATE" />
+
+    <application
+        android:allowBackup="true"
+        android:icon="@mipmap/ic_launcher"
+        android:label="@string/app_name"
+        android:supportsRtl="true"
+        android:theme="@style/AppTheme">
+        <activity
+            android:name=".examples.EmailActivity"
+            android:label="@string/app_name"
+            android:theme="@style/AppTheme.NoActionBar">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+
+        <service
+            android:name=".PermissionService"
+            android:enabled="true"
+            android:exported="true" />
+
+        <activity
+            android:name=".examples.ComposeActivity"
+            android:label="@string/title_activity_compose"
+            android:theme="@style/AppTheme.NoActionBar" />
+        <activity
+            android:name=".discovery.DevicePickerActivity"
+            android:label="Device Picker"
+            android:theme="@style/Theme.AppCompat.Light.Dialog"></activity>
+    </application>
+
+</manifest>
\ No newline at end of file
diff --git a/permissions/app/src/main/res/drawable-hdpi/ic_cast_black_24dp.png b/permissions/app/src/main/res/drawable-hdpi/ic_cast_black_24dp.png
new file mode 100644
index 0000000..a35e1c6
--- /dev/null
+++ b/permissions/app/src/main/res/drawable-hdpi/ic_cast_black_24dp.png
Binary files differ
diff --git a/permissions/app/src/main/res/drawable-hdpi/ic_cast_connected_black_24dp.png b/permissions/app/src/main/res/drawable-hdpi/ic_cast_connected_black_24dp.png
new file mode 100644
index 0000000..638cb90
--- /dev/null
+++ b/permissions/app/src/main/res/drawable-hdpi/ic_cast_connected_black_24dp.png
Binary files differ
diff --git a/permissions/app/src/main/res/drawable-hdpi/ic_cast_connected_white_24dp.png b/permissions/app/src/main/res/drawable-hdpi/ic_cast_connected_white_24dp.png
new file mode 100644
index 0000000..1caa6c3
--- /dev/null
+++ b/permissions/app/src/main/res/drawable-hdpi/ic_cast_connected_white_24dp.png
Binary files differ
diff --git a/permissions/app/src/main/res/drawable-hdpi/ic_cast_white_24dp.png b/permissions/app/src/main/res/drawable-hdpi/ic_cast_white_24dp.png
new file mode 100644
index 0000000..60d3915
--- /dev/null
+++ b/permissions/app/src/main/res/drawable-hdpi/ic_cast_white_24dp.png
Binary files differ
diff --git a/permissions/app/src/main/res/drawable-hdpi/ic_check_black_24dp.png b/permissions/app/src/main/res/drawable-hdpi/ic_check_black_24dp.png
new file mode 100644
index 0000000..e802d90
--- /dev/null
+++ b/permissions/app/src/main/res/drawable-hdpi/ic_check_black_24dp.png
Binary files differ
diff --git a/permissions/app/src/main/res/drawable-hdpi/ic_close_black_24dp.png b/permissions/app/src/main/res/drawable-hdpi/ic_close_black_24dp.png
new file mode 100644
index 0000000..1a9cd75
--- /dev/null
+++ b/permissions/app/src/main/res/drawable-hdpi/ic_close_black_24dp.png
Binary files differ
diff --git a/permissions/app/src/main/res/drawable-hdpi/ic_desktop_windows_black_24dp.png b/permissions/app/src/main/res/drawable-hdpi/ic_desktop_windows_black_24dp.png
new file mode 100644
index 0000000..73172be
--- /dev/null
+++ b/permissions/app/src/main/res/drawable-hdpi/ic_desktop_windows_black_24dp.png
Binary files differ
diff --git a/permissions/app/src/main/res/drawable-hdpi/ic_email_black_24dp.png b/permissions/app/src/main/res/drawable-hdpi/ic_email_black_24dp.png
new file mode 100644
index 0000000..36c6311
--- /dev/null
+++ b/permissions/app/src/main/res/drawable-hdpi/ic_email_black_24dp.png
Binary files differ
diff --git a/permissions/app/src/main/res/drawable-hdpi/ic_mail_outline_black_24dp.png b/permissions/app/src/main/res/drawable-hdpi/ic_mail_outline_black_24dp.png
new file mode 100644
index 0000000..de495c5
--- /dev/null
+++ b/permissions/app/src/main/res/drawable-hdpi/ic_mail_outline_black_24dp.png
Binary files differ
diff --git a/permissions/app/src/main/res/drawable-hdpi/ic_phone_android_black_24dp.png b/permissions/app/src/main/res/drawable-hdpi/ic_phone_android_black_24dp.png
new file mode 100644
index 0000000..4d458e9
--- /dev/null
+++ b/permissions/app/src/main/res/drawable-hdpi/ic_phone_android_black_24dp.png
Binary files differ
diff --git a/permissions/app/src/main/res/drawable-hdpi/ic_share_black_24dp.png b/permissions/app/src/main/res/drawable-hdpi/ic_share_black_24dp.png
new file mode 100644
index 0000000..20ba480
--- /dev/null
+++ b/permissions/app/src/main/res/drawable-hdpi/ic_share_black_24dp.png
Binary files differ
diff --git a/permissions/app/src/main/res/drawable-hdpi/ic_share_white_24dp.png b/permissions/app/src/main/res/drawable-hdpi/ic_share_white_24dp.png
new file mode 100644
index 0000000..b09a692
--- /dev/null
+++ b/permissions/app/src/main/res/drawable-hdpi/ic_share_white_24dp.png
Binary files differ
diff --git a/permissions/app/src/main/res/drawable-hdpi/ic_vpn_key_black_24dp.png b/permissions/app/src/main/res/drawable-hdpi/ic_vpn_key_black_24dp.png
new file mode 100644
index 0000000..e05e76f
--- /dev/null
+++ b/permissions/app/src/main/res/drawable-hdpi/ic_vpn_key_black_24dp.png
Binary files differ
diff --git a/permissions/app/src/main/res/drawable-hdpi/ic_zoom_in_black_24dp.png b/permissions/app/src/main/res/drawable-hdpi/ic_zoom_in_black_24dp.png
new file mode 100644
index 0000000..bed9c9c
--- /dev/null
+++ b/permissions/app/src/main/res/drawable-hdpi/ic_zoom_in_black_24dp.png
Binary files differ
diff --git a/permissions/app/src/main/res/layout/activity_compose.xml b/permissions/app/src/main/res/layout/activity_compose.xml
new file mode 100644
index 0000000..cb54669
--- /dev/null
+++ b/permissions/app/src/main/res/layout/activity_compose.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:fitsSystemWindows="true"
+    tools:context=".examples.ComposeActivity">
+
+    <android.support.design.widget.AppBarLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:theme="@style/AppTheme.AppBarOverlay">
+
+        <android.support.v7.widget.Toolbar
+            android:id="@+id/toolbar"
+            android:layout_width="match_parent"
+            android:layout_height="?attr/actionBarSize"
+            android:background="?attr/colorPrimary"
+            app:popupTheme="@style/AppTheme.PopupOverlay" />
+
+    </android.support.design.widget.AppBarLayout>
+
+    <include layout="@layout/content_compose" />
+
+    <android.support.design.widget.FloatingActionButton
+        android:id="@+id/fab"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="bottom|end"
+        android:layout_margin="@dimen/fab_margin"
+        android:src="@android:drawable/ic_menu_send" />
+
+</android.support.design.widget.CoordinatorLayout>
diff --git a/permissions/app/src/main/res/layout/activity_device_picker.xml b/permissions/app/src/main/res/layout/activity_device_picker.xml
new file mode 100644
index 0000000..50066fe
--- /dev/null
+++ b/permissions/app/src/main/res/layout/activity_device_picker.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:paddingBottom="@dimen/activity_vertical_margin"
+    android:paddingLeft="@dimen/activity_horizontal_margin"
+    android:paddingRight="@dimen/activity_horizontal_margin"
+    android:paddingTop="@dimen/activity_vertical_margin"
+    tools:context=".discovery.DevicePickerActivity">
+
+    <ImageButton
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:src="@drawable/common_google_signin_btn_icon_dark_focused"/>
+
+    <android.support.v7.widget.RecyclerView
+        android:id="@+id/deviceList"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+    </android.support.v7.widget.RecyclerView>
+
+</RelativeLayout>
diff --git a/permissions/app/src/main/res/layout/activity_permission.xml b/permissions/app/src/main/res/layout/activity_permission.xml
new file mode 100644
index 0000000..a8fdbb4
--- /dev/null
+++ b/permissions/app/src/main/res/layout/activity_permission.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:fitsSystemWindows="true"
+    tools:context=".examples.EmailActivity">
+
+    <android.support.design.widget.AppBarLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:theme="@style/AppTheme.AppBarOverlay">
+
+        <android.support.v7.widget.Toolbar
+            android:id="@+id/toolbar"
+            android:layout_width="match_parent"
+            android:layout_height="?attr/actionBarSize"
+            android:background="?attr/colorPrimary"
+            app:popupTheme="@style/AppTheme.PopupOverlay" />
+
+
+
+    </android.support.design.widget.AppBarLayout>
+
+    <include layout="@layout/inbox_list" />
+
+    <android.support.design.widget.FloatingActionButton
+        android:id="@+id/fab"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="bottom|end"
+        android:layout_margin="@dimen/fab_margin"
+        android:src="@android:drawable/ic_input_add" />
+
+</android.support.design.widget.CoordinatorLayout>
diff --git a/permissions/app/src/main/res/layout/activity_picker.xml b/permissions/app/src/main/res/layout/activity_picker.xml
new file mode 100644
index 0000000..993fc2c
--- /dev/null
+++ b/permissions/app/src/main/res/layout/activity_picker.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:fitsSystemWindows="true"
+    tools:context=".discovery.DevicePickerActivity">
+
+    <include layout="@layout/content_device_picker" />
+
+</android.support.design.widget.CoordinatorLayout>
diff --git a/permissions/app/src/main/res/layout/content_compose.xml b/permissions/app/src/main/res/layout/content_compose.xml
new file mode 100644
index 0000000..3e3f476
--- /dev/null
+++ b/permissions/app/src/main/res/layout/content_compose.xml
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:paddingBottom="@dimen/activity_vertical_margin"
+    android:paddingLeft="@dimen/activity_horizontal_margin"
+    android:paddingRight="@dimen/activity_horizontal_margin"
+    android:paddingTop="@dimen/activity_vertical_margin"
+    app:layout_behavior="@string/appbar_scrolling_view_behavior"
+    tools:context=".examples.ComposeActivity"
+    tools:showIn="@layout/activity_compose">
+
+
+    <android.support.design.widget.TextInputLayout
+        android:id="@+id/composeToLayout"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+
+        <EditText
+            android:id="@+id/composeTo"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:inputType="textEmailAddress"
+            android:hint="To" />
+    </android.support.design.widget.TextInputLayout>
+
+    <android.support.design.widget.TextInputLayout
+        android:id="@+id/composeFromLayout"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/composeToLayout">
+        <EditText
+            android:id="@+id/composeFrom"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:inputType="textEmailAddress"
+            android:hint="From" />
+    </android.support.design.widget.TextInputLayout>
+
+    <android.support.design.widget.TextInputLayout
+        android:id="@+id/composeSubjectLayout"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/composeFromLayout">
+
+        <EditText
+            android:id="@+id/composeSubject"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:inputType="textEmailSubject"
+            android:hint="Subject" />
+    </android.support.design.widget.TextInputLayout>
+
+    <android.support.design.widget.TextInputLayout
+        android:id="@+id/composeMessageLayout"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/composeSubjectLayout">
+
+        <EditText
+            android:id="@+id/composeMessage"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:inputType="textMultiLine"
+            android:hint="Message" />
+    </android.support.design.widget.TextInputLayout>
+
+
+
+</RelativeLayout>
diff --git a/permissions/app/src/main/res/layout/content_device_picker.xml b/permissions/app/src/main/res/layout/content_device_picker.xml
new file mode 100644
index 0000000..bb337c6
--- /dev/null
+++ b/permissions/app/src/main/res/layout/content_device_picker.xml
@@ -0,0 +1,9 @@
+<fragment xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:id="@+id/discoveryFragment"
+    android:name="examples.baku.io.permissions.discovery.DevicePickerActivityFragment"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    app:layout_behavior="@string/appbar_scrolling_view_behavior"
+    tools:layout="@layout/fragment_device_picker" />
diff --git a/permissions/app/src/main/res/layout/content_permission.xml b/permissions/app/src/main/res/layout/content_permission.xml
new file mode 100644
index 0000000..bb93916
--- /dev/null
+++ b/permissions/app/src/main/res/layout/content_permission.xml
@@ -0,0 +1,9 @@
+<fragment xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:id="@+id/contentFragment"
+    android:name="examples.baku.io.permissions.examples.InboxFragment"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    app:layout_behavior="@string/appbar_scrolling_view_behavior"
+    tools:layout="@layout/inbox_list" />
diff --git a/permissions/app/src/main/res/layout/device_card_item.xml b/permissions/app/src/main/res/layout/device_card_item.xml
new file mode 100644
index 0000000..624d931
--- /dev/null
+++ b/permissions/app/src/main/res/layout/device_card_item.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="80dp"
+    app:contentPadding="6dp"
+    app:cardUseCompatPadding="true">
+    <ImageView
+        android:id="@+id/card_leading"
+        android:layout_width="62dp"
+        android:layout_height="62dp"
+        android:src="@drawable/ic_phone_android_black_24dp"/>
+    <TextView
+        android:id="@+id/card_title"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:paddingLeft="74dp"
+        android:textSize="24sp"
+        android:textStyle="bold"
+        android:ellipsize="end"
+        android:maxLines="1"
+        android:text=""/>
+    <TextView
+        android:id="@+id/card_subtitle"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:paddingTop="34sp"
+        android:paddingLeft="74dp"
+        android:textSize="16sp"
+        android:textStyle="italic"
+        android:ellipsize="end"
+        android:maxLines="1"
+        android:text=""/>
+</android.support.v7.widget.CardView>
\ No newline at end of file
diff --git a/permissions/app/src/main/res/layout/fragment_device_picker.xml b/permissions/app/src/main/res/layout/fragment_device_picker.xml
new file mode 100644
index 0000000..403eac5
--- /dev/null
+++ b/permissions/app/src/main/res/layout/fragment_device_picker.xml
@@ -0,0 +1,19 @@
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:paddingBottom="@dimen/activity_vertical_margin"
+    android:paddingLeft="@dimen/activity_horizontal_margin"
+    android:paddingRight="@dimen/activity_horizontal_margin"
+    android:paddingTop="@dimen/activity_vertical_margin"
+    tools:context=".discovery.DevicePickerActivityFragment"
+    tools:showIn="@layout/activity_picker">
+
+
+    <android.support.v7.widget.RecyclerView
+        android:id="@+id/deviceRecyclerView"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+    </android.support.v7.widget.RecyclerView>
+
+</RelativeLayout>
diff --git a/permissions/app/src/main/res/layout/inbox_card_item.xml b/permissions/app/src/main/res/layout/inbox_card_item.xml
new file mode 100644
index 0000000..fefe348
--- /dev/null
+++ b/permissions/app/src/main/res/layout/inbox_card_item.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="80dp"
+    app:contentPadding="6dp"
+    app:cardUseCompatPadding="true">
+    <ImageView
+        android:id="@+id/card_leading"
+        android:layout_width="62dp"
+        android:layout_height="62dp"
+        android:src="@drawable/ic_mail_outline_black_24dp"/>
+    <TextView
+        android:id="@+id/card_title"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:paddingLeft="74dp"
+        android:textSize="24sp"
+        android:textStyle="bold"
+        android:ellipsize="end"
+        android:maxLines="1"
+        android:text=""/>
+    <TextView
+        android:id="@+id/card_subtitle"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:paddingTop="34sp"
+        android:paddingLeft="74dp"
+        android:textSize="16sp"
+        android:textStyle="italic"
+        android:ellipsize="end"
+        android:maxLines="1"
+        android:text=""/>
+    <ImageView
+        android:id="@+id/card_trailing"
+        android:layout_width="32dp"
+        android:layout_height="32dp"
+        android:layout_gravity="center_vertical|right"
+        android:src="@drawable/ic_cast_black_24dp"/>
+</android.support.v7.widget.CardView>
\ No newline at end of file
diff --git a/permissions/app/src/main/res/layout/inbox_list.xml b/permissions/app/src/main/res/layout/inbox_list.xml
new file mode 100644
index 0000000..a10261a
--- /dev/null
+++ b/permissions/app/src/main/res/layout/inbox_list.xml
@@ -0,0 +1,20 @@
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:paddingBottom="@dimen/activity_vertical_margin"
+    android:paddingLeft="@dimen/activity_horizontal_margin"
+    android:paddingRight="@dimen/activity_horizontal_margin"
+    android:paddingTop="@dimen/activity_vertical_margin"
+    app:layout_behavior="@string/appbar_scrolling_view_behavior"
+    tools:context=".examples.InboxFragment"
+    tools:showIn="@layout/activity_permission">
+
+    <android.support.v7.widget.RecyclerView
+        android:id="@+id/inboxRecyclerView"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+    </android.support.v7.widget.RecyclerView>
+
+</RelativeLayout>
diff --git a/permissions/app/src/main/res/menu/menu_compose.xml b/permissions/app/src/main/res/menu/menu_compose.xml
new file mode 100644
index 0000000..5072a89
--- /dev/null
+++ b/permissions/app/src/main/res/menu/menu_compose.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
+    <item
+        android:id="@+id/action_cast"
+        android:title="Cast Message"
+        android:orderInCategory="100"
+        android:icon="@drawable/ic_cast_white_24dp"
+        app:showAsAction="always" />
+    <item
+        android:id="@+id/action_delete"
+        android:title="Delete Message"
+        android:orderInCategory="100"
+        android:icon="@android:drawable/ic_delete"
+        app:showAsAction="never" />
+
+    <item
+        android:id="@+id/action_send"
+        android:title="Send Message"
+        android:orderInCategory="100"
+        android:icon="@android:drawable/ic_menu_send"
+        app:showAsAction="always" />
+</menu>
\ No newline at end of file
diff --git a/permissions/app/src/main/res/menu/menu_device_picker.xml b/permissions/app/src/main/res/menu/menu_device_picker.xml
new file mode 100644
index 0000000..c2e8acb
--- /dev/null
+++ b/permissions/app/src/main/res/menu/menu_device_picker.xml
@@ -0,0 +1,10 @@
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    tools:context=".discovery.DevicePickerActivity">
+    <item
+        android:id="@+id/action_settings"
+        android:orderInCategory="100"
+        android:title="@string/action_settings"
+        app:showAsAction="never" />
+</menu>
diff --git a/permissions/app/src/main/res/menu/menu_permission.xml b/permissions/app/src/main/res/menu/menu_permission.xml
new file mode 100644
index 0000000..bb2f19a
--- /dev/null
+++ b/permissions/app/src/main/res/menu/menu_permission.xml
@@ -0,0 +1,10 @@
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    tools:context=".examples.EmailActivity">
+    <item
+        android:id="@+id/action_settings"
+        android:orderInCategory="100"
+        android:title="@string/action_settings"
+        app:showAsAction="never" />
+</menu>
diff --git a/permissions/app/src/main/res/menu/menu_scrolling.xml b/permissions/app/src/main/res/menu/menu_scrolling.xml
new file mode 100644
index 0000000..be81d70
--- /dev/null
+++ b/permissions/app/src/main/res/menu/menu_scrolling.xml
@@ -0,0 +1,10 @@
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    tools:context=".ScrollingActivity">
+    <item
+        android:id="@+id/action_settings"
+        android:orderInCategory="100"
+        android:title="@string/action_settings"
+        app:showAsAction="never" />
+</menu>
diff --git a/permissions/app/src/main/res/mipmap-hdpi/ic_launcher.png b/permissions/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..d505d7c
--- /dev/null
+++ b/permissions/app/src/main/res/mipmap-hdpi/ic_launcher.png
Binary files differ
diff --git a/permissions/app/src/main/res/mipmap-mdpi/ic_launcher.png b/permissions/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..3183b44
--- /dev/null
+++ b/permissions/app/src/main/res/mipmap-mdpi/ic_launcher.png
Binary files differ
diff --git a/permissions/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/permissions/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..57551b8
--- /dev/null
+++ b/permissions/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Binary files differ
diff --git a/permissions/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/permissions/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..5fc1de9
--- /dev/null
+++ b/permissions/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/permissions/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/permissions/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..62fea37
--- /dev/null
+++ b/permissions/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Binary files differ
diff --git a/permissions/app/src/main/res/values-v21/styles.xml b/permissions/app/src/main/res/values-v21/styles.xml
new file mode 100644
index 0000000..dbbdd40
--- /dev/null
+++ b/permissions/app/src/main/res/values-v21/styles.xml
@@ -0,0 +1,9 @@
+<resources>
+
+    <style name="AppTheme.NoActionBar">
+        <item name="windowActionBar">false</item>
+        <item name="windowNoTitle">true</item>
+        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
+        <item name="android:statusBarColor">@android:color/transparent</item>
+    </style>
+</resources>
diff --git a/permissions/app/src/main/res/values-w820dp/dimens.xml b/permissions/app/src/main/res/values-w820dp/dimens.xml
new file mode 100644
index 0000000..63fc816
--- /dev/null
+++ b/permissions/app/src/main/res/values-w820dp/dimens.xml
@@ -0,0 +1,6 @@
+<resources>
+    <!-- Example customization of dimensions originally defined in res/values/dimens.xml
+         (such as screen margins) for screens with more than 820dp of available width. This
+         would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
+    <dimen name="activity_horizontal_margin">64dp</dimen>
+</resources>
diff --git a/permissions/app/src/main/res/values/colors.xml b/permissions/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..3ab3e9c
--- /dev/null
+++ b/permissions/app/src/main/res/values/colors.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <color name="colorPrimary">#3F51B5</color>
+    <color name="colorPrimaryDark">#303F9F</color>
+    <color name="colorAccent">#FF4081</color>
+</resources>
diff --git a/permissions/app/src/main/res/values/dimens.xml b/permissions/app/src/main/res/values/dimens.xml
new file mode 100644
index 0000000..e16ed14
--- /dev/null
+++ b/permissions/app/src/main/res/values/dimens.xml
@@ -0,0 +1,10 @@
+<resources>
+    <!-- Default screen margins, per the Android Design guidelines. -->
+    <dimen name="activity_horizontal_margin">16dp</dimen>
+    <dimen name="activity_vertical_margin">16dp</dimen>
+    <dimen name="fab_margin">16dp</dimen>
+    <dimen name="app_bar_height">180dp</dimen>
+    <dimen name="text_margin">16dp</dimen>
+    <dimen name="item_width">200dp</dimen>
+    <dimen name="appbar_padding_top">8dp</dimen>
+</resources>
diff --git a/permissions/app/src/main/res/values/strings.xml b/permissions/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..e87f4c9
--- /dev/null
+++ b/permissions/app/src/main/res/values/strings.xml
@@ -0,0 +1,100 @@
+<resources>
+    <string name="app_name">Permissions</string>
+    <string name="action_settings">Settings</string>
+    <string name="title_activity_scrolling">ScrollingActivity</string>
+    <string name="large_text">
+        "Material is the metaphor.\n\n"
+
+        "A material metaphor is the unifying theory of a rationalized space and a system of motion."
+        "The material is grounded in tactile reality, inspired by the study of paper and ink, yet "
+        "technologically advanced and open to imagination and magic.\n"
+        "Surfaces and edges of the material provide visual cues that are grounded in reality. The "
+        "use of familiar tactile attributes helps users quickly understand affordances. Yet the "
+        "flexibility of the material creates new affordances that supercede those in the physical "
+        "world, without breaking the rules of physics.\n"
+        "The fundamentals of light, surface, and movement are key to conveying how objects move, "
+        "interact, and exist in space and in relation to each other. Realistic lighting shows "
+        "seams, divides space, and indicates moving parts.\n\n"
+
+        "Bold, graphic, intentional.\n\n"
+
+        "The foundational elements of print based design typography, grids, space, scale, color, "
+        "and use of imagery guide visual treatments. These elements do far more than please the "
+        "eye. They create hierarchy, meaning, and focus. Deliberate color choices, edge to edge "
+        "imagery, large scale typography, and intentional white space create a bold and graphic "
+        "interface that immerse the user in the experience.\n"
+        "An emphasis on user actions makes core functionality immediately apparent and provides "
+        "waypoints for the user.\n\n"
+
+        "Motion provides meaning.\n\n"
+
+        "Motion respects and reinforces the user as the prime mover. Primary user actions are "
+        "inflection points that initiate motion, transforming the whole design.\n"
+        "All action takes place in a single environment. Objects are presented to the user without "
+        "breaking the continuity of experience even as they transform and reorganize.\n"
+        "Motion is meaningful and appropriate, serving to focus attention and maintain continuity. "
+        "Feedback is subtle yet clear. Transitions are efficient yet coherent.\n\n"
+
+        "3D world.\n\n"
+
+        "The material environment is a 3D space, which means all objects have x, y, and z "
+        "dimensions. The z-axis is perpendicularly aligned to the plane of the display, with the "
+        "positive z-axis extending towards the viewer. Every sheet of material occupies a single "
+        "position along the z-axis and has a standard 1dp thickness.\n"
+        "On the web, the z-axis is used for layering and not for perspective. The 3D world is "
+        "emulated by manipulating the y-axis.\n\n"
+
+        "Light and shadow.\n\n"
+
+        "Within the material environment, virtual lights illuminate the scene. Key lights create "
+        "directional shadows, while ambient light creates soft shadows from all angles.\n"
+        "Shadows in the material environment are cast by these two light sources. In Android "
+        "development, shadows occur when light sources are blocked by sheets of material at "
+        "various positions along the z-axis. On the web, shadows are depicted by manipulating the "
+        "y-axis only. The following example shows the card with a height of 6dp.\n\n"
+
+        "Resting elevation.\n\n"
+
+        "All material objects, regardless of size, have a resting elevation, or default elevation "
+        "that does not change. If an object changes elevation, it should return to its resting "
+        "elevation as soon as possible.\n\n"
+
+        "Component elevations.\n\n"
+
+        "The resting elevation for a component type is consistent across apps (e.g., FAB elevation "
+        "does not vary from 6dp in one app to 16dp in another app).\n"
+        "Components may have different resting elevations across platforms, depending on the depth "
+        "of the environment (e.g., TV has a greater depth than mobile or desktop).\n\n"
+
+        "Responsive elevation and dynamic elevation offsets.\n\n"
+
+        "Some component types have responsive elevation, meaning they change elevation in response "
+        "to user input (e.g., normal, focused, and pressed) or system events. These elevation "
+        "changes are consistently implemented using dynamic elevation offsets.\n"
+        "Dynamic elevation offsets are the goal elevation that a component moves towards, relative "
+        "to the component’s resting state. They ensure that elevation changes are consistent "
+        "across actions and component types. For example, all components that lift on press have "
+        "the same elevation change relative to their resting elevation.\n"
+        "Once the input event is completed or cancelled, the component will return to its resting "
+        "elevation.\n\n"
+
+        "Avoiding elevation interference.\n\n"
+
+        "Components with responsive elevations may encounter other components as they move between "
+        "their resting elevations and dynamic elevation offsets. Because material cannot pass "
+        "through other material, components avoid interfering with one another any number of ways, "
+        "whether on a per component basis or using the entire app layout.\n"
+        "On a component level, components can move or be removed before they cause interference. "
+        "For example, a floating action button (FAB) can disappear or move off screen before a "
+        "user picks up a card, or it can move if a snackbar appears.\n"
+        "On the layout level, design your app layout to minimize opportunities for interference. "
+        "For example, position the FAB to one side of stream of a cards so the FAB won’t interfere "
+        "when a user tries to pick up one of cards.\n\n"
+    </string>
+    <string name="title_message_list">Messages</string>
+    <string name="title_message_detail">Message Detail</string>
+    <string name="title_activity_compose">ComposeActivity</string>
+    <string name="title_activity_discovery">Discovery</string>
+    <string name="section_format">Hello World from section: %1$d</string>
+    <string name="title_activity_device_picker">Device Picke</string>
+</resources>
diff --git a/permissions/app/src/main/res/values/styles.xml b/permissions/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..545b9c6
--- /dev/null
+++ b/permissions/app/src/main/res/values/styles.xml
@@ -0,0 +1,20 @@
+<resources>
+
+    <!-- Base application theme. -->
+    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
+        <!-- Customize your theme here. -->
+        <item name="colorPrimary">@color/colorPrimary</item>
+        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
+        <item name="colorAccent">@color/colorAccent</item>
+    </style>
+
+    <style name="AppTheme.NoActionBar">
+        <item name="windowActionBar">false</item>
+        <item name="windowNoTitle">true</item>
+    </style>
+
+    <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
+
+    <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
+
+</resources>
diff --git a/permissions/build.gradle b/permissions/build.gradle
new file mode 100644
index 0000000..e8778b9
--- /dev/null
+++ b/permissions/build.gradle
@@ -0,0 +1,24 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+    repositories {
+        jcenter()
+    }
+    dependencies {
+        classpath 'com.android.tools.build:gradle:2.1.2'
+        classpath 'com.google.gms:google-services:3.0.0'
+
+        // NOTE: Do not place your application dependencies here; they belong
+        // in the individual module build.gradle files
+    }
+}
+
+allprojects {
+    repositories {
+        jcenter()
+    }
+}
+
+task clean(type: Delete) {
+    delete rootProject.buildDir
+}
diff --git a/permissions/gradle.properties b/permissions/gradle.properties
new file mode 100644
index 0000000..1d3591c
--- /dev/null
+++ b/permissions/gradle.properties
@@ -0,0 +1,18 @@
+# Project-wide Gradle settings.
+
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+# Default value: -Xmx10248m -XX:MaxPermSize=256m
+# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
+
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
\ No newline at end of file
diff --git a/permissions/gradlew.bat b/permissions/gradlew.bat
new file mode 100644
index 0000000..aec9973
--- /dev/null
+++ b/permissions/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off

+@rem ##########################################################################

+@rem

+@rem  Gradle startup script for Windows

+@rem

+@rem ##########################################################################

+

+@rem Set local scope for the variables with windows NT shell

+if "%OS%"=="Windows_NT" setlocal

+

+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.

+set DEFAULT_JVM_OPTS=

+

+set DIRNAME=%~dp0

+if "%DIRNAME%" == "" set DIRNAME=.

+set APP_BASE_NAME=%~n0

+set APP_HOME=%DIRNAME%

+

+@rem Find java.exe

+if defined JAVA_HOME goto findJavaFromJavaHome

+

+set JAVA_EXE=java.exe

+%JAVA_EXE% -version >NUL 2>&1

+if "%ERRORLEVEL%" == "0" goto init

+

+echo.

+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

+echo.

+echo Please set the JAVA_HOME variable in your environment to match the

+echo location of your Java installation.

+

+goto fail

+

+:findJavaFromJavaHome

+set JAVA_HOME=%JAVA_HOME:"=%

+set JAVA_EXE=%JAVA_HOME%/bin/java.exe

+

+if exist "%JAVA_EXE%" goto init

+

+echo.

+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%

+echo.

+echo Please set the JAVA_HOME variable in your environment to match the

+echo location of your Java installation.

+

+goto fail

+

+:init

+@rem Get command-line arguments, handling Windowz variants

+

+if not "%OS%" == "Windows_NT" goto win9xME_args

+if "%@eval[2+2]" == "4" goto 4NT_args

+

+:win9xME_args

+@rem Slurp the command line arguments.

+set CMD_LINE_ARGS=

+set _SKIP=2

+

+:win9xME_args_slurp

+if "x%~1" == "x" goto execute

+

+set CMD_LINE_ARGS=%*

+goto execute

+

+:4NT_args

+@rem Get arguments from the 4NT Shell from JP Software

+set CMD_LINE_ARGS=%$

+

+:execute

+@rem Setup the command line

+

+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

+

+@rem Execute Gradle

+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

+

+:end

+@rem End local scope for the variables with windows NT shell

+if "%ERRORLEVEL%"=="0" goto mainEnd

+

+:fail

+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of

+rem the _cmd.exe /c_ return code!

+if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1

+exit /b 1

+

+:mainEnd

+if "%OS%"=="Windows_NT" endlocal

+

+:omega

diff --git a/permissions/settings.gradle b/permissions/settings.gradle
new file mode 100644
index 0000000..e7b4def
--- /dev/null
+++ b/permissions/settings.gradle
@@ -0,0 +1 @@
+include ':app'