Android Material Design Codelab Setup
Duration: 0:45
Environment: Web
1. Download Android Studio.
2. Install SDK packages.
3. Create a new Project in Android Studio
a. Open Android Studio.
b. Select “Start a new Android Studio project”.
c. Fill out the “Configure your new project” form and click “Next”.
d. Select the form factors your app will run
i. Select the “Phone and Tablet” checkbox.
ii. Set Minimum SDK to API 21: Android 5.0 (Lollipop) or higher.
iii. Click “Next”
e. Add “Blank Activity” to mobile and customize the names as needed after
clicking “Next”.
f. Click “Finish”.
g. Resolve any build errors in the Intellij IDE that opens up.
h. Update build.gradle file to use v22 SDK and Android Design Support Library.
i. Sync and run your project:
i. Click Run from the toolbar.
ii. In the “Choose Device” menu, select “Launch emulator” and set
“Android virtual device” to “Nexus 5 API 22 x86” (the one installed in
step #2).
iii. Click “OK” to run.
iv. Ensure that emulator starts up correctly and that there are no error in
the IDE log.
j. Congrats! You’re done with the setup and now ready to begin the codelab.
Update build.gradle file to use v22 SDK and AppCompat Library
build.gradle
apply plugin: 'com.android.application'
android {
2
compileSdkVersion 2
buildToolsVersion " 22.0.1"
defaultConfig {
applicationId "com.example.onome.demoapp"
minSdkVersion 21
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:design:22.2.1'
compile 'com.android.support:cardview-v7:22.2.1'
compile 'com.android.support:palette-v7:22.2.1'
compile 'com.android.support:recyclerview-v7:22.2.1'
}