new to android studio
TRANSCRIPT
ANDROID STUDIO IS …• Google official Android IDE
• Based on IntelliJ IDEA
• Gradle-based build system
• Code templates
• Rich layout editor
TIPS & TRICKS
• Keymap commands
• Plugins
• Help -> Productivity Guide
• More on Tips and Tricks
LAYOUT 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
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
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
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
PROJECT VS MODULE
• Module is …
• A component which can build, test or debug independently.
• Three types of modules:
• Java library
• Android library
• Android application
PROJECT STRUCTURES• <project>/
• app/
• src/main/java…
• build.gradle
• library1/
• src/main/java…
• build.gradle
• build.gradle
• settings.gradle
PROJECT STRUCTURES• <project>/
• app/
• src/main/java…
• build.gradle
• library1/
• src/main/java…
• build.gradle
• build.gradle
• settings.gradle
TOP LEVEL SETTINGS.GRADLE
• Tell Gradle which modules to build.
• include ‘:app’
• include ‘:library1’
• project(‘:library1’).projectDir = new File(‘other/place/on/the/computer’)
MODULE BUILD.GRADLE
• One module, one build.gradle file.
• Define android specific, dependencies settings etc.
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’