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
DSC WORKSHOP “ANDROID FOR BEGINNER #2”
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Zainal Hasan
July 29, 2018
Programming
180
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
DSC WORKSHOP “ANDROID FOR BEGINNER #2”
Zainal Hasan
July 29, 2018
More Decks by Zainal Hasan
See All by Zainal Hasan
Riset Operasi-Penjadwalan dengan Metode PDM
zhanang19
0
270
Other Decks in Programming
See All in Programming
Gmail/Google DriveをトリガーにAIエージェントを動かそう! / Run AI agents with Gmail/Google Drive as triggers!
har1101
3
490
Swift愛好会100回記念 第1回を振り返る
jollyjoester
0
120
The Good Stuff, Not the Slop: Engineering High-Quality Android Apps with Modern AI Tooling
danybony
1
230
Seeing Through Serverless: Observability for AWS Lambda with ADOT and CloudWatch Application Signals
seike460
PRO
1
130
Hono + Inertia + React で LP を構築した話
oukayuka
2
220
Kiroで創り、AgentCoreで繋ぐ!AWSで実践する「AI-DLC」から「AIエージェント統合」までの最新地図
licux
3
400
アクセシビリティから考える情報設計
high_g_engineer
0
350
マイコン向けの軽量Ruby「PicoRuby」で各種デバイスを制御するネイティブアプリの実現手法
bash0c7
0
310
『寄り添うラジオ』をAIで作る 体験価値から逆算した、会話しないUXと品質設計
theoriatec2024
3
140
LoopHub - ローカルで動く GitHub で、AI と共同開発
jugyo
1
480
AI × TiDD / 2026.09.05 Redmine 大阪
tokudiro
1
120
ソフトウェアラスタライザ
fadis
1
800
Featured
See All Featured
New Earth Scene 8
popppiees
3
2.5k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
Writing Fast Ruby
sferik
630
63k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
400
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
202
76k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
320
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
690
Music & Morning Musume
bryan
47
7.4k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.5k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
57k
The Invisible Side of Design
smashingmag
301
52k
Navigating Weather and Climate Data
rabernat
0
510
Transcript
DSC WORKSHOP “ANDROID FOR BEGINNER #2” Layouting and EventHandling on
Android
None
Views vs ViewGroup Views : • TextView • ImageView •
Button • EditText • RadioButton • Checkbox • Switch • Rating Bar • etc ViewGroup : • RelativeLayout • LinearLayout • ConstraintLayout • TableLayout • FrameLayout • etc
Views Example <TextView android:id="@+id/title_text_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello DSC" android:textColor="#4689C8" android:textStyle="bold"
/> Hello DSC
ViewGroup Example <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <TextView android:id="@+id/title_text_view1" android:layout_width="wrap_content" android:layout_height="wrap_content"
android:text="Hello DSC" android:textColor="#4689C8" android:textStyle="bold" android:padding="16dp"/> <TextView android:id="@+id/title_text_view2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello Lagi DSC" android:textColor="#4689C8" android:textStyle="bold" android:padding="16dp"/> </LinearLayout> Hello Lagi DSC Hello DSC
ViewGroup Example (2) <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:id="@+id/title_text_view1" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Hello DSC" android:textColor="#4689C8" android:textStyle="bold" android:padding="16dp"/> <TextView android:id="@+id/title_text_view2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello Lagi DSC" android:textColor="#4689C8" android:textStyle="bold" android:padding="16dp"/> </LinearLayout> Hello DSC Hello Lagi DSC
Common Attributes android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/title_text_view1" android:text="Hello DSC" "match_parent" “wrap_content” <custom>
like “300dp”
Padding VS Margin
Prepare Your Android Studio
Let’s Make This
Let’s Break for a Minutes
Continue to EventHandling
onClickListener (Style 1) public class MainActivity extends AppCompatActivity { private
Button tombol; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); tombol = (Button) findViewById(R.id.button); tombol.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Toast.makeText(MainActivity.this, "Hello DSC", Toast.LENGTH_SHORT).show(); } }); } }
onClickListener (Style 2) public class MainActivity extends AppCompatActivity implements View.OnClickListener{
private Button tombol; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); tombol = (Button) findViewById(R.id.button); tombol.setOnClickListener(this); } @Override public void onClick(View view) { switch (view.getId()){ case R.id.button : Toast.makeText(this, "Hello DSC", Toast.LENGTH_SHORT).show(); break; } } }
Intent Activity 1 Activity 2 Intent intent = new Intent(Activity1.this,
Activity2.class); startActivity(intent); startActivityForResult(intent, 123);
Intent With Data // Activity 1 String nama = "Ahok";
intent.putExtra("data_nama", nama); startActivity(intent); Activity 1 (i have data for you) Activity 2 (where???) // Activity 2 Intent intent = getIntent(); String nama = intent.getStringExtra("data_nama");
Intent With Data (2) Bundle // Activity 1 String nama1
= "Ahok"; String nama2 = "Djarot"; Bundle bundle = new Bundle(); bundle.putString("data_nama_1", nama1); bundle.putString("data_nama_2", nama2); intent.putExtras(bundle); startActivity(intent); // Activity 2 Intent intent = getIntent(); Bundle bundle = intent.getExtras(); String nama1 = bundle.getString("data_nama_1"); String nama2 = bundle.getString("data_nama_2");
Let’s do this Backend
Thank You And Keep Developing