Submit Search
Upload
Android - Build User Interface
•
2 likes
•
934 views
MingHo Chang
Follow
2014《聯合大學 - 行動應用》講課簡報 Build user interface on Android. 建立Android App的使用者界面。
Read less
Read more
Technology
Report
Share
Report
Share
1 of 46
Recommended
Angular material
Angular material
Kalpesh Satasiya
Angular material tutorial
Angular material tutorial
HarikaReddy115
User interface customization for aem6 circuit
User interface customization for aem6 circuit
Damien Antipa
User Interface customization for AEM 6
User Interface customization for AEM 6
Damien Antipa
Building Creative Product Extensions with Experience Manager
Building Creative Product Extensions with Experience Manager
Justin Edelson
AEM 6.0 Touch-optimized UI
AEM 6.0 Touch-optimized UI
Gilles Knobloch
UI Customization in AEM 6.0
UI Customization in AEM 6.0
Gilles Knobloch
AEM 6.1 User Interface Customization
AEM 6.1 User Interface Customization
Christian Meyer
Recommended
Angular material
Angular material
Kalpesh Satasiya
Angular material tutorial
Angular material tutorial
HarikaReddy115
User interface customization for aem6 circuit
User interface customization for aem6 circuit
Damien Antipa
User Interface customization for AEM 6
User Interface customization for AEM 6
Damien Antipa
Building Creative Product Extensions with Experience Manager
Building Creative Product Extensions with Experience Manager
Justin Edelson
AEM 6.0 Touch-optimized UI
AEM 6.0 Touch-optimized UI
Gilles Knobloch
UI Customization in AEM 6.0
UI Customization in AEM 6.0
Gilles Knobloch
AEM 6.1 User Interface Customization
AEM 6.1 User Interface Customization
Christian Meyer
Android - Intents and Broadcast Receivers
Android - Intents and Broadcast Receivers
MingHo Chang
Embracing the Lollipop
Embracing the Lollipop
Sonja Kesic
Android Workshop
Android Workshop
Junda Ong
Material Design (The Technical Essentials) by Mohammad Aljobairi @AMMxDROID
Material Design (The Technical Essentials) by Mohammad Aljobairi @AMMxDROID
Jordan Open Source Association
Android Materials Design
Android Materials Design
Mohammad Aljobairi
Testdrive AngularJS with Spring 4
Testdrive AngularJS with Spring 4
Oliver Wahlen
Android Development project
Android Development project
Minhaj Kazi
Beginning Native Android Apps
Beginning Native Android Apps
Gil Irizarry
Getting Started With Material Design
Getting Started With Material Design
Yasin Yildirim
Geekcamp Android
Geekcamp Android
Hean Hong Leong
ProTips DroidCon Paris 2013
ProTips DroidCon Paris 2013
Mathias Seguy
A resource oriented framework using the DI/AOP/REST triangle
A resource oriented framework using the DI/AOP/REST triangle
Akihito Koriyama
Compose In Practice
Compose In Practice
Kelvin Harron
Building interactive app
Building interactive app
Omar Albelbaisy
Android programming basics
Android programming basics
Egerton University
Native Android Development Practices
Native Android Development Practices
Roy Clarkson
Angular 4 Components | Angular 4 Tutorial For Beginners | Learn Angular 4 | E...
Angular 4 Components | Angular 4 Tutorial For Beginners | Learn Angular 4 | E...
Edureka!
pebble - Building apps on pebble
pebble - Building apps on pebble
Aniruddha Chakrabarti
Android Development Made Easy - With Sample Project
Android Development Made Easy - With Sample Project
Joemarie Amparo
Fernando F. Gallego - Efficient Android Resources 101
Fernando F. Gallego - Efficient Android Resources 101
Fernando Gallego
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
wesley chun
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
More Related Content
Similar to Android - Build User Interface
Android - Intents and Broadcast Receivers
Android - Intents and Broadcast Receivers
MingHo Chang
Embracing the Lollipop
Embracing the Lollipop
Sonja Kesic
Android Workshop
Android Workshop
Junda Ong
Material Design (The Technical Essentials) by Mohammad Aljobairi @AMMxDROID
Material Design (The Technical Essentials) by Mohammad Aljobairi @AMMxDROID
Jordan Open Source Association
Android Materials Design
Android Materials Design
Mohammad Aljobairi
Testdrive AngularJS with Spring 4
Testdrive AngularJS with Spring 4
Oliver Wahlen
Android Development project
Android Development project
Minhaj Kazi
Beginning Native Android Apps
Beginning Native Android Apps
Gil Irizarry
Getting Started With Material Design
Getting Started With Material Design
Yasin Yildirim
Geekcamp Android
Geekcamp Android
Hean Hong Leong
ProTips DroidCon Paris 2013
ProTips DroidCon Paris 2013
Mathias Seguy
A resource oriented framework using the DI/AOP/REST triangle
A resource oriented framework using the DI/AOP/REST triangle
Akihito Koriyama
Compose In Practice
Compose In Practice
Kelvin Harron
Building interactive app
Building interactive app
Omar Albelbaisy
Android programming basics
Android programming basics
Egerton University
Native Android Development Practices
Native Android Development Practices
Roy Clarkson
Angular 4 Components | Angular 4 Tutorial For Beginners | Learn Angular 4 | E...
Angular 4 Components | Angular 4 Tutorial For Beginners | Learn Angular 4 | E...
Edureka!
pebble - Building apps on pebble
pebble - Building apps on pebble
Aniruddha Chakrabarti
Android Development Made Easy - With Sample Project
Android Development Made Easy - With Sample Project
Joemarie Amparo
Fernando F. Gallego - Efficient Android Resources 101
Fernando F. Gallego - Efficient Android Resources 101
Fernando Gallego
Similar to Android - Build User Interface
(20)
Android - Intents and Broadcast Receivers
Android - Intents and Broadcast Receivers
Embracing the Lollipop
Embracing the Lollipop
Android Workshop
Android Workshop
Material Design (The Technical Essentials) by Mohammad Aljobairi @AMMxDROID
Material Design (The Technical Essentials) by Mohammad Aljobairi @AMMxDROID
Android Materials Design
Android Materials Design
Testdrive AngularJS with Spring 4
Testdrive AngularJS with Spring 4
Android Development project
Android Development project
Beginning Native Android Apps
Beginning Native Android Apps
Getting Started With Material Design
Getting Started With Material Design
Geekcamp Android
Geekcamp Android
ProTips DroidCon Paris 2013
ProTips DroidCon Paris 2013
A resource oriented framework using the DI/AOP/REST triangle
A resource oriented framework using the DI/AOP/REST triangle
Compose In Practice
Compose In Practice
Building interactive app
Building interactive app
Android programming basics
Android programming basics
Native Android Development Practices
Native Android Development Practices
Angular 4 Components | Angular 4 Tutorial For Beginners | Learn Angular 4 | E...
Angular 4 Components | Angular 4 Tutorial For Beginners | Learn Angular 4 | E...
pebble - Building apps on pebble
pebble - Building apps on pebble
Android Development Made Easy - With Sample Project
Android Development Made Easy - With Sample Project
Fernando F. Gallego - Efficient Android Resources 101
Fernando F. Gallego - Efficient Android Resources 101
Recently uploaded
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
wesley chun
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Deepika Singh
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
DianaGray10
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
ThousandEyes
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
apidays
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
rafiqahmad00786416
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
The Digital Insurer
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
apidays
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
apidays
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
sammart93
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
The Digital Insurer
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Juan lago vázquez
Architecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
Khem
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
apidays
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
apidays
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
The Digital Insurer
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
Overkill Security
Recently uploaded
(20)
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Architecting Cloud Native Applications
Architecting Cloud Native Applications
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
Android - Build User Interface
1.
Build User Interface
2014/9/9 Copyright © 2014 MingHo Chang
2.
張明禾 • C
• Android App • NodeJS • Sencha Touch • Unity 2014/9/9 Copyright © 2014 MingHo Chang
3.
Tips • Debug
– LogCat – Log.d/Log.e/Log.i/Log.v/Log.w – Log.d("TAG", "Something’s wrong!!!"); • Useful Eclipse shortcuts for Windows Ac$on Shortcut Auto Complete(Content Assist) Alt + / Auto Imports Ctrl + ShiW + O Refactoring Alt + ShiW + R 2014/9/9 Copyright © 2014 MingHo Chang
4.
Build by drag
& drop 2014/9/9 Copyright © 2014 MingHo Chang
5.
Build by programming
<Buon android:id="@+id/myBuon" android:layout_width="match_parent" android:layout_height="match_parent" /> 2014/9/9 Copyright © 2014 MingHo Chang
6.
View & ViewGroup(Layout)
2014/9/9 Copyright © 2014 MingHo Chang
7.
ViewGroup • LinearLayout
• RelacveLayout • ListView • GridView • … 2014/9/9 Copyright © 2014 MingHo Chang
8.
View • Buon/ImageBuon
• TextView • EditText • ImageView • CheckBox • … 2014/9/9 Copyright © 2014 MingHo Chang
9.
1st implementacon •
Build a UI like • 都教授:textSize="20sp" • File -‐> New -‐> Android XML File 2014/9/9– File: list_item.xmCoply right © 2014 MingHo Chang
10.
Standard UI Layout
• Accon Bar • Dialogs • Status Nocficacons • Toasts • … 2014/9/9 Copyright © 2014 MingHo Chang
11.
Ac$vity Lifecycle 2014/9/9
Copyright © 2014 MingHo Chang
12.
2nd implementacon •
Print every lifecycle method’s name in LogCat while the it is triggered. • Example: @Override public void onStart() { super.onStart(); Log.i("Implementacon", "onStart"); } 2014/9/9 Copyright © 2014 MingHo Chang
13.
ViewGroup -‐ ListView
2014/9/9 Copyright © 2014 MingHo Chang
14.
ViewGroup -‐ ListView
• layout.xml <ListView android:id="@+id/myListView" android:layout_width="match_parent" android:layout_height="match_parent" /> 2014/9/9 Copyright © 2014 MingHo Chang
15.
ViewGroup -‐ ListView
• Default list item layout – android.R.layout.simple_list_item_1 – android.R.layout.simple_list_item_2 – android.R.layout.simple_list_item_single_choice – android.R.layout.simple_list_item_mulcple_choice – android.R.layout.simple_list_item_checked • hp://developer.android.com/reference/ android/R.layout.html 2014/9/9 Copyright © 2014 MingHo Chang
16.
ViewGroup -‐ ListView
2014/9/9 Copyright © 2014 MingHo Chang
17.
ViewGroup -‐ ListView
• Set list content by adapter – ArrayAdapter – SimpleAdapter – BaseAdapter – SimpleCursorAdapter 2014/9/9 Copyright © 2014 MingHo Chang
18.
ViewGroup -‐ ListView
• ArrayAdapter -‐ onCreate String[] values = new String[]{ "item1", "item2", "item3", "item4", "item5" }; ListView list = (ListView) findViewById(R.id.myListView); ArrayAdapter listAdapter = new ArrayAdapter<String> (this, android.R.layout.simple_list_item_1, values); list.setAdapter(listAdapter); 2014/9/9 Copyright © 2014 MingHo Chang
19.
3rd implementacon •
Create a list with 10 classmates’ names. 2014/9/9 Copyright © 2014 MingHo Chang
20.
ViewGroup -‐ ListView(Customize)
• Customize list item layout. 2014/9/9 Copyright © 2014 MingHo Chang
21.
ViewGroup -‐ ListView(Customize)
• Classmate.java public class Classmate { public String name; public String descripcon; public int imageRes; public Classmate(String n, String des, int res) { name = n; descripcon = des; imageRes = res; } } 2014/9/9 Copyright © 2014 MingHo Chang
22.
ViewGroup -‐ ListView(Customize)
• BaseAdapter – CustomAdapter.java public class CustomAdapter extends BaseAdapter { private List<Classmate> mList; private LayoutInflater mInflater; public CustomAdapter(Context context, List<Classmate> list) mList = list; mInflater = LayoutInflater.from(context); } } 2014/9/9 Copyright © 2014 MingHo Chang
23.
ViewGroup -‐ ListView(Customize)
@Override public int getCount() { return mList.size(); } @Override public Classmate getItem(int posicon) { return mList.get(posicon); } 2014/9/9 Copyright © 2014 MingHo Chang
24.
ViewGroup -‐ ListView(Customize)
@Override public long getItemId(int posicon) { return 0; } private class ViewHolder { ImageView imgView; TextView txtTitle; TextView txtDesc; } 2014/9/9 Copyright © 2014 MingHo Chang
25.
ViewGroup -‐ ListView(Customize)
@Override public View getView(int posicon, View convertView, ViewGroup parent) { ViewHolder holder = null; if (convertView == null) { convertView = mInflater.inflate(R.layout.list_item, null); holder = new ViewHolder(); holder.txtDesc = (TextView) convertView.findViewById(R.id.desc); holder.txtTitle = (TextView) convertView.findViewById(R.id.ctle); holder.imgView = (ImageView) convertView.findViewById(R.id.icon); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } Classmate c = getItem(posicon); holder.txtTitle.setText(c.name); // TODO return convertView; } 2014/9/9 Copyright © 2014 MingHo Chang
26.
ViewGroup -‐ ListView(Customize)
• MainAccvity.java public class MainAccvity extends Accvity { private List<Classmate> mClassmates; … } 2014/9/9 Copyright © 2014 MingHo Chang
27.
ViewGroup -‐ ListView(Customize)
• MainAccvity.java – onCreate mClassmates = new ArrayList(); mClassmates .add(new Classmate("Mary", "A girl", R.drawable.mary)); mClassmates .add(new Classmate("Tom", "A boy", R.drawable.tom)); ListView list = (ListView) findViewById(R.id.myListView); CustomAdapter listAdapter = new CustomAdapter(this, mClassmates ); list.setAdapter(listAdapter); 2014/9/9 Copyright © 2014 MingHo Chang
28.
4th implementacon •
Build the list above with pictures, classmates’ names and descripcons. 2014/9/9 Copyright © 2014 MingHo Chang
29.
Event Listeners 2014/9/9
Copyright © 2014 MingHo Chang
30.
Event Listeners •
Views – onClick – onLongClick – onTouch • ListView – onItemClick 2014/9/9 Copyright © 2014 MingHo Chang
31.
ViewGroup -‐ ListView
• OnItemClickListener private OnItemClickListener mItemClickListener = new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> adapter, View view, int posicon, long id) { // TODO } }; list.setOnItemClickListener(mItemClickListener); 2014/9/9 Copyright © 2014 MingHo Chang
32.
Drawable • Place
images in res/drawable/ . • Get images by R.drawable.image_name when programming. • Ex: <ImageView android:src="@drawable/image_name" /> ImageView image; image.setImageResource(R.drawable.image_name); 2014/9/9 Copyright © 2014 MingHo Chang
33.
5th implementacon •
Toast a message while clicking any list item. 2014/9/9 Copyright © 2014 MingHo Chang
34.
The End 2014/9/9
Copyright © 2014 MingHo Chang
35.
ViewGroup -‐ LinearLayout
2014/9/9 Copyright © 2014 MingHo Chang
36.
ViewGroup -‐ LinearLayout
<LinearLayout android:id="@+id/myLinearLayout" android:layout_width="match_parent" android:layout_height="match_parent" android:orientacon="verccal" > …views… </LinearLayout> 2014/9/9 Copyright © 2014 MingHo Chang
37.
ViewGroup -‐ LinearLayout
<LinearLayout … android:orientacon="verccal" > <buon … android:layout_height="0dp" android:layout_weight="2" /> <buon … android:layout_height="0dp" android:layout_weight="1" /> </LinearLayout> 2014/9/9 Copyright © 2014 MingHo Chang
38.
ViewGroup -‐ LinearLayout
<LinearLayout … android:orientacon="horizontal" > <buon … android:layout_width="0dp" android:layout_weight="2" /> <buon … android:layout_width="0dp" android:layout_weight="1" /> </LinearLayout> 2014/9/9 Copyright © 2014 MingHo Chang
39.
ViewGroup -‐ RelacveLayout
2014/9/9 Copyright © 2014 MingHo Chang
40.
ViewGroup -‐ RelacveLayout
• android:layout_alignParentTop="true" • android:layout_centerVerccal="true" • android:layout_below="@id/myBuon" • android:layout_toRightOf="@id/myBuon" 2014/9/9 Copyright © 2014 MingHo Chang
41.
ViewGroup -‐ ListView
2014/9/9 Copyright © 2014 MingHo Chang
42.
ViewGroup -‐ GridView
2014/9/9 Copyright © 2014 MingHo Chang
43.
Standard UI Layout
– Accon Bar 2014/9/9 Copyright © 2014 MingHo Chang
44.
Standard UI Layout
-‐ Dialog 2014/9/9 Copyright © 2014 MingHo Chang
45.
Standard UI Layout
-‐ Nocficacon 2014/9/9 Copyright © 2014 MingHo Chang
46.
Standard UI Layout
-‐ Toast Toast.makeText(getApplicaconContext(), "msg", Toast.LENGTH_SHORT).show(); 2014/9/9 Copyright © 2014 MingHo Chang