Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Working with custom Android devices

Working with custom Android devices

Android is now well established outside the world of smartphones. Although usually not officially supported, you can find Android running on all kinds of devices, like home appliances, digital signage, and point-of-sales terminals. Being Android developer today means you are likely to encounter these custom devices in your career.

In this session you will learn the most important parts of working on these devices. We will cover things like developers boards, board support packages, AOSP builds, firmware updates, and much more.

Erik Hellman

October 25, 2023
Tweet

More Decks by Erik Hellman

Other Decks in Programming

Transcript

  1. Erik Hellman
    hellsoft.se

    View full-size slide

  2. Slides available at


    speakerdeck.com/erikhellman

    View full-size slide

  3. 🧑💻
    You
    Android hardware and suppliers
    SoC Manufacturer
    SoM Manufacturer
    Integration Partner

    View full-size slide

  4. 🧑💻
    You
    Android hardware and suppliers
    Integration Partner

    View full-size slide

  5. Hardware setup

    View full-size slide

  6. Bench Power Supply Unit

    View full-size slide

  7. Configurable WiFi Bridge
    GL.iNet recommended!

    View full-size slide

  8. Working with AOSP

    View full-size slide

  9. 🧑💻
    You
    The way of the source…
    Integration Partner

    View full-size slide

  10. Build server
    • As many cores as you can

    • Plenty of RAM

    • Fast SSDs (PCIe gen 3 NVMe)

    View full-size slide

  11. repo init / create a mirror

    View full-size slide

  12. repo init / use your local mirror

    View full-size slide

  13. repo init / avoid —repo-url

    View full-size slide

  14. Slow or bad network?
    Update your .gitcon
    fi
    g

    View full-size slide

  15. Proprietary binaries

    View full-size slide

  16. Start your build…

    View full-size slide

  17. lunch targets / AndroidProducts.mk

    View full-size slide

  18. Build variants and common lunch targets

    View full-size slide

  19. AOSP build variants

    View full-size slide

  20. updated lunch targets / AndroidProducts.mk

    View full-size slide

  21. Updated common lunch targets

    View full-size slide

  22. Guidelines for userdebug, source.android.com/docs/setup/create/new-device#build-variants
    Don't include features that are enabled/disabled by
    default based on the build type. Developers are
    discouraged from using any form of logging that affects
    battery life, such as debug logging or heap dumping.

    View full-size slide

  23. Guidelines for userdebug, source.android.com/docs/setup/create/new-device#build-variants
    You should enable debugging features
    only on a limited-time basis until the issue
    you're trying to debug is resolved.

    View full-size slide

  24. Building and parallel tasks

    View full-size slide

  25. Signing system apps

    View full-size slide

  26. Using the AOSP test certificates

    View full-size slide

  27. Using the AOSP test certificates

    View full-size slide

  28. Calling Hidden System APIs

    View full-size slide

  29. Using Reflections - Slow!

    View full-size slide

  30. Using fake interface - hard to maintain

    View full-size slide

  31. Modify Android SDK
    • Copy framework.jar from AOSP build

    • Rename to android.jar

    • Replace with the android.jar in your local Android SDK

    View full-size slide

  32. Build a custom Android SDK

    View full-size slide

  33. Build app with AOSP / Android.bp

    View full-size slide

  34. Soong build system
    https://source.android.com/docs/setup/build?hl=en

    View full-size slide

  35. Build with AOSP / device/xyz/mydevice/device.mk

    View full-size slide

  36. Chrome Remote Desktop
    https://remotedesktop.google.com/

    View full-size slide

  37. Android Studio for Platform

    View full-size slide

  38. AOSP Code Search
    https://cs.android.com

    View full-size slide

  39. Product Definition in AOSP

    View full-size slide

  40. aosp_bramble.mk

    View full-size slide

  41. aosp_bramble.mk

    View full-size slide

  42. aosp_bramble.mk

    View full-size slide

  43. aosp_bramble.mk

    View full-size slide

  44. aosp_bramble_64.mk

    View full-size slide

  45. System properties / device-bramble.mk

    View full-size slide

  46. System properties / device-.mk

    View full-size slide

  47. Resource overlays / device-bramble.mk

    View full-size slide

  48. bramble/overlay/frameworks/base/core/res/res/values

    View full-size slide

  49. Resource overlays / config.xml

    View full-size slide

  50. AOSP framework resources

    View full-size slide

  51. Thank you for listening! :)


    speakerdeck.com/erikhellman

    View full-size slide