Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
android programming 1
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Giovanni De Francesco
January 11, 2013
Programming
230
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
android programming 1
this slides explain how to use android's activity and views
Giovanni De Francesco
January 11, 2013
Transcript
14 slides
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
More Decks by Giovanni De Francesco
See All by Giovanni De Francesco
JSON explained
jibbo
2
230
Android Programming 5
jibbo
1
170
Android Programming 4
jibbo
1
160
Android Overview
jibbo
1
190
Android Programming 3
jibbo
0
140
android programming 2
jibbo
0
160
Other Decks in Programming
See All in Programming
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
440
Kawaiicon: Kubernetes, it's no longer cool, but let's secure it anyway!
barnbarn
0
150
Kotlin JVM用に作られたライブラリのKMPを前提とした再設計
jsoizo
0
240
ruby/uri meets WHATWG
jinroq
0
160
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
490
AI Augmentation Techniques with Liberty
ivargrimstad
1
580
Canvas 2D Context Next
petamoriken
0
500
Proxmox x Talos Linux x Terraform で実現するなんかいい感じの Kubernetes クラスタ / A Sleek Kubernetes Cluster Powered by Proxmox, Talos Linux, and Terraform
nnaka2992
0
320
AIが生成したコードは読むべきか?抽象化設計とコードの品質保証 / abstraction-design-and-quality
minodriven
17
9.6k
Math.sumPreciseから学ぶ、ECMAScript仕様の数値の種類
syumai
0
670
AIコーディング時代のKotest ユニットテストから APIレベルの仕様固定化テストへ
ooga04
0
340
Stage 3でも仕様は変わる。アプリケーション開発者のためのTC39プロセスの読み方
bicstone
1
670
Featured
See All Featured
Side Projects
sachag
456
43k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
850
How to make the Groovebox
asonas
2
2.6k
[SF Ruby Conf 2025] Rails X
palkan
3
1.6k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
The Limits of Empathy - UXLibs8
cassininazir
2
800
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
680
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
680
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k