SlideShare a Scribd company logo
1 of 29
行動APP開發管理實務
如何開發Android應用程式
開發準備、基本控制項、Layout
尹君耀 Xavier Yin
Outline
 開發App的事前準備
 Project Structure
 練習1
 基本控制項
 Intent
 Layout
 練習2
事前準備
 建立應用程式的基本資訊
– 決定開發版本
– 決定欲使用的Android設備
– 考量所需使用的硬體設備資訊
(AndroidManifest.xml)
 應用程式的需求分析與規劃
– 功能需求
– 介面
 應用程式的資源
– 文字或文案、顏色、尺寸、動畫、
圖片、畫面、樣式、音樂或影片、
檔案…等等。
事前準備
 Android開發環境
– JDK
 Download JDK (or from Oracle)
 Installation and Environment Variable Settings
– JAVA_HOME
– PATH
– Installation result on cmd
– Android SDK and Studio
 Download Android SDK and Studio (or from Android Developer)
 Installation
– Launch the .exe file you just downloaded
– Follow the setup wizard
事前準備
 撰寫應用程式
 測試和安裝
– Real Devices
– Emulator
 AVD
 Genymotion
Project Structure
 /app
– /src
 /main/java
– /your_package_name (ex: /com/tku/android -> com.tku.android)
 Java files
– AndroidManifest.xml
 /androidTest(For Android Test)
– /java/your_package_name
 Test cases
 /res
– /drawable
– /layout
– /values
 colors.xml, dimens.xml, strings.xml, styles.xml…etc.
 build.gradle
App Manifest
 Manifest file
– The manifest file presents essential information about your app to the
Android system, information the system must have before it can run
any of the app's code.
 Permission
– A basic Android application has no permissions associated with it by
default, meaning it cannot do anything that would adversely impact
the user experience or any data on the device.
– To make use of protected features of the device, you must include in
your AndroidManifest.xml one or more <uses-permission> tags
declaring the permissions that your application needs.
App Manifest
Resources
 系統資源
– android.R.anim – 系統動畫資源。
– android.R.color – 系統顏色狀態資源。
– android.R.dimen – 系統尺寸資源。
– android.R.drawable – 系統圖形與繪圖資源。
– android.R.layout – 系統畫面配置資源。
– android.R.menu – 系統選單資源。
– android.R.string – 系統文字資源。
– android.R.style – 系統樣式資源。
 一般資源
– strings.xml – 文字資源。
– colors.xml – 顏色資源。
– dimens.xml – 尺寸資源。
– arrays.xml – 陣列資源。
– styles.xml – 樣式資源。
Dimens
 DPI (Dots Per Inch)
– The quantity of pixels within a physical area of the screen; usually
referred to as dpi (dots per inch).
Dimens
 PX, DPI and DP(DIP)
– Icon size = 160px
 MDPI -> 160px/160dpi = 1 inch
 XHDPI -> 160px/320dpi = 0.5 inch
– Icon size = 160dp -> px = dp * (dpi / 160 )
 MDPI -> px = 160 * ( 160dpi / 160dpi ) , px = 160
 XHDPI -> px = 160 * ( 320dpi / 160dpi) , px = 320
Dimens
 Suggestions
– Because it's important that you design and implement your layouts for
multiple densities, the guidelines below and throught the
documentation refer to layout dimensions with dp measurements
instead of pixels.
– Similarly, you should prefer the sp (scale-independent pixel) to define
text sizes. The sp scale factor depends on a user setting and the system
scales the size the same as it does for dp.
練習1
 請依照開發「App的事前準備」章節的步驟,討論並設計一個資料查詢App。
討論項目如下,並上台解說:
– App的需求(至少三種功能性需求與資料來源為何)
– App介面
– 資源
 系統資源
 一般資源
– 控制項與Layout
– 實作技術,範例如下:
 Volley與Gson – 使用目的為何?
 資料庫 – 在何種頁面應用?
 演算法 - 何種情境或設計中使用 ?
基本元件
 Activity
 Service
 BroadcastReceiver
 ContentProvider
控制項
 View class
