SlideShare a Scribd company logo
1 of 48
Download to read offline
Google Drive and the
Google Drive SDK
Building Drive apps


Claudio Cherubino
Google Drive Developer Relations
What is Google Drive?
Yea, some marketing :)
Access Anywhere

Google Drive is everywhere you are -- on the
web, in your home, at the office, and on the go.

So wherever you are, your stuff is just...there.
Ready to go, ready to share.

Install it on:




PC, Mac, Android, iOS
Store your files in a safe place


Things happen. Your phone goes for a swim.
Your laptop takes an infinite snooze.

No matter what happens to your devices, your
files are safely stored in Google Drive.
Powerful search


Google Drive can search keywords
in your files -- even the text in
pictures -- to help you quickly find
what you're looking for.
View anything



                When a coworker shares a file with
                you, you may not have the supported
                software on your computer. With
                Google Drive you can open and view
                over 35 file types directly in the
                browser.
Access to a world of apps!


Google Drive works with the apps that
make you more efficient.

Choose from a growing set of
productivity applications, integrated
right into your Drive.
Demos!
Pixlr Editor
HelloFax
AutoCAD WS
Google Drive SDK
Why integrate with Google Drive?
Drive SDK opportunity




                                                                 ++
        Extensive Reach                        Effortless Integration
        Put your app in front of millions of   Get the best of Google Drive's sharing
        users with billions of files           capabilities, storage capacity and user
                                               identity management so you can focus
                                               on your app
Drive SDK features

Drive
●   Create, Read, List, Manage files through the API
●   Search, sharing and revisions


Drive Web UI
●   Open files and docs with your app directly from Drive
Integrating with Google Drive
Getting Started
Steps for integrating your app w/ Drive


Prerequisites:
   ●   Create a project in the Google APIs Console
   ●   Enable the Drive API
   ●   Create OAuth 2.0 credentials


Integration steps:
   ●   Auth with OAuth 2.0 [& OpenID Connect]
   ●   Write code for opening / saving / managing files
OAuth 2.0
Introduction
A cool tool...




                 OAuth 2.0 Playground
Integrating with Google Drive
Handling Authorization for Web apps
Authorization
Using OAuth 2.0 - Redirecting users to the Grant screen

                                                                                 Java
// Instantiating some dependencies
HttpTransport httpTransport = new NetHttpTransport();
JacksonFactory jsonFactory = new JacksonFactory();

// Building the flow and the redirect URL
GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(
        httpTransport, jsonFactory, CLIENT_ID, CLIENT_SECRET, SCOPES).build();

GoogleAuthorizationCodeRequestUrl urlBuilder =
        flow.newAuthorizationUrl().setRedirectUri(REDIRECT_URI);

// Redirecting users to the grant screen
resp.sendRedirect(urlBuilder.build());
Authorization
Using OAuth 2.0 - Getting back & exchanging the code in your callback handler

                                                                                          Java
// Reading the auth code value from the URL
String authorizationCode = req.getParameter("code");

// Exchanging the auth code for tokens
GoogleTokenResponse tokenResponse =
        flow.newTokenRequest(authorizationCode).setRedirectUri(REDIRECT_URI).execute();

String accessToken = tokenResponse.getAccessToken();
String refreshToken = tokenResponse.getRefreshToken();
Integrating with Google Drive
Handling Authorization for Android
Authorization
Using OAuth 2.0 - Using the AccountManager


Problem!
Currently not possible:
 ● Anonymous tokens are not allowed
 ● App auth using API Key is Disabled for Drive for security reasons



Solutions
Permanent: Add app auth to auth authentication in Android (available w/ Google Play services!)
Temporarily: Use a WebView and trigger an OAuth 2.0 flow


Check this Google IO presentation for more.
Authorization
Using OAuth 2.0 - Using a WebView


Steps to do WebView auth:
 ● Redirect Users to the grant screen URL in a WebView
 ● Use http://localhost as the redirect URI
 ● Register a WebViewClient with an onPageStarted method to intercept page change
 ● Detect successful/failed authorization and read the auth code from the URL of the WebView




Resources w/ code samples:
 ● Sample code for complex login system on mobile apps
 ● Improved Twitter OAuth for Android
Integrating with Google Drive
Interacting w/ Drive files
Instantiating the Drive service Object


                                                                                      Java
// Building the credentials Object
GoogleCredentials credentials = flow.createAndStoreCredential(tokenResponse, null);

// Here is the Drive service
Drive service = new Drive.Builder(httpTransport, jsonFactory, credentials);
Creating Files


                                                                     Java
// File's metadata
File body = new File();
body.setTitle(title);
body.setDescription(description);
body.setMimeType(mimeType);

// File's content
java.io.File fileContent = new java.io.File(filename);
FileContent mediaContent = new FileContent(mimeType, fileContent);

