introduction to android studio
DESCRIPTION
Michael's Android LessonTRANSCRIPT
![Page 1: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/1.jpg)
Android Studio - IntroductionMichael Pan
![Page 2: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/2.jpg)
Why Android StudioMost advanced IDE
Google Official support
Current version 0.51Hi, I am Android Studio
![Page 3: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/3.jpg)
Downloadhttp://developer.android.com/sdk/installing/studio.html
![Page 4: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/4.jpg)
Open & Launch
![Page 5: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/5.jpg)
New Project
![Page 6: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/6.jpg)
Blank Activity
![Page 7: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/7.jpg)
Activity & Layout
![Page 8: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/8.jpg)
Waiting
![Page 9: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/9.jpg)
Overview
![Page 10: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/10.jpg)
Project View
![Page 11: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/11.jpg)
Editor View
![Page 12: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/12.jpg)
Editor Tab - File name
![Page 13: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/13.jpg)
Import folders & files
src/ main/ java/ res/ layout/ values/ AndroidManifest.xml
![Page 14: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/14.jpg)
UI Layout - activity_record.xml
![Page 15: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/15.jpg)
UILayout - Design
![Page 16: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/16.jpg)
Design View
Components
Preview Hierarchy
Attributes
![Page 17: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/17.jpg)
Create a new Class - Project Window
![Page 18: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/18.jpg)
Source
![Page 19: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/19.jpg)
Record.javapublic class Record {! String description;! int type;! int cost;!}
![Page 20: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/20.jpg)
How about getter & setterAndroid Studio Tool
![Page 21: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/21.jpg)
Record.javapublic class Record {! String description;! int type;! int cost;!!
public String getDescription() {! return description;! }!!
public void setDescription(String description) {! this.description = description;! }!}
![Page 22: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/22.jpg)
Repeat steps on other fields
![Page 23: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/23.jpg)
But how about naming conventionpublic class Record {! String mDescription;! int mType;! int mCost;!}
![Page 24: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/24.jpg)
Getter & Setter public class Record {! String mDescription;! int mType;! int mCost;!!
public String getmDescription() {! return mDescription;! }!!
public void setmDescription(String mDescription) {! this.mDescription = mDescription;! }!}
Not good
![Page 25: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/25.jpg)
Preferences - Code Style -> Java
![Page 26: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/26.jpg)
Code Generation
![Page 27: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/27.jpg)
Generate it againpublic class Record {! String mDescription;! int mType;! int mCost;!!
public String getDescription() {! return mDescription;! }!!
public void setDescription(String description) {! mDescription = description;! }!}
![Page 28: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/28.jpg)
Run the EmulatorCreate Emulator first
Reference http://developer-s-note-blog.logdown.com/posts/98744-hello-android-studio
![Page 29: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/29.jpg)
Start Genymotion
![Page 30: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/30.jpg)
Run the app
![Page 31: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/31.jpg)
Hello World
![Page 32: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/32.jpg)
開發者選項設定
點擊 Build Number 7 次
出現開發者項⺫⽬目
![Page 33: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/33.jpg)
USB Debugging Enable
![Page 34: Introduction to Android Studio](https://reader031.vdocuments.site/reader031/viewer/2022012312/554f7809b4c905d25b8b45e4/html5/thumbnails/34.jpg)
Question