– This class represents the basic
building block for user interface
components.
 ViewGroup class
– The ViewGroup subclass is the base
class for layouts, which are invisible
containers that hold other Views (or
other ViewGroups) and define their
layout properties.
控制項
 View class
– This class represents the basic
building block for user interface
components.
 ViewGroup class
– The ViewGroup subclass is the base
class for layouts, which are invisible
containers that hold other Views (or
other ViewGroups) and define their
layout properties.
TextView and EditText
 TextView
– Displays text to the user and
optionally allows them to edit
it.
 EditText
– EditText is a thin veneer over
TextView that configures itself
to be editable.
TextView and EditText
 TextView
– Displays text to the user and
optionally allows them to edit
it.
 EditText
– EditText is a thin veneer over
TextView that configures itself
to be editable.
Intent
 Android 中的 Intent 非常好用,整個
Android 的架構最大的特色可以說就建構
在 Intent 上,您可以利用類似 URL 的
Intent 啟動任何一個程式的任何一個畫面。
LinearLayout
 android:orientation -
setOrientation(int)
– Should the layout be a column
or a row? Use "horizontal" for a
row, "vertical" for a column.
 android:gravity -
setGravity(int)
– Specifies how an object should
position its content, on both
the X and Y axes, within its own
bounds.
LinearLayout
 Practice
Horizontal Vertical & Horizontal
FrameLayout
 Practice
RelativeLayout
 android:layout_above, android:layout_below
– Positions the bottom edge of this view above or below the given anchor view ID.
 android:layout_alignParentBottom, android:layout_alignParentLeft,
android:layout_alignParentRight, android:layout_alignParentTop
– If true, makes the edge of this view match the edge you assign of the parent.
 android:layout_toLeftOf, android:layout_toRightOf
– Positions the right edge of this view to the left or right of the given anchor view
ID.
 android:layout_centerInParent
– If true, centers this child horizontally and vertically within its parent.
RelativeLayout
 Practice
練習
練習
 Create a new project
– Empty project
 Define resources that you need
– Colors.xml, dimens.xml, strings.xml, styles.xml, drawable
 Prepare Layout files
– Add Android Resource Directory named layout within res folder
– Add a layout.xml
 LinearLayout
練習
 Bind the above files with your java files
– Activity
 SetContentView()
 FindViewById()
 Define App Manifest file
– Intent
 Launch your App in a device
Sample Code and Slides
 Slides
– http://www.slideshare.net/XavierYin/tkuappandroid
 Sample Code
– https://github.com/xavier0507/TKUInforTableSampleCode
References
 CodeData:
– http://www.codedata.com.tw/mobile/android-6-tutorial-1-4/
– http://www.codedata.com.tw/mobile/android-6-tutorial-2-1/
 Android developers:
– http://developer.android.com/design/index.html
 陳鍾誠的網站
– http://ccckmit.wikidot.com/ga:intentexample

More Related Content

Similar to Tku-行動app開發管理實務-如何開發Android應用程式

Android training day 3
Android training day 3Android training day 3
Android training day 3Vivek Bhusal
 
Deep Dive Xamarin.Android
Deep Dive Xamarin.AndroidDeep Dive Xamarin.Android
Deep Dive Xamarin.AndroidBenjamin Bishop
 
Everything About Android - Itvedant, Thane | Mumbai | Navi Mumbai
Everything About Android - Itvedant, Thane | Mumbai | Navi Mumbai Everything About Android - Itvedant, Thane | Mumbai | Navi Mumbai
Everything About Android - Itvedant, Thane | Mumbai | Navi Mumbai Itvedant
 
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...Ted Chien
 
Module-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptxModule-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptxlancelotlaytan1996
 
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...DicodingEvent
 
Android Development : (Android Studio, PHP, XML, MySQL)
Android Development : (Android Studio, PHP, XML, MySQL)Android Development : (Android Studio, PHP, XML, MySQL)
Android Development : (Android Studio, PHP, XML, MySQL)Kavya Barnadhya Hazarika
 
Technology and Android.pptx
Technology and Android.pptxTechnology and Android.pptx
Technology and Android.pptxmuthulakshmi cse
 