// Executing the request
file = service.files().insert(body, mediaContent).execute();
Fetching Files


                                                                             Java
// Getting file's metadata
File file = service.files().get(fileId).execute();

// Downloading the file's content
if (file.getDownloadUrl() != null && file.getDownloadUrl().length() > 0) {
    HttpResponse resp = service.getRequestFactory().buildGetRequest(
            new GenericUrl(file.getDownloadUrl())).execute();
    InputStream content = resp.getContent();
}
Integrating with Google Drive
Adding the Drive Web-UI Integration
UI Integration - "Create"
UI Integration - "Open with"
Distribution - Chrome Web Store
Steps for adding Drive UI integration


Prerequisites:
   ●   Create a Chrome Web Store listing       (Painful !)
   ●   Install the application from the CWS
   ●   Enable and configure the Drive SDK in the Google APIs Console


Integration steps:
   ●   Support OAuth 2.0 server-side flow
   ●   Read action and file ID from URL parameter
Passing context on open & create
    What happens when somebody launches your app from Drive?

                                                                       URL

https://www.yourapp.com/drive?code=<authorization code>&state=<JSON>




                                                                       JSON
{
    "action" : "create",
    "parentId" : "0ADK06pfg"          Create actions
}

{
    "action" : "open",
    "ids" : ["0Bz0bd"]                Open actions
}
Passing context on open & create
    What happens when somebody launches your app from Drive?

                                                                        URL

https://www.yourapp.com/drive?code=<authorization code>&state=<JSON>




                                                                        JSON
{
    "action" : "open",
    "exportIds" : ["0Bz0bd"]          Open native Google Docs actions
}
Integrating with Google Drive
Adding the Drive Android App Integration
Receiving intents from the Drive app
Receiving intents from the Drive app

●   Export an Activity that supports an intent with the following info:
      ● action: drive.intent.action.DRIVE_OPEN

      ● path: content://com.google.android.drive/open/resourceId

      ● type: MIME type of the file


●   Declare your API Project ID in the Activity's metadata

●   List supported MIME types in the intent-filter element

●   The intent will not include the body of the document nor the user account

●   Retrieve the file from the Drive API using the resourceId provided by the intent in the path




Check this Google IO presentation for more.
Receiving intents from the Drive app


                                                                                                                   XML
<manifest …>
  <uses-permission android:name="android.permission.GET_ACCOUNTS" />
  <application …>
    <activity android:name="DriveActivity" android:label="@string/cloud_paint" android:icon="@drawable/app_icon"
              android:exported="true">
     <meta-data android:name="com.google.android.apps.drive.APP_ID" android:value="id=1234567890" />
     <intent-filter>
        <action android:name="com.google.android.apps.drive.DRIVE_OPEN" />
        <data android:mimeType="text/plain" />
        <data android:mimeType="text/html" />
      </intent-filter>
    </activity>
  </application>
</manifest>
Receiving intents from the Drive app


                                                                                                Java
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  final Intent intent = getIntent();
  final String action = intent.getAction();
  if ("drive.intent.action.DRIVE_OPEN".equals(action)) {
    String fileId = intent.getStringExtra("resourceId");
    // Prompt the user to choose the account to use and process the file using the Drive API.
  } else {
    // Other action.
  }
}
Integrating with Google Drive
The Google Picker
UI Integration - Embedded file picker
Embedding the picker

                                                                  JS
google.setOnLoadCallback(createPicker);
google.load('picker', '1');

var view = new google.picker.View(google.picker.ViewId.DOCS);
view.setMimeTypes("image/png,image/jpeg,image/jpg");

function createPicker() {
   picker = new google.picker.PickerBuilder()
      .enableFeature(google.picker.Feature.MULTISELECT_ENABLED)
      .setAppId(YOUR_APP_ID)
      .addView(view)
      .setCallback(pickerCallback)
      .build();
   picker.setVisible(true);
}
Handling picker selections

                                                        JS

// A simple callback implementation.
function pickerCallback(data) {
    if (data.action == google.picker.Action.PICKED) {
        var fileId = data.docs[0].id;
        alert('The user selected: ' + fileId);
    }
}
Security and other features
A brief (but important) note on security


The Drive SDK has 2 security models.

 ●   The first one gives you full access to the user's Drive
      ○ Read and/or write all files
      ○ Manage all files
      ○ List all files
      ○ ...
A brief (but important) note on security


Drive's second security model is a per-file security model

●   More restrictive file level access
●   Simple rules - an app can open any file that:
     ○ The user opened with the app through the Drive UI
     ○ The user opened with the app through the Picker API
     ○ The app created itself
