Upgrade to Pro — share decks privately, control downloads, hide ads and more …

New to Android StudioI

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →
Avatar for Engine Bai Engine Bai
January 22, 2015

New to Android StudioI

Introduction to Android Studio.

Avatar for Engine Bai

Engine Bai

January 22, 2015

Other Decks in Technology

Transcript

  1. ANDROID STUDIO IS … • Google official Android IDE •

    Based on IntelliJ IDEA • Gradle-based build system • Code templates • Rich layout editor
  2. TOOLS ATTRIBUTES • In xml file, add namespace. • xmlns:tools:“http://schemas.android.com/tools”

    • Add to layout editor • tools:context • tools:text • tools:listitem / listheader / listfooter
  3. TOOLS ATTRIBUTES • In xml file, add namespace. • xmlns:tools:“http://schemas.android.com/tools”

    • Add to layout editor • tools:context • tools:text • tools:listitem / listheader / listfooter
  4. TOOLS ATTRIBUTES • In xml file, add namespace. • xmlns:tools:“http://schemas.android.com/tools”

    • Add to layout editor • tools:context • tools:text • tools:listitem / listheader / listfooter
  5. TOOLS ATTRIBUTES • In xml file, add namespace. • xmlns:tools:“http://schemas.android.com/tools”

    • Add to layout editor • tools:context • tools:text • tools:listitem / listheader / listfooter
  6. TOOLS ATTRIBUTES • In xml file, add namespace. • xmlns:tools:“http://schemas.android.com/tools”

    • Add to layout editor • tools:context • tools:text • tools:listitem / listheader / listfooter
  7. PROJECT VS MODULE • Project is … • A complete

    android app. • Contains module(s).
  8. PROJECT VS MODULE • Module is … • A component

    which can build, test or debug independently. • Three types of modules: • Java library • Android library • Android application
  9. PROJECT STRUCTURES • <project>/ • app/ • src/main/java… • build.gradle

    • library1/ • src/main/java… • build.gradle • build.gradle • settings.gradle
  10. PROJECT STRUCTURES • <project>/ • app/ • src/main/java… • build.gradle

    • library1/ • src/main/java… • build.gradle • build.gradle • settings.gradle
  11. TOP LEVEL SETTINGS.GRADLE • Tell Gradle which modules to build.

    • include ‘:app’ • include ‘:library1’ • project(‘:library1’).projectDir = new File(‘other/place/on/the/computer’)
  12. MODULE BUILD.GRADLE • One module, one build.gradle file. • Define

    android specific, dependencies settings etc.
  13. DEPENDENCIES • Module • compile project(‘:library1’) • Local • compile

    files(‘libs/gson.jar’) • compile fileTree(dir:’libs’, include:[‘*.jar’]) • Remote • compile ‘com.android.support:support-v4:21.0.3’