มาฟัง Google Developer Summit 2015

มาฟัง Google Developer Summit 2015

session แรก Adom Koch พูดเรื่อง Building for the next billion users

#10 responsiveness
– touch latency = actual + perceived latency
100ms ผู้ใช้ทนได้
perceived latency ลดได้ โดย UI ต้องตอบสนองก่อน (touch feedback) immediately

#9 design

Use an App Bar (ดีัยังไง ยังไม่เข้าใจ)
เลือก navigation mode ให้ถูกต้อง
AppCompat for backward compat

#8 Anticipate
pre-fetch content รู้ว่า user กำลังกด ก็โหลดมารอเลย
ใช้ “JobScheduler”

#7
be start about mobile data usage
ต้องรู้ว่าตอนนี้ผู้ใช้ ต่อ 2G, 3G, … และเรียกใช้งานให้เหมาะสม
monitor network connectivity changes 
connected != actvie
app ควรมีให้ดูว่าใช้ network ไปเท่าไหร่  (?)

#6 webp
24-34% better than jpeg
28% better than png (no loss in visible quality)
เค้าว่าลดปริมาณข้อมูลได้ 30%

#5 put your APK on a diet
เค้าว่าขนาดของ APK matters
Google Play smart updates 
ทำไงอย่าให้ user ปิด auto updates
Launcher icons ให้เก็บใน mipmap-hdpi อย่าเก็บใน  Drawable (?)

Remove unused code and resources
minifyEnabled = true
shrinkResources=true

#4
keep graphic performance smooth
60fps = 16ms per frame
reduce “actual” latency

minimize layout overdraw and layout depth
only run UI updates and logic on the UI thread (อื่นๆ ควรอยู่ใน background thread ให้หมด)
memory allocations can cuase GC (ซึ่งจะทำให้อึ้ง)
– แนะนำให้ใช้ Glide / Picasso (?)
Use on-devices tools, GPU profiling / overdraw

# 3 Battery
พวกกินเยอะ คือ screen, mobile network, และการไป block ทำให้มันเข้า low power ไม่ได้
อย่าใช้ WakeLocks โดยไม่จำเป็น
Use FLAG_KEEP_SCREEN_ON and WakefulBroadcastReceiver
ใช้ JObScheduler API
Batch network transfers รวมๆ กันดีกว่า

#2 Memory
Reduce memory usage
more background memory usage ทำให้ multitasking ช้าลงและ efficiency ลด
Subclass IntentService, not Service 
ใช้ GCM, JObScheduler, AlarmManager, etc.
ActivitiyManager.isLowRamDevice() –> 512MB + 800×480 or less screen

#1 App Architecture
– network requests อย่าเรียกซ้ำ ให้รู้จักเก็บไว้ (local db หรือ bounded disk cache)
– หน้าจอควรัยงต้องใช้ได้ ถึงแม้ network เน่า
– never block UI for long running operation ใช้ inline loading spinners หรือ AsyncTask (only for UI related background operations)

android
motto เค้า
be together, not the same

Leave a comment