Introduction to Android programming with Kotlin

Introduction to Android programming with Kotlin

Part of a workshop in which Kotlin enthusiasts can write their first Android App. This introduction walks through several topics that require some attention when developing mobile apps.

Af7e5e2b05ae5f8666233e8fd9122faa?s=128

Jolanda Verhoef

December 05, 2018
Tweet

Transcript

  1. Jolanda Verhoef | 05-12-2018

  2. Jolanda Verhoef @lojanda

  3. Android basics Agenda • Memory management • Performance • Networking

    • Libraries • Storage • Framework • User Interface • Tools
  4. Memory management Hardware is limited ART (Android Runtime) Garbage collection

    Sharing memory Restricted memory per app Background apps can be killed
  5. Android Basics Performance

  6. Android Basics Performance

  7. Android Basics Performance

  8. Android Basics Performance • Threading (UI vs. Background) • What

    not to do on a main thread ◦ Network calls ◦ Heavy computations
  9. Networking Design for failure Power consumption Use provided solutions Adapt

    back-end to client
  10. Android Basics Libraries • Google Support Libraries • Used by

    (almost) everyone ◦ OkHttp & Retrofit ◦ RxJava or coroutines ◦ Glide / Picasso ◦ Dagger • (Very) specific use cases https://github.com/Yalantis/pull-to-make-soup • Use Proguard
  11. Android Basics Storage You are not the owner Memory caching

    SharedPreferences: simple key-values Disk Storage Databases
  12. Framework Very high-level programming no main() ➔ Activity no background

    process ➔ Service no direct communication between apps ➔ Broadcast Receiver / Content Provider
  13. Android Basics User Interface Activities Fragments Views Lifecycle

  14. None
  15. Android Basics Tools • In Android Studio ◦ Layout inspector

    ◦ Network / CPU / GPU / Memory profilers ◦ APK inspector ◦ Memory inspector • On device ◦ GPU profiler
  16. Android Basics Tools • In Android Studio ◦ Layout inspector

    ◦ Network / CPU / GPU / Memory profilers ◦ APK inspector ◦ Memory inspector • On device ◦ GPU profiler ◦ Show layout bounds
  17. Android Basics Tools • In Android Studio ◦ Layout inspector

    ◦ Network / CPU / GPU / Memory profilers ◦ APK inspector ◦ Memory inspector • On device ◦ GPU profiler ◦ Show layout bounds ◦ Decrease animation speed
  18. Android basics Agenda • Memory management • Performance • Networking

    • Libraries • Storage • Framework • User Interface • Tools
  19. Jolanda Verhoef | 05-12-2018

  20. Jolanda Verhoef | 05-12-2018

  21. https://codelabs.developers.google.com/codelabs/build-your-first-android-app-kotlin/index.html Google for: codelabs first android app Workshop

  22. None