Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Create a file in your working directory called local.properties, containing the path to your Android SDK. Use local.properties.example as a model. (On Windows, use a double-backslash (\\) as a path separator!)

Import the project in Android Studio:

Press File > Import Project

Navigate to and choose the settings.gradle file in this project

Press OK

Add your debug keystore to the project (save it as android/debug.keystore), or modify the build.gradle file to point to your key.

NOTE: In debug mode, you sign your app with a debug certificate generated by the Android SDK. (This certificate has a private key and a known password.) To sign your app in release mode, you need to generate your own certificate. If you haven't done so yet, please refer to the App Signing guide for further details. Also, if you wish to build with Android Wear support, for further details please refer to the guide Packaging Wearable Apps.

Choose Build > Make Project in Android Studio or run the following command in the project root directory:

./gradlew clean assembleDebug

To install on your test device:

./gradlew installDebug

Building without Android Wear

If you do NOT wish to build the Android Wear component, you need to make the two changes below.

Open android/build.gradle and remove (or comment out) the following line:wearApp project(":Wearable")

Open settings.gradle and remove ':Wearable', leaving only ':android'.

Server-side setup

NOTE: These steps are optional, in the sense that IOSched will build and run even if you don‘t set up the server side. However, unless you perform this setup, your build won’t be able to use any of the Google APIs such as Google sign in, Google Drive integration, Google Maps integration, etc. So following the instructions in this section is highly recommended.

Change the project's package name to your own package name. To do that, you can set the “package” attribute of the tag in AndroidManifest.xml.

Note your project's Project ID. It is a 11-12 digit sequence that appears in the URL; indicated by ########### below:

https://console.developers.google.com/project/###########/...

Write down this project ID number you will need it soon.

Navigate to “APIs and auth” > “APIs” and enable all of the following APIs:

Drive API

Google Cloud Messaging for Android

Google Maps Android API v2

Google+ API

YouTube Data API v3

Navigate to “APIs and auth” > “Credentials” and create a new Client ID for Android applications with the package name (as defined in AndroidManifest.xml in Step 1) and your debug certificate fingerprint. As a reminder, to get your debug certificate fingerprint, run the following command (on Windows, substitute %USERPROFILE% for $HOME):

NOTE: In order to create a Client ID, you might be required to set up the consent screen first! (That's the screen that will be shown to users whenever you request access to their private data using your Client ID.) To do so, go to “APIs and auth” > “Consent screen”, enter a “PRODUCT NAME” and click “Save”. Finally, go back to Step 5 to create your Client ID(s).

Still at the “Credentials” page, create an API Key for Public API access. As a key type use “Key for Android applications”, and you should add both your debug and release certificate fingerprints in the list of accepted certificates. Note the API key you created. (It's a long alphanumeric string that may contain digits, letters and underscores.)

Enter the API key from Step 6 into this file:

android/src/main/res/values/maps_api_key.xml

Enter the API key from Step 6, as a value for the YOUTUBE_API_KEY constant, into this file:

android/src/main/java/com/google/samples/apps/iosched/Config.java

Done. IOSched should now work with Google sign in, Google Drive and Maps integration. Note that we did NOT include setting up GCM. For more information about this, see the CUSTOM.md file.