Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
android programming 1
Search
Giovanni De Francesco
January 11, 2013
Programming
0
220
android programming 1
this slides explain how to use android's activity and views
Giovanni De Francesco
January 11, 2013
Tweet
Share
More Decks by Giovanni De Francesco
See All by Giovanni De Francesco
JSON explained
jibbo
2
220
Android Programming 5
jibbo
1
150
Android Programming 4
jibbo
1
140
Android Overview
jibbo
1
170
Android Programming 3
jibbo
0
130
android programming 2
jibbo
0
150
Other Decks in Programming
See All in Programming
Understanding Ruby Grammar Through Conflicts
yui_knk
1
120
AIレビュアーをスケールさせるには / Scaling AI Reviewers
technuma
2
220
【第4回】関東Kaggler会「Kaggleは執筆に役立つ」
mipypf
0
690
Constant integer division faster than compiler-generated code
herumi
2
680
バイブコーディング × 設計思考
nogu66
0
120
The state patternの実践 個人開発で培ったpractice集
miyanokomiya
0
140
GitHub Copilotの全体像と活用のヒント AI駆動開発の最初の一歩
74th
8
3.1k
兎に角、コードレビュー
mitohato14
0
140
マイコンでもRustのtestがしたい その2/KernelVM Tokyo 18
tnishinaga
2
2.3k
AWS Serverless Application Model入門_20250708
smatsuzaki
0
120
Amazon Q CLI開発で学んだAIコーディングツールの使い方
licux
3
190
開発チーム・開発組織の設計改善スキルの向上
masuda220
PRO
4
700
Featured
See All Featured
Thoughts on Productivity
jonyablonski
69
4.8k
Code Review Best Practice
trishagee
70
19k
Scaling GitHub
holman
462
140k
Adopting Sorbet at Scale
ufuk
77
9.5k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Rails Girls Zürich Keynote
gr2m
95
14k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
9
770
We Have a Design System, Now What?
morganepeng
53
7.7k
A designer walks into a library…
pauljervisheath
207
24k
Imperfection Machines: The Place of Print at Facebook
scottboms
268
13k
Reflections from 52 weeks, 52 projects
jeffersonlam
351
21k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.9k
Transcript
Android Programming MVC and Activities
Little taste of MVC Architectural pattern Controller Model View
Android Programming
What do you see here? Android Programming
First level: Activity A single, Task- focused, window. Android Programming
Activity Lifecycle More details on: developers.android.com Android Programming
What do you deeper see here? Android Programming
Second level: Views Every “brick” placed in your Activity. Examples
(javaàAndroid): JLabelàTextView JButtonàButton FlowLayoutàLinearLayout
Activity UI <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http:// schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content"
> <TextView android:id="@+id/tv1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" /> </RelativeLayout> Android Programming
Activity Logic public class MainActivity extends Activity { @Override protected
void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override protected void onPause() { // TODO Auto-generated method stub super.onPause(); } } Android Programming
Referencing View TextView tv = (TextView) findViewById(R.id.tv1); Android Programming
Manifest File <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.firstapp” android:versionCode="1” android:versionName="1.0"
> <uses-sdk android:minSdkVersion=”7” android:targetSdkVersion="16" /> <application android:icon="@drawable/ic_launcher” android:label="@string/app_name”> <activity android:name="com.example.firstapp.MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> Android Programming
Working with Activities //first Activity Intent i = new Intent
(MainActivity.this, NewActivity.class); i.putExtra("key", "value"); //called Activity Intent launcher = getIntent(); launcher.getExtras().getString("key"); Android Programming
What should we do today? When the user clicks the
button another activity will start. The second activity shows username and password Android Programming
Credit: Groveshark images Activity lifecycle Android Programming