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
What's new in Spring Modulith?
olivergierke
1
160
なぜあの開発者はDevRelに伴走し続けるのか / Why Does That Developer Keep Running Alongside DevRel?
nrslib
3
410
Goで実践するドメイン駆動開発 AIと歩み始めた新規プロダクト開発の現在地
imkaoru
4
870
Software Architecture
hschwentner
6
2.3k
TFLintカスタムプラグインで始める Terraformコード品質管理
bells17
2
330
EMこそClaude Codeでコード調査しよう
shibayu36
0
240
CSC509 Lecture 06
javiergs
PRO
0
260
CSC509 Lecture 05
javiergs
PRO
0
300
フロントエンド開発のためのブラウザ組み込みAI入門
masashi
6
3.2k
CSC305 Lecture 06
javiergs
PRO
0
250
スマホから Youtube Shortsを見られないようにする
lemolatoon
27
33k
Google Opalで使える37のライブラリ
mickey_kubo
2
110
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
34
8.9k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.7k
A Modern Web Designer's Workflow
chriscoyier
697
190k
KATA
mclloyd
PRO
32
15k
Designing for humans not robots
tammielis
254
26k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
Navigating Team Friction
lara
190
15k
Context Engineering - Making Every Token Count
addyosmani
7
270
The Cost Of JavaScript in 2023
addyosmani
55
9k
Building Applications with DynamoDB
mza
96
6.7k
YesSQL, Process and Tooling at Scale
rocio
173
14k
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