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
イベントストーミング図からコードへの変換手順 / Procedure for Converting Event Storming Diagrams to Code
nrslib
1
300
Beyond Portability: Live Migration for Evolving WebAssembly Workloads
chikuwait
0
390
『自分のデータだけ見せたい!』を叶える──Laravel × Casbin で複雑権限をスッキリ解きほぐす 25 分
akitotsukahara
1
470
Team operations that are not burdened by SRE
kazatohiei
1
180
C++20 射影変換
faithandbrave
0
520
すべてのコンテキストを、 ユーザー価値に変える
applism118
2
680
ruby.wasmで多人数リアルタイム通信ゲームを作ろう
lnit
2
230
LINEヤフー データグループ紹介
lycorp_recruit_jp
0
800
Effect の双対、Coeffect
yukikurage
5
1.4k
Go1.25からのGOMAXPROCS
kuro_kurorrr
1
800
Kotlin エンジニアへ送る:Swift 案件に参加させられる日に備えて~似てるけど色々違う Swift の仕様 / from Kotlin to Swift
lovee
1
250
Team topologies and the microservice architecture: a synergistic relationship
cer
PRO
0
1k
Featured
See All Featured
Designing for humans not robots
tammielis
253
25k
Raft: Consensus for Rubyists
vanstee
140
7k
Making the Leap to Tech Lead
cromwellryan
134
9.3k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.8k
Site-Speed That Sticks
csswizardry
10
650
Code Reviewing Like a Champion
maltzj
524
40k
What's in a price? How to price your products and services
michaelherold
246
12k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.5k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
790
GitHub's CSS Performance
jonrohan
1031
460k
4 Signs Your Business is Dying
shpigford
184
22k
Designing Experiences People Love
moore
142
24k
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