Other Features / tips & tricks
 ●   Resumable upload & download
 ●   Indexable text
 ●   Search!
 ●   Conversions to native Google Documents
 ●   Export of native Google Documents in many formats
 ●   OCR
 ●   Revisions
 ●   List installed apps
 ●   Copy files, Trash files, Touch files
 ●   Folders
 ●   User Permissions
 ●   Shortcuts
      ○ Auto-generated MIME type
      ○ Contentless
      ○ Indexable & syncable!
<Thank You!>
http://developers.google.com/drive



ccherubino@google.com
http://plus.claudiocherubino.it
#ccherubino
google drive and the google drive sdk

More Related Content

What's hot

Creating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-htmlCreating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-htmlIlia Idakiev
 
SharePoint solution developer exam 70-488
SharePoint solution developer exam 70-488SharePoint solution developer exam 70-488
SharePoint solution developer exam 70-488Ahmed Tawfik
 
IndexedDB and Push Notifications in Progressive Web Apps
IndexedDB and Push Notifications in Progressive Web AppsIndexedDB and Push Notifications in Progressive Web Apps
IndexedDB and Push Notifications in Progressive Web AppsAdégòkè Obasá
 
Multiple File Upload Control
Multiple File Upload ControlMultiple File Upload Control
Multiple File Upload ControlMahesh Tibrewal
 
Firebase-ized your mobile app
Firebase-ized  your mobile appFirebase-ized  your mobile app
Firebase-ized your mobile appMatteo Bonifazi
 
CUST-1 Share Document Library Extension Points
CUST-1 Share Document Library Extension PointsCUST-1 Share Document Library Extension Points
CUST-1 Share Document Library Extension PointsAlfresco Software
 
Vaadin 8 with Spring Framework
Vaadin 8 with Spring FrameworkVaadin 8 with Spring Framework
Vaadin 8 with Spring FrameworkPeter Lehto
 
Azure Table Storage: The Good, the Bad, the Ugly (full talk)
Azure Table Storage: The Good, the Bad, the Ugly (full talk)Azure Table Storage: The Good, the Bad, the Ugly (full talk)
Azure Table Storage: The Good, the Bad, the Ugly (full talk)Sirar Salih
 
Vaadin 7 CN
Vaadin 7 CNVaadin 7 CN
Vaadin 7 CNjojule
 
Top 45 jQuery Interview Questions and Answers | Edureka
Top 45 jQuery Interview Questions and Answers | EdurekaTop 45 jQuery Interview Questions and Answers | Edureka
Top 45 jQuery Interview Questions and Answers | EdurekaEdureka!
 
Content Delivery at Aviary - NYC MUG 11/19/13
Content Delivery at Aviary - NYC MUG 11/19/13Content Delivery at Aviary - NYC MUG 11/19/13
Content Delivery at Aviary - NYC MUG 11/19/13MongoDB
 
GWT integration with Vaadin
GWT integration with VaadinGWT integration with Vaadin
GWT integration with VaadinPeter Lehto
 
Integrating dialog flow (api.ai) into qiscus sdk chat application
Integrating dialog flow (api.ai) into qiscus sdk chat applicationIntegrating dialog flow (api.ai) into qiscus sdk chat application
Integrating dialog flow (api.ai) into qiscus sdk chat applicationErick Ranes Akbar Mawuntu
 
SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015Pushkar Chivate
 
Jquery dojo slides
Jquery dojo slidesJquery dojo slides
Jquery dojo slideshelenmga
 
MICROSOFT ASP.NET ONLINE TRAINING
MICROSOFT ASP.NET ONLINE TRAININGMICROSOFT ASP.NET ONLINE TRAINING
MICROSOFT ASP.NET ONLINE TRAININGSanthosh Sap
 

What's hot (17)

Creating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-htmlCreating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-html
 
SharePoint solution developer exam 70-488
SharePoint solution developer exam 70-488SharePoint solution developer exam 70-488
SharePoint solution developer exam 70-488
 
Html5
Html5Html5
Html5
 
IndexedDB and Push Notifications in Progressive Web Apps
IndexedDB and Push Notifications in Progressive Web AppsIndexedDB and Push Notifications in Progressive Web Apps
IndexedDB and Push Notifications in Progressive Web Apps
 
Multiple File Upload Control
Multiple File Upload ControlMultiple File Upload Control
Multiple File Upload Control
 
Firebase-ized your mobile app
Firebase-ized  your mobile appFirebase-ized  your mobile app
Firebase-ized your mobile app
 
CUST-1 Share Document Library Extension Points
CUST-1 Share Document Library Extension PointsCUST-1 Share Document Library Extension Points
CUST-1 Share Document Library Extension Points
 
Vaadin 8 with Spring Framework
Vaadin 8 with Spring FrameworkVaadin 8 with Spring Framework
Vaadin 8 with Spring Framework
 