Day: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentDay: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentAhsanul Karim
 
6. Chapter 5 - Component In React Navite.pptx
6. Chapter 5 - Component In React Navite.pptx6. Chapter 5 - Component In React Navite.pptx
6. Chapter 5 - Component In React Navite.pptxTngTrngKhnh1
 
mobile application development -unit-3-
mobile application development  -unit-3-mobile application development  -unit-3-
mobile application development -unit-3-TejamFandat
 
Google Associate Android Developer Certification
Google Associate Android Developer CertificationGoogle Associate Android Developer Certification
Google Associate Android Developer CertificationMonir Zzaman
 
A workstation that runs demanding design and engineering apps and can hide on...
A workstation that runs demanding design and engineering apps and can hide on...A workstation that runs demanding design and engineering apps and can hide on...
A workstation that runs demanding design and engineering apps and can hide on...Principled Technologies
 
Mobile/Web App Development Project Report
Mobile/Web App Development Project ReportMobile/Web App Development Project Report
Mobile/Web App Development Project ReportAbubakr Cheema
 
Real World ionic Development
Real World ionic DevelopmentReal World ionic Development
Real World ionic DevelopmentChris Griffith
 

Similar to Tku-行動app開發管理實務-如何開發Android應用程式 (20)

Android training day 3
Android training day 3Android training day 3
Android training day 3
 
Deep Dive Xamarin.Android
Deep Dive Xamarin.AndroidDeep Dive Xamarin.Android
Deep Dive Xamarin.Android
 
Everything About Android - Itvedant, Thane | Mumbai | Navi Mumbai
Everything About Android - Itvedant, Thane | Mumbai | Navi Mumbai Everything About Android - Itvedant, Thane | Mumbai | Navi Mumbai
Everything About Android - Itvedant, Thane | Mumbai | Navi Mumbai
 
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
 
Ab initio training Ab-initio Architecture
Ab initio training Ab-initio ArchitectureAb initio training Ab-initio Architecture
Ab initio training Ab-initio Architecture
 
Introducing J2ME Polish
Introducing J2ME PolishIntroducing J2ME Polish
Introducing J2ME Polish
 
hema ppt (2).pptx
hema ppt (2).pptxhema ppt (2).pptx
hema ppt (2).pptx
 
Module-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptxModule-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptx
 
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...
 
divide and qonquer
divide and qonquerdivide and qonquer
divide and qonquer
 
Android_PDF
Android_PDFAndroid_PDF
Android_PDF
 
Android Development : (Android Studio, PHP, XML, MySQL)
Android Development : (Android Studio, PHP, XML, MySQL)Android Development : (Android Studio, PHP, XML, MySQL)
Android Development : (Android Studio, PHP, XML, MySQL)
 
Technology and Android.pptx
Technology and Android.pptxTechnology and Android.pptx
Technology and Android.pptx
 
Day: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentDay: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application Development
 
6. Chapter 5 - Component In React Navite.pptx
6. Chapter 5 - Component In React Navite.pptx6. Chapter 5 - Component In React Navite.pptx
6. Chapter 5 - Component In React Navite.pptx
 
mobile application development -unit-3-
mobile application development  -unit-3-mobile application development  -unit-3-
mobile application development -unit-3-
 
Google Associate Android Developer Certification
Google Associate Android Developer CertificationGoogle Associate Android Developer Certification
Google Associate Android Developer Certification
 
A workstation that runs demanding design and engineering apps and can hide on...
A workstation that runs demanding design and engineering apps and can hide on...A workstation that runs demanding design and engineering apps and can hide on...
A workstation that runs demanding design and engineering apps and can hide on...
 
Mobile/Web App Development Project Report
Mobile/Web App Development Project ReportMobile/Web App Development Project Report
Mobile/Web App Development Project Report
 
Real World ionic Development
Real World ionic DevelopmentReal World ionic Development
Real World ionic Development
 

More from Xavier Yin

UI/UX - 別讓我思考
UI/UX - 別讓我思考UI/UX - 別讓我思考
UI/UX - 別讓我思考Xavier Yin
 
