Basic Android #1
Build your simple app
Thursday, August 8, 13
Build Simple App
download android sdk
create your first app
http://developer.android.com/sdk/index.html#mac-bundle
Step 1
T...
Structure of project
src
assets
libs
res *
AndroidManifest.xml
Thursday, August 8, 13
Drawable
xhdpi 2.0
hdpi 1.5
mdpi 1.0
ldpi 0.75
This means that if you generate a 200x200 image for xhdpi devices,
you shou...
AndroidManifest.xml
เวลาอัพขึ้น market ต้องมากขึ้นเรื่อยๆ
แสดง icon ของApp
Activity นี้จะแสดงแต่แนวตั้ง
Thursday, August 8...
Life Cycle Activity
Thursday, August 8, 13
Thursday, August 8, 13
Activity?
จะมีแต่ view เดี่ยวๆโปรแกรมทํางานไม่ได้
if it has a UI, it’ll have at least one
Activity
Relationship between an...
A
B
A
Activity
Intent intent = new Intent(this, A.class);
startActivity(intent);
Intent intent = new Intent(this, B.class)...
setcontentView(R.layout.list_item_icom);
ImageView imgIcon = (ImageView)findViewById(R.id.icon);
Thursday, August 8, 13
Layout
LinearLayout RelativeLayout
Thursday, August 8, 13
• Measure: 0.977ms
• Layout: 0.167ms
• Draw: 2.717ms
The timings for rendering a complete list item using this layout are:...
Most of this time difference is due to the use of
layout_weight in the LinearLayout design,
which can slow down the speed ...
Thank you for your
Attention
Thursday, August 8, 13
Upcoming SlideShare
Loading in …5
×

Basic android 1

356 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
356
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Basic android 1

  1. 1. Basic Android #1 Build your simple app Thursday, August 8, 13
  2. 2. Build Simple App download android sdk create your first app http://developer.android.com/sdk/index.html#mac-bundle Step 1 Thursday, August 8, 13
  3. 3. Structure of project src assets libs res * AndroidManifest.xml Thursday, August 8, 13
  4. 4. Drawable xhdpi 2.0 hdpi 1.5 mdpi 1.0 ldpi 0.75 This means that if you generate a 200x200 image for xhdpi devices, you should generate the same resource in 150x150 for hdpi, 100x100 for mdpi, and 75x75 for ldpi devices. ref:http://developer.android.com/training/basics/supporting-devices/screens.html Nexus 7 true tab3g Thursday, August 8, 13
  5. 5. AndroidManifest.xml เวลาอัพขึ้น market ต้องมากขึ้นเรื่อยๆ แสดง icon ของApp Activity นี้จะแสดงแต่แนวตั้ง Thursday, August 8, 13
  6. 6. Life Cycle Activity Thursday, August 8, 13
  7. 7. Thursday, August 8, 13
  8. 8. Activity? จะมีแต่ view เดี่ยวๆโปรแกรมทํางานไม่ได้ if it has a UI, it’ll have at least one Activity Relationship between an Activity with a UI screen ---> MVC paradigm (ref: Android in action ) Thursday, August 8, 13
  9. 9. A B A Activity Intent intent = new Intent(this, A.class); startActivity(intent); Intent intent = new Intent(this, B.class); startActivity(intent); Intent intent = new Intent(this, A.class); startActivity(intent); ถ้ากดBack สองที ? show A1 show B1 show A Thursday, August 8, 13
  10. 10. setcontentView(R.layout.list_item_icom); ImageView imgIcon = (ImageView)findViewById(R.id.icon); Thursday, August 8, 13
  11. 11. Layout LinearLayout RelativeLayout Thursday, August 8, 13
  12. 12. • Measure: 0.977ms • Layout: 0.167ms • Draw: 2.717ms The timings for rendering a complete list item using this layout are: • Measure: 0.598ms • Layout: 0.110ms • Draw: 2.146ms http://developer.android.com/training/improving-layouts/optimizing-layout.html Thursday, August 8, 13
  13. 13. Most of this time difference is due to the use of layout_weight in the LinearLayout design, which can slow down the speed of measurement http://developer.android.com/training/improving-layouts/optimizing-layout.html Thursday, August 8, 13
  14. 14. Thank you for your Attention Thursday, August 8, 13

×