Azure Table Storage: The Good, the Bad, the Ugly (full talk)
Azure Table Storage: The Good, the Bad, the Ugly (full talk)Azure Table Storage: The Good, the Bad, the Ugly (full talk)
Azure Table Storage: The Good, the Bad, the Ugly (full talk)
 
Vaadin 7 CN
Vaadin 7 CNVaadin 7 CN
Vaadin 7 CN
 
Top 45 jQuery Interview Questions and Answers | Edureka
Top 45 jQuery Interview Questions and Answers | EdurekaTop 45 jQuery Interview Questions and Answers | Edureka
Top 45 jQuery Interview Questions and Answers | Edureka
 
Content Delivery at Aviary - NYC MUG 11/19/13
Content Delivery at Aviary - NYC MUG 11/19/13Content Delivery at Aviary - NYC MUG 11/19/13
Content Delivery at Aviary - NYC MUG 11/19/13
 
GWT integration with Vaadin
GWT integration with VaadinGWT integration with Vaadin
GWT integration with Vaadin
 
Integrating dialog flow (api.ai) into qiscus sdk chat application
Integrating dialog flow (api.ai) into qiscus sdk chat applicationIntegrating dialog flow (api.ai) into qiscus sdk chat application
Integrating dialog flow (api.ai) into qiscus sdk chat application
 
SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015
 
Jquery dojo slides
Jquery dojo slidesJquery dojo slides
Jquery dojo slides
 
MICROSOFT ASP.NET ONLINE TRAINING
MICROSOFT ASP.NET ONLINE TRAININGMICROSOFT ASP.NET ONLINE TRAINING
MICROSOFT ASP.NET ONLINE TRAINING
 

Similar to google drive and the google drive sdk

Google Drive & Google Drive SDK
Google Drive & Google Drive SDKGoogle Drive & Google Drive SDK
Google Drive & Google Drive SDKGDG Algiers
 
Integrate Google Drive with Google Apps Script
Integrate Google Drive with Google Apps ScriptIntegrate Google Drive with Google Apps Script
Integrate Google Drive with Google Apps ScriptArun Nagarajan
 
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...wesley chun
 
Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides & more
Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides & morePower your apps with Gmail, Google Drive, Calendar, Sheets, Slides & more
Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides & morewesley chun
 
Exploring Google APIs 102: Cloud vs. non-GCP Google APIs
Exploring Google APIs 102: Cloud vs. non-GCP Google APIsExploring Google APIs 102: Cloud vs. non-GCP Google APIs
Exploring Google APIs 102: Cloud vs. non-GCP Google APIswesley chun
 
Image archive, analysis & report generation with Google Cloud
Image archive, analysis & report generation with Google CloudImage archive, analysis & report generation with Google Cloud
Image archive, analysis & report generation with Google Cloudwesley chun
 
Using Google (Cloud) APIs
Using Google (Cloud) APIsUsing Google (Cloud) APIs
Using Google (Cloud) APIswesley chun
 
Exploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScriptExploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScriptwesley chun
 
Exploring Google (Cloud) APIs & Cloud Computing overview
Exploring Google (Cloud) APIs & Cloud Computing overviewExploring Google (Cloud) APIs & Cloud Computing overview
Exploring Google (Cloud) APIs & Cloud Computing overviewwesley chun
 
Accessing Google Cloud APIs
Accessing Google Cloud APIsAccessing Google Cloud APIs
Accessing Google Cloud APIswesley chun
 
Google Cloud Platform 2014Q1 - Starter Guide
Google Cloud Platform   2014Q1 - Starter GuideGoogle Cloud Platform   2014Q1 - Starter Guide
Google Cloud Platform 2014Q1 - Starter GuideSimon Su
 
Google app-engine-with-python
Google app-engine-with-pythonGoogle app-engine-with-python
Google app-engine-with-pythonDeepak Garg
 
Android chat in the cloud
Android chat in the cloudAndroid chat in the cloud
Android chat in the cloudfirenze-gtug
 
Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)Luc Bors
 
Google Integration in Android Apps - Mooscon 2013 Cebit
Google Integration in Android Apps - Mooscon 2013 CebitGoogle Integration in Android Apps - Mooscon 2013 Cebit
Google Integration in Android Apps - Mooscon 2013 CebitFriedger Müffke
 
Introduction to Cloud Computing with Google Cloud
Introduction to Cloud Computing with Google CloudIntroduction to Cloud Computing with Google Cloud
Introduction to Cloud Computing with Google Cloudwesley chun
 

Similar to google drive and the google drive sdk (20)

google drive
google drivegoogle drive
google drive
 
Google Drive & Google Drive SDK
Google Drive & Google Drive SDKGoogle Drive & Google Drive SDK
Google Drive & Google Drive SDK
 
