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
DSC WORKSHOP “ANDROID FOR BEGINNER #2”
Search
Zainal Hasan
July 29, 2018
Programming
170
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
AI がコードを書く時代における新卒エンジニアの仕事風景 (2026) / New Graduate Engineers in the Era of AI Coding (2026)
sushichan044
0
220
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
0
110
JAWS-UG横浜 #102 AWSサ終供養LT会 成仏できない AWS サービスたち 〜本日、三体供養します〜
maroon1st
0
210
Prismを使った型安全な暗号化_関数型まつり2026
_fhhmm
0
140
PHPだって関数型したい 〜できること、できないこと〜 / fp-in-php
jsoizo
0
210
作るコストが小さくなった時代 幸せに働くために改めて考えたいこと 〜エンジニアとして価値を出し続けるために注視している二分野〜
yuppeeng
0
100
ローカルLLMでどこまでコードが書けるか -縮小版 / How much code can be written on a local LLM Shortened
kishida
2
190
SREは、MCPとSRE Agentをこう使え!
kazumax55
0
150
これからAgentCoreを触る方へトレンドはGatewayです
har1101
6
500
AIを活用したE2Eテスト実装効率化のあゆみ / ebisu-mobile-14-kotetu
kotetuco
0
170
『コードを書く以外の』エンジニアリング〜課金基盤移行プロジェクト推進のためのTips4選
yuriko1211
0
510
symfony/aiとlaravel/boost
77web
0
130
Featured
See All Featured
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
180
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
180
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
400
Navigating Team Friction
lara
192
16k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
450
Evolving SEO for Evolving Search Engines
ryanjones
0
240
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.7k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
120k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
310
Practical Orchestrator
shlominoach
191
11k
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