12
12
See the License for the specific language governing permissions and
13
13
limitations under the License.
14
14
15
-
16
15
# How to build IOSched
17
16
18
- Note: while these instructions allow you to build iosched, much of the
19
- functionality that depends on server APIs won't work because in order to
20
- do that you need to configure your own project in Google Developer
21
- Console, create API keys, etc. For more information about what you
22
- need to set up, refer to [ Server side setup] ( #server-side-setup ) .
17
+ This is a Gradle-based project that works best with [ Android Studio] .
23
18
24
- This is a Gradle-based project that works best with
25
- [ Android Studio] ( http://developer.android.com/sdk/installing/studio.html )
19
+ <hr >
20
+ > __ Note I__ : While the instructions below allow you to build IOSched, much of
21
+ the functionality that depends on server APIs won't work because in order to
22
+ do that you need to configure your own project in Google Developer
23
+ Console (create API keys, etc). These additional steps required to set up,
24
+ are outlined in the [Server side setup] section in this document.
26
25
27
- > __ NOTE__ : Building the project as-is requires the Android Wear SDK, which you
28
- can download from http://developer.android.com/wear/. If you wish to build
29
- without Android Wear support, please refer to the [Building without Android
30
- Wear](#building-without-android-wear) section.
26
+ > __ NOTE II__ : Building the project as-is requires the Android Wear SDK, which
27
+ you can download from http://developer.android.com/wear/. If you NOT wish to
28
+ build with Android Wear support, further details can be found in the
29
+ [Building without Android Wear] section in this document.
30
+ <hr >
31
31
32
- To build the app:
32
+ ## Build the app
33
33
34
34
1 . Install the following software:
35
35
- Android SDK:
@@ -40,10 +40,9 @@ To build the app:
40
40
http://developer.android.com/sdk/installing/studio.html
41
41
42
42
2 . Run the Android SDK Manager by pressing the SDK Manager toolbar button
43
- in Android Studio or by running the ' android' command in a terminal
43
+ in Android Studio or by running the ` android ` command in a terminal
44
44
window.
45
45
46
-
47
46
3 . In the Android SDK Manager, ensure that the following are installed,
48
47
and are updated to the latest available version:
49
48
- Tools > Android SDK Platform-tools (rev 21 or above)
@@ -59,97 +58,118 @@ To build the app:
59
58
60
59
4 . Create a file in your working directory called local.properties,
61
60
containing the path to your Android SDK. Use local.properties.example as a
62
- model.
61
+ model. _ (On Windows, use a double-backslash (" \\ ") as a path separator.) _
63
62
64
63
5 . Import the project in Android Studio:
65
64
66
65
1 . Press File > Import Project
67
66
2 . Navigate to and choose the settings.gradle file in this project
68
67
3 . Press OK
69
68
70
- 6 . Add your debug keystore to the project (save it as android/debug.keystore),
69
+ 6 . Add your debug keystore to the project (save it as android/debug.keystore),
71
70
or modify the build.gradle file to point to your key.
72
71
73
- 7 . Choose Build > Make Project in Android Studio or run the following
72
+ > __ NOTE__ : In debug mode, you sign your app with a debug certificate generated
73
+ by the Android SDK. This certificate has a private key and a known password.
74
+ To sign your app in release mode, you need to generate your own certificate.
75
+ If you haven't done so, please refer to the [App Signing] guide for further
76
+ details. If you wish to build with Android Wear support, please refer to the
77
+ [Packaging Wearable Apps] guide for further details.
78
+
79
+ 7.A Choose Build > Make Project in Android Studio or run the following
74
80
command in the project root directory:
75
- ```
81
+ ``` sh
76
82
./gradlew clean assembleDebug
77
83
```
78
84
8 . To install on your test device:
79
85
80
- ```
86
+ ``` sh
81
87
./gradlew installDebug
82
88
```
83
89
84
-
85
90
## Building without Android Wear
86
91
87
- If you do not wish to build the Android Wear component, you can remove or
88
- comment out the following line on android/build.gradle:
89
-
92
+ If you do NOT wish to build the Android Wear component, you need to make the two
93
+ changes below.
94
+ 1. Open android/build.gradle and remove (or comment out) the following line:
95
+ ```
90
96
wearApp project(":Wearable")
91
-
92
- Also, remove ': Wearable ' from settings.gradle, leaving only ': android '.
93
-
97
+ ```
98
+ 2. Open settings.gradle and remove `':Wearable'`, leaving only `':android'`.
94
99
95
100
# Server-side setup
96
101
97
- These steps are optional, in the sense that IOSched will build and run
98
- even if you don't set up the server side. However, unless you perform
99
- this setup, your build won't be able to use any of the Google APIs
100
- such as Google sign in, Google Drive integration, Google Maps integration,
101
- etc. So following the instructions in this section is highly
102
- recommended.
102
+ These steps are optional, in the sense that IOSched will build and run even if
103
+ you don't set up the server side. However, unless you perform this setup, your
104
+ build won't be able to use any of the Google APIs such as Google sign in, Google
105
+ Drive integration, Google Maps integration, etc. So following the instructions
106
+ in this section is highly recommended.
103
107
104
- 0 . Change the project's package name to your own package name.
105
- To do that, you can set the "package" attribute of the <manifest >
106
- tag in AndroidManifest.xml.
108
+ 1 . Change the project's package name to your own package name. To do that, you
109
+ can set the "package" attribute of the <manifest > tag in AndroidManifest.xml.
107
110
108
- 1 . Create a project in the Google Developers Console,
109
- at https://cloud.google.com/console
111
+ 2 . Create a project in the Google Developers Console, at
112
+ https://cloud.google.com/console
110
113
111
- 2 . Note your project's Project ID. It is a 11-12 digit sequence
112
- that appears in the URL, indicated by ########### below:
114
+ 3 . Note your project's Project ID. It is a 11-12 digit sequence that appears in
115
+ the URL; indicated by ########### below:
113
116
```
114
117
https://console.developers.google.com/project/###########/ ...
115
118
```
116
119
Write down this project ID number you will need it soon.
117
120
118
- 3 . In the APIs and Auth section, enable these APIs:
121
+ 4 . Navigate to " APIs and auth" > "APIs" and enable all of the following APIs:
119
122
- Drive API
120
123
- Google Cloud Messaging for Android
121
124
- Google Maps Android API v2
122
125
- Google+ API
123
126
- YouTube Data API v3
124
127
125
- 4 . In the Credentials section, create a Client ID for Android applications
126
- with your package name and your certificate fingerprint. As a reminder,
127
- you can get your debug certificate fingerprint by issuing this command:
128
- ```
128
+ 5 . Navigate to "APIs and auth" > "Credentials" and create a new Client ID for
129
+ Android applications with the package name (as defined in AndroidManifest.xml in
130
+ Step 1) and your debug certificate fingerprint. As a reminder, to get your debug
131
+ certificate fingerprint, run the following command (on Windows, substitute
132
+ ` %USERPROFILE% ` for ` $HOME ` ):
133
+ ```sh
129
134
keytool -exportcert -alias androiddebugkey \
130
135
-keystore $HOME/.android/debug.keystore -list -v
131
136
```
132
- It's also advisable to create a Client ID corresponding to your release
137
+ It's also advisable to create a 2nd Client ID corresponding to your release
133
138
certificate as well. To get your release certificate's fingerprint, run:
134
- ```
139
+ ```sh
135
140
keytool -exportcert -alias your-key-name \
136
141
-keystore /path/to/your/release/keystore/file -list -v
137
142
```
138
-
139
- 5 . Still in the Credentials section, create an API Key for Public API
140
- access. The key's type is Key for Android applications, and you should
141
- add both your debug and release certificate fingerprints in the
142
- list of accepted certificates. Note the API key you created. It's
143
- a long alphanumeric string with digits, letters and with a
144
- few underscores.
145
-
146
- 6 . Enter your API Key from Step 5 into this file:
143
+ > __ NOTE__ : In order to create a Client ID, you might be required to set up the
144
+ consent screen first! _(The screen that will be shown to users whenever you
145
+ request access to their private data using your Client ID.)_ To do so, go to
146
+ "APIs and auth" > "Consent screen", enter a "PRODUCT NAME" and click "Save".
147
+ Finally, go back to Step 5 to create your Client ID(s).
148
+
149
+ 6 . Still at the "Credentials" page, create an API Key for Public API access.
150
+ As a key type use _ "Key for Android applications"_ , and you should add both your
151
+ debug and release certificate fingerprints in the list of accepted certificates.
152
+ Note the API key you created. _ (It's a long alphanumeric string that may contain
153
+ digits, letters and underscores.)_
154
+
155
+ 7 . Enter the API key from Step 6 into this file:
147
156
```
148
157
android/src/main/res/values/maps_api_key.xml
149
158
```
150
- 7. Enter your API key in the YOUTUBE_API_KEY constant in Config.java
151
-
152
- Done. IOSched should now work with Google sign in, Google Drive
153
- integration and Maps integration. Note that we did NOT include
154
- setting up GCM. For more information about this, see [CUSTOM.md](CUSTOM.md).
155
-
159
+ 8. Enter the API key from Step 6, as a value for the `YOUTUBE_API_KEY` constant,
160
+ into this file:
161
+ ```
162
+ android/src/main/java/com/google/samples/apps/iosched/Config.java
163
+ ```
164
+ <hr>
165
+
166
+ Done. IOSched should now work with Google sign in, Google Drive and Maps
167
+ integration. Note that we did NOT include setting up GCM. For more information
168
+ about this, see the [CUSTOM.md] file.
169
+
170
+ [Android Studio]:http://developer.android.com/sdk/installing/studio.html
171
+ [App Signing]:http://developer.android.com/tools/publishing/app-signing.html#studio
172
+ [Building without Android Wear]:https://github.com/google/iosched/blob/master/doc/BUILDING.md#building-without-android-wear
173
+ [CUSTOM.md]:https://github.com/google/iosched/blob/master/doc/CUSTOM.md
174
+ [Packaging Wearable Apps]:http://developer.android.com/training/wearables/apps/packaging.html
175
+ [Server side setup]:https://github.com/google/iosched/blob/master/doc/BUILDING.md#server-side-setup
0 commit comments