Integrate Google Drive with Google Apps Script
Integrate Google Drive with Google Apps ScriptIntegrate Google Drive with Google Apps Script
Integrate Google Drive with Google Apps Script
 
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
 
Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides & more
Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides & morePower your apps with Gmail, Google Drive, Calendar, Sheets, Slides & more
Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides & more
 
Introduction to Google App Engine
Introduction to Google App EngineIntroduction to Google App Engine
Introduction to Google App Engine
 
Google Cloud Platform
Google Cloud Platform Google Cloud Platform
Google Cloud Platform
 
Exploring Google APIs 102: Cloud vs. non-GCP Google APIs
Exploring Google APIs 102: Cloud vs. non-GCP Google APIsExploring Google APIs 102: Cloud vs. non-GCP Google APIs
Exploring Google APIs 102: Cloud vs. non-GCP Google APIs
 
Image archive, analysis & report generation with Google Cloud
Image archive, analysis & report generation with Google CloudImage archive, analysis & report generation with Google Cloud
Image archive, analysis & report generation with Google Cloud
 
Using Google (Cloud) APIs
Using Google (Cloud) APIsUsing Google (Cloud) APIs
Using Google (Cloud) APIs
 
Exploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScriptExploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScript
 
Exploring Google (Cloud) APIs & Cloud Computing overview
Exploring Google (Cloud) APIs & Cloud Computing overviewExploring Google (Cloud) APIs & Cloud Computing overview
Exploring Google (Cloud) APIs & Cloud Computing overview
 
Accessing Google Cloud APIs
Accessing Google Cloud APIsAccessing Google Cloud APIs
Accessing Google Cloud APIs
 
Goa tutorial
Goa tutorialGoa tutorial
Goa tutorial
 
Google Cloud Platform 2014Q1 - Starter Guide
Google Cloud Platform   2014Q1 - Starter GuideGoogle Cloud Platform   2014Q1 - Starter Guide
Google Cloud Platform 2014Q1 - Starter Guide
 
Google app-engine-with-python
Google app-engine-with-pythonGoogle app-engine-with-python
Google app-engine-with-python
 
Android chat in the cloud
Android chat in the cloudAndroid chat in the cloud
Android chat in the cloud
 
Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)
 
Google Integration in Android Apps - Mooscon 2013 Cebit
Google Integration in Android Apps - Mooscon 2013 CebitGoogle Integration in Android Apps - Mooscon 2013 Cebit
Google Integration in Android Apps - Mooscon 2013 Cebit
 
Introduction to Cloud Computing with Google Cloud
Introduction to Cloud Computing with Google CloudIntroduction to Cloud Computing with Google Cloud
Introduction to Cloud Computing with Google Cloud
 

More from firenze-gtug

Html5 apps - GWT oriented
Html5 apps - GWT orientedHtml5 apps - GWT oriented
Html5 apps - GWT orientedfirenze-gtug
 
Android ndk - ottimizzazione su dispositivi Intel
Android ndk - ottimizzazione su dispositivi IntelAndroid ndk - ottimizzazione su dispositivi Intel
Android ndk - ottimizzazione su dispositivi Intelfirenze-gtug
 
Gwt kickoff - Alberto Mancini & Francesca Tosi
Gwt kickoff - Alberto Mancini & Francesca TosiGwt kickoff - Alberto Mancini & Francesca Tosi
Gwt kickoff - Alberto Mancini & Francesca Tosifirenze-gtug
 
Youtube broadcast live - Massimiliano D'Ambrosio
Youtube broadcast live - Massimiliano D'AmbrosioYoutube broadcast live - Massimiliano D'Ambrosio
Youtube broadcast live - Massimiliano D'Ambrosiofirenze-gtug
 
Intro BeagleBone Black - Massimiliano D'Ambrosio
Intro BeagleBone Black - Massimiliano D'AmbrosioIntro BeagleBone Black - Massimiliano D'Ambrosio
Intro BeagleBone Black - Massimiliano D'Ambrosiofirenze-gtug
 
Arduino - Massimiliano D'Ambrosio
Arduino - Massimiliano D'AmbrosioArduino - Massimiliano D'Ambrosio
Arduino - Massimiliano D'Ambrosiofirenze-gtug
 
Introduzione a GAE - Alessandro Aglietti e Lorenzo Bugiani
Introduzione a GAE - Alessandro Aglietti e Lorenzo BugianiIntroduzione a GAE - Alessandro Aglietti e Lorenzo Bugiani
Introduzione a GAE - Alessandro Aglietti e Lorenzo Bugianifirenze-gtug
 
RFID: What & Why - Stefano Coluccini
RFID: What & Why - Stefano ColucciniRFID: What & Why - Stefano Coluccini
RFID: What & Why - Stefano Coluccinifirenze-gtug
 