機器學習與資料探勘:決策樹
機器學習與資料探勘:決策樹機器學習與資料探勘:決策樹
機器學習與資料探勘:決策樹Xavier Yin
 
Test automation
Test automationTest automation
Test automationXavier Yin
 
Tku-網路資料的串接與資料儲存
Tku-網路資料的串接與資料儲存Tku-網路資料的串接與資料儲存
Tku-網路資料的串接與資料儲存Xavier Yin
 
Material design - widgets and sample code
Material design - widgets and sample codeMaterial design - widgets and sample code
Material design - widgets and sample codeXavier Yin
 
Material design introduction
Material design introductionMaterial design introduction
Material design introductionXavier Yin
 

More from Xavier Yin (6)

UI/UX - 別讓我思考
UI/UX - 別讓我思考UI/UX - 別讓我思考
UI/UX - 別讓我思考
 
機器學習與資料探勘:決策樹
機器學習與資料探勘:決策樹機器學習與資料探勘:決策樹
機器學習與資料探勘:決策樹
 
Test automation
Test automationTest automation
Test automation
 
Tku-網路資料的串接與資料儲存
Tku-網路資料的串接與資料儲存Tku-網路資料的串接與資料儲存
Tku-網路資料的串接與資料儲存
 
Material design - widgets and sample code
Material design - widgets and sample codeMaterial design - widgets and sample code
Material design - widgets and sample code
 
Material design introduction
Material design introductionMaterial design introduction
Material design introduction
 

Recently uploaded

This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 

Recently uploaded (20)

This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 

