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
Navigating Dependency Injection with Metro
zacsweers
3
3.5k
概念モデル→論理モデルで気をつけていること
sunnyone
3
300
請來的 AI Agent 同事們在寫程式時,怎麼用 pytest 去除各種幻想與盲點
keitheis
0
130
Reading Rails 1.0 Source Code
okuramasafumi
0
250
個人開発で徳島大学生60%以上の心を掴んだアプリ、そして手放した話
akidon0000
1
150
速いWebフレームワークを作る
yusukebe
5
1.7k
🔨 小さなビルドシステムを作る
momeemt
4
690
2025 年のコーディングエージェントの現在地とエンジニアの仕事の変化について
azukiazusa1
24
12k
Processing Gem ベースの、2D レトロゲームエンジンの開発
tokujiros
2
130
CJK and Unicode From a PHP Committer
youkidearitai
PRO
0
110
Cache Me If You Can
ryunen344
2
4k
AI時代のUIはどこへ行く?
yusukebe
18
9.1k
Featured
See All Featured
Docker and Python
trallard
46
3.6k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
RailsConf 2023
tenderlove
30
1.2k
How to train your dragon (web standard)
notwaldorf
96
6.2k
Facilitating Awesome Meetings
lara
55
6.5k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6k
Testing 201, or: Great Expectations
jmmastey
45
7.7k
Why Our Code Smells
bkeepers
PRO
339
57k
It's Worth the Effort
3n
187
28k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
jQuery: Nuts, Bolts and Bling
dougneiner
64
7.9k
Designing for humans not robots
tammielis
253
25k
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