GWT - AppDays - (25 aprile 2014, pordenone)
GWT - AppDays - (25 aprile 2014, pordenone)GWT - AppDays - (25 aprile 2014, pordenone)
GWT - AppDays - (25 aprile 2014, pordenone)firenze-gtug
 
Presentazione Google App Engine
Presentazione Google App EnginePresentazione Google App Engine
Presentazione Google App Enginefirenze-gtug
 
Clean android code
Clean android codeClean android code
Clean android codefirenze-gtug
 
Intel ndk - a few Benchmarks
Intel ndk - a few BenchmarksIntel ndk - a few Benchmarks
Intel ndk - a few Benchmarksfirenze-gtug
 
EE Incremental Store
EE Incremental StoreEE Incremental Store
EE Incremental Storefirenze-gtug
 
Programming objects with android
Programming objects with androidProgramming objects with android
Programming objects with androidfirenze-gtug
 
Apertura "Mobile & Embedded" - 13 febbraio 2014
Apertura "Mobile & Embedded" - 13 febbraio 2014Apertura "Mobile & Embedded" - 13 febbraio 2014
Apertura "Mobile & Embedded" - 13 febbraio 2014firenze-gtug
 
Maven from dummies
Maven from dummiesMaven from dummies
Maven from dummiesfirenze-gtug
 
Dev fest android application case study
Dev fest android application   case studyDev fest android application   case study
Dev fest android application case studyfirenze-gtug
 
You tube api overview
You tube api overviewYou tube api overview
You tube api overviewfirenze-gtug
 

More from firenze-gtug (20)

Html5 apps - GWT oriented
Html5 apps - GWT orientedHtml5 apps - GWT oriented
Html5 apps - GWT oriented
 
Android ndk - ottimizzazione su dispositivi Intel
Android ndk - ottimizzazione su dispositivi IntelAndroid ndk - ottimizzazione su dispositivi Intel
Android ndk - ottimizzazione su dispositivi Intel
 
Gwt kickoff - Alberto Mancini & Francesca Tosi
Gwt kickoff - Alberto Mancini & Francesca TosiGwt kickoff - Alberto Mancini & Francesca Tosi
Gwt kickoff - Alberto Mancini & Francesca Tosi
 
Youtube broadcast live - Massimiliano D'Ambrosio
Youtube broadcast live - Massimiliano D'AmbrosioYoutube broadcast live - Massimiliano D'Ambrosio
Youtube broadcast live - Massimiliano D'Ambrosio
 
Intro BeagleBone Black - Massimiliano D'Ambrosio
Intro BeagleBone Black - Massimiliano D'AmbrosioIntro BeagleBone Black - Massimiliano D'Ambrosio
Intro BeagleBone Black - Massimiliano D'Ambrosio
 
Arduino - Massimiliano D'Ambrosio
Arduino - Massimiliano D'AmbrosioArduino - Massimiliano D'Ambrosio
Arduino - Massimiliano D'Ambrosio
 
Introduzione a GAE - Alessandro Aglietti e Lorenzo Bugiani
Introduzione a GAE - Alessandro Aglietti e Lorenzo BugianiIntroduzione a GAE - Alessandro Aglietti e Lorenzo Bugiani
Introduzione a GAE - Alessandro Aglietti e Lorenzo Bugiani
 
RFID: What & Why - Stefano Coluccini
RFID: What & Why - Stefano ColucciniRFID: What & Why - Stefano Coluccini
RFID: What & Why - Stefano Coluccini
 
GWT - AppDays - (25 aprile 2014, pordenone)
GWT - AppDays - (25 aprile 2014, pordenone)GWT - AppDays - (25 aprile 2014, pordenone)
GWT - AppDays - (25 aprile 2014, pordenone)
 
Presentazione Google App Engine
Presentazione Google App EnginePresentazione Google App Engine
Presentazione Google App Engine
 
Clean android code
Clean android codeClean android code
Clean android code
 
#Html2Native
#Html2Native#Html2Native
#Html2Native
 
Intel ndk - a few Benchmarks
Intel ndk - a few BenchmarksIntel ndk - a few Benchmarks
Intel ndk - a few Benchmarks
 
EE Incremental Store
EE Incremental StoreEE Incremental Store
EE Incremental Store
 
Programming objects with android
Programming objects with androidProgramming objects with android
Programming objects with android
 
Apertura "Mobile & Embedded" - 13 febbraio 2014
Apertura "Mobile & Embedded" - 13 febbraio 2014Apertura "Mobile & Embedded" - 13 febbraio 2014
Apertura "Mobile & Embedded" - 13 febbraio 2014
 
Maven from dummies
Maven from dummiesMaven from dummies
Maven from dummies
 