Tku-行動app開發管理實務-如何開發Android應用程式

  • 2. Outline  開發App的事前準備  Project Structure  練習1  基本控制項  Intent  Layout  練習2
  • 3. 事前準備  建立應用程式的基本資訊 – 決定開發版本 – 決定欲使用的Android設備 – 考量所需使用的硬體設備資訊 (AndroidManifest.xml)  應用程式的需求分析與規劃 – 功能需求 – 介面  應用程式的資源 – 文字或文案、顏色、尺寸、動畫、 圖片、畫面、樣式、音樂或影片、 檔案…等等。
  • 4. 事前準備  Android開發環境 – JDK  Download JDK (or from Oracle)  Installation and Environment Variable Settings – JAVA_HOME – PATH – Installation result on cmd – Android SDK and Studio  Download Android SDK and Studio (or from Android Developer)  Installation – Launch the .exe file you just downloaded – Follow the setup wizard
  • 5. 事前準備  撰寫應用程式  測試和安裝 – Real Devices – Emulator  AVD  Genymotion
  • 6. Project Structure  /app – /src  /main/java – /your_package_name (ex: /com/tku/android -> com.tku.android)  Java files – AndroidManifest.xml  /androidTest(For Android Test) – /java/your_package_name  Test cases  /res – /drawable – /layout – /values  colors.xml, dimens.xml, strings.xml, styles.xml…etc.  build.gradle
  • 7. App Manifest  Manifest file – The manifest file presents essential information about your app to the Android system, information the system must have before it can run any of the app's code.  Permission – A basic Android application has no permissions associated with it by default, meaning it cannot do anything that would adversely impact the user experience or any data on the device. – To make use of protected features of the device, you must include in your AndroidManifest.xml one or more <uses-permission> tags declaring the permissions that your application needs.
  • 9. Resources  系統資源 – android.R.anim – 系統動畫資源。 – android.R.color – 系統顏色狀態資源。 – android.R.dimen – 系統尺寸資源。 – android.R.drawable – 系統圖形與繪圖資源。 – android.R.layout – 系統畫面配置資源。 – android.R.menu – 系統選單資源。 – android.R.string – 系統文字資源。 – android.R.style – 系統樣式資源。  一般資源 – strings.xml – 文字資源。 – colors.xml – 顏色資源。 – dimens.xml – 尺寸資源。 – arrays.xml – 陣列資源。 – styles.xml – 樣式資源。
  • 10. Dimens  DPI (Dots Per Inch) – The quantity of pixels within a physical area of the screen; usually referred to as dpi (dots per inch).
  • 11. Dimens  PX, DPI and DP(DIP) – Icon size = 160px  MDPI -> 160px/160dpi = 1 inch  XHDPI -> 160px/320dpi = 0.5 inch – Icon size = 160dp -> px = dp * (dpi / 160 )  MDPI -> px = 160 * ( 160dpi / 160dpi ) , px = 160  XHDPI -> px = 160 * ( 320dpi / 160dpi) , px = 320
  • 12. Dimens  Suggestions – Because it's important that you design and implement your layouts for multiple densities, the guidelines below and throught the documentation refer to layout dimensions with dp measurements instead of pixels. – Similarly, you should prefer the sp (scale-independent pixel) to define text sizes. The sp scale factor depends on a user setting and the system scales the size the same as it does for dp.
  • 13. 練習1  請依照開發「App的事前準備」章節的步驟,討論並設計一個資料查詢App。 討論項目如下,並上台解說: – App的需求(至少三種功能性需求與資料來源為何) – App介面 – 資源  系統資源  一般資源 – 控制項與Layout – 實作技術,範例如下:  Volley與Gson – 使用目的為何?  資料庫 – 在何種頁面應用?  演算法 - 何種情境或設計中使用 ?
  • 14. 基本元件  Activity  Service  BroadcastReceiver  ContentProvider
  • 15. 控制項  View class – This class represents the basic building block for user interface components.  ViewGroup class – The ViewGroup subclass is the base class for layouts, which are invisible containers that hold other Views (or other ViewGroups) and define their layout properties.
  • 16. 控制項  View class – This class represents the basic building block for user interface components.  ViewGroup class – The ViewGroup subclass is the base class for layouts, which are invisible containers that hold other Views (or other ViewGroups) and define their layout properties.
  • 17. TextView and EditText  TextView – Displays text to the user and optionally allows them to edit it.  EditText – EditText is a thin veneer over TextView that configures itself to be editable.
  • 18. TextView and EditText  TextView – Displays text to the user and optionally allows them to edit it.  EditText – EditText is a thin veneer over TextView that configures itself to be editable.
  • 19. Intent  Android 中的 Intent 非常好用,整個 Android 的架構最大的特色可以說就建構 在 Intent 上,您可以利用類似 URL 的 Intent 啟動任何一個程式的任何一個畫面。
  • 20. LinearLayout  android:orientation - setOrientation(int) – Should the layout be a column or a row? Use "horizontal" for a row, "vertical" for a column.  android:gravity - setGravity(int) – Specifies how an object should position its content, on both the X and Y axes, within its own bounds.
  • 23. RelativeLayout  android:layout_above, android:layout_below – Positions the bottom edge of this view above or below the given anchor view ID.  android:layout_alignParentBottom, android:layout_alignParentLeft, android:layout_alignParentRight, android:layout_alignParentTop – If true, makes the edge of this view match the edge you assign of the parent.  android:layout_toLeftOf, android:layout_toRightOf – Positions the right edge of this view to the left or right of the given anchor view ID.  android:layout_centerInParent – If true, centers this child horizontally and vertically within its parent.
  • 26. 練習  Create a new project – Empty project  Define resources that you need – Colors.xml, dimens.xml, strings.xml, styles.xml, drawable  Prepare Layout files – Add Android Resource Directory named layout within res folder – Add a layout.xml  LinearLayout
  • 27. 練習  Bind the above files with your java files – Activity  SetContentView()  FindViewById()  Define App Manifest file – Intent  Launch your App in a device
  • 28. Sample Code and Slides  Slides – http://www.slideshare.net/XavierYin/tkuappandroid  Sample Code – https://github.com/xavier0507/TKUInforTableSampleCode
  • 29. References  CodeData: – http://www.codedata.com.tw/mobile/android-6-tutorial-1-4/ – http://www.codedata.com.tw/mobile/android-6-tutorial-2-1/  Android developers: – http://developer.android.com/design/index.html  陳鍾誠的網站 – http://ccckmit.wikidot.com/ga:intentexample