Apps fuel oct2012
Apps fuel oct2012Apps fuel oct2012
Apps fuel oct2012
 
Dev fest android application case study
Dev fest android application   case studyDev fest android application   case study
Dev fest android application case study
 
You tube api overview
You tube api overviewYou tube api overview
You tube api overview
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 

Recently uploaded (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

google drive and the google drive sdk

  • 1.
  • 2. Google Drive and the Google Drive SDK Building Drive apps Claudio Cherubino Google Drive Developer Relations
  • 3. What is Google Drive? Yea, some marketing :)
  • 4. Access Anywhere Google Drive is everywhere you are -- on the web, in your home, at the office, and on the go. So wherever you are, your stuff is just...there. Ready to go, ready to share. Install it on: PC, Mac, Android, iOS
  • 5. Store your files in a safe place Things happen. Your phone goes for a swim. Your laptop takes an infinite snooze. No matter what happens to your devices, your files are safely stored in Google Drive.
  • 6. Powerful search Google Drive can search keywords in your files -- even the text in pictures -- to help you quickly find what you're looking for.
  • 7. View anything When a coworker shares a file with you, you may not have the supported software on your computer. With Google Drive you can open and view over 35 file types directly in the browser.
  • 8. Access to a world of apps! Google Drive works with the apps that make you more efficient. Choose from a growing set of productivity applications, integrated right into your Drive.
  • 10. Google Drive SDK Why integrate with Google Drive?
  • 11. Drive SDK opportunity ++ Extensive Reach Effortless Integration Put your app in front of millions of Get the best of Google Drive's sharing users with billions of files capabilities, storage capacity and user identity management so you can focus on your app
  • 12. Drive SDK features Drive ● Create, Read, List, Manage files through the API ● Search, sharing and revisions Drive Web UI ● Open files and docs with your app directly from Drive
  • 13. Integrating with Google Drive Getting Started
  • 14. Steps for integrating your app w/ Drive Prerequisites: ● Create a project in the Google APIs Console ● Enable the Drive API ● Create OAuth 2.0 credentials Integration steps: ● Auth with OAuth 2.0 [& OpenID Connect] ● Write code for opening / saving / managing files
  • 16. A cool tool... OAuth 2.0 Playground
  • 17. Integrating with Google Drive Handling Authorization for Web apps
  • 18. Authorization Using OAuth 2.0 - Redirecting users to the Grant screen Java // Instantiating some dependencies HttpTransport httpTransport = new NetHttpTransport(); JacksonFactory jsonFactory = new JacksonFactory(); // Building the flow and the redirect URL GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder( httpTransport, jsonFactory, CLIENT_ID, CLIENT_SECRET, SCOPES).build(); GoogleAuthorizationCodeRequestUrl urlBuilder = flow.newAuthorizationUrl().setRedirectUri(REDIRECT_URI); // Redirecting users to the grant screen resp.sendRedirect(urlBuilder.build());
  • 19. Authorization Using OAuth 2.0 - Getting back & exchanging the code in your callback handler Java // Reading the auth code value from the URL String authorizationCode = req.getParameter("code"); // Exchanging the auth code for tokens GoogleTokenResponse tokenResponse = flow.newTokenRequest(authorizationCode).setRedirectUri(REDIRECT_URI).execute(); String accessToken = tokenResponse.getAccessToken(); String refreshToken = tokenResponse.getRefreshToken();
  • 20. Integrating with Google Drive Handling Authorization for Android
  • 21. Authorization Using OAuth 2.0 - Using the AccountManager Problem! Currently not possible: ● Anonymous tokens are not allowed ● App auth using API Key is Disabled for Drive for security reasons Solutions Permanent: Add app auth to auth authentication in Android (available w/ Google Play services!) Temporarily: Use a WebView and trigger an OAuth 2.0 flow Check this Google IO presentation for more.
  • 22. Authorization Using OAuth 2.0 - Using a WebView Steps to do WebView auth: ● Redirect Users to the grant screen URL in a WebView ● Use http://localhost as the redirect URI ● Register a WebViewClient with an onPageStarted method to intercept page change ● Detect successful/failed authorization and read the auth code from the URL of the WebView Resources w/ code samples: ● Sample code for complex login system on mobile apps ● Improved Twitter OAuth for Android
  • 23. Integrating with Google Drive Interacting w/ Drive files
  • 24. Instantiating the Drive service Object Java // Building the credentials Object GoogleCredentials credentials = flow.createAndStoreCredential(tokenResponse, null); // Here is the Drive service Drive service = new Drive.Builder(httpTransport, jsonFactory, credentials);
  • 25. Creating Files Java // File's metadata File body = new File(); body.setTitle(title); body.setDescription(description); body.setMimeType(mimeType); // File's content java.io.File fileContent = new java.io.File(filename); FileContent mediaContent = new FileContent(mimeType, fileContent); // Executing the request file = service.files().insert(body, mediaContent).execute();
  • 26. Fetching Files Java // Getting file's metadata File file = service.files().get(fileId).execute(); // Downloading the file's content if (file.getDownloadUrl() != null && file.getDownloadUrl().length() > 0) { HttpResponse resp = service.getRequestFactory().buildGetRequest( new GenericUrl(file.getDownloadUrl())).execute(); InputStream content = resp.getContent(); }
  • 27. Integrating with Google Drive Adding the Drive Web-UI Integration
  • 28. UI Integration - "Create"
  • 29. UI Integration - "Open with"
  • 31. Steps for adding Drive UI integration Prerequisites: ● Create a Chrome Web Store listing (Painful !) ● Install the application from the CWS ● Enable and configure the Drive SDK in the Google APIs Console Integration steps: ● Support OAuth 2.0 server-side flow ● Read action and file ID from URL parameter
  • 32. Passing context on open & create What happens when somebody launches your app from Drive? URL https://www.yourapp.com/drive?code=<authorization code>&state=<JSON> JSON { "action" : "create", "parentId" : "0ADK06pfg" Create actions } { "action" : "open", "ids" : ["0Bz0bd"] Open actions }
  • 33. Passing context on open & create What happens when somebody launches your app from Drive? URL https://www.yourapp.com/drive?code=<authorization code>&state=<JSON> JSON { "action" : "open", "exportIds" : ["0Bz0bd"] Open native Google Docs actions }
  • 34. Integrating with Google Drive Adding the Drive Android App Integration
  • 35. Receiving intents from the Drive app
  • 36. Receiving intents from the Drive app ● Export an Activity that supports an intent with the following info: ● action: drive.intent.action.DRIVE_OPEN ● path: content://com.google.android.drive/open/resourceId ● type: MIME type of the file ● Declare your API Project ID in the Activity's metadata ● List supported MIME types in the intent-filter element ● The intent will not include the body of the document nor the user account ● Retrieve the file from the Drive API using the resourceId provided by the intent in the path Check this Google IO presentation for more.
  • 37. Receiving intents from the Drive app XML <manifest …> <uses-permission android:name="android.permission.GET_ACCOUNTS" /> <application …> <activity android:name="DriveActivity" android:label="@string/cloud_paint" android:icon="@drawable/app_icon" android:exported="true"> <meta-data android:name="com.google.android.apps.drive.APP_ID" android:value="id=1234567890" /> <intent-filter> <action android:name="com.google.android.apps.drive.DRIVE_OPEN" /> <data android:mimeType="text/plain" /> <data android:mimeType="text/html" /> </intent-filter> </activity> </application> </manifest>
  • 38. Receiving intents from the Drive app Java @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); final Intent intent = getIntent(); final String action = intent.getAction(); if ("drive.intent.action.DRIVE_OPEN".equals(action)) { String fileId = intent.getStringExtra("resourceId"); // Prompt the user to choose the account to use and process the file using the Drive API. } else { // Other action. } }
  • 39. Integrating with Google Drive The Google Picker
  • 40. UI Integration - Embedded file picker
  • 41. Embedding the picker JS google.setOnLoadCallback(createPicker); google.load('picker', '1'); var view = new google.picker.View(google.picker.ViewId.DOCS); view.setMimeTypes("image/png,image/jpeg,image/jpg"); function createPicker() { picker = new google.picker.PickerBuilder() .enableFeature(google.picker.Feature.MULTISELECT_ENABLED) .setAppId(YOUR_APP_ID) .addView(view) .setCallback(pickerCallback) .build(); picker.setVisible(true); }
  • 42. Handling picker selections JS // A simple callback implementation. function pickerCallback(data) { if (data.action == google.picker.Action.PICKED) { var fileId = data.docs[0].id; alert('The user selected: ' + fileId); } }
  • 43. Security and other features
  • 44. A brief (but important) note on security The Drive SDK has 2 security models. ● The first one gives you full access to the user's Drive ○ Read and/or write all files ○ Manage all files ○ List all files ○ ...
  • 45. A brief (but important) note on security Drive's second security model is a per-file security model ● More restrictive file level access ● Simple rules - an app can open any file that: ○ The user opened with the app through the Drive UI ○ The user opened with the app through the Picker API ○ The app created itself
  • 46. Other Features / tips & tricks ● Resumable upload & download ● Indexable text ● Search! ● Conversions to native Google Documents ● Export of native Google Documents in many formats ● OCR ● Revisions ● List installed apps ● Copy files, Trash files, Touch files ● Folders ● User Permissions ● Shortcuts ○ Auto-generated MIME type ○ Contentless ○ Indexable & syncable!