What’s Next?
You now know how to build dynamic, server-powered bridge components for Android. Adding a new native button is now as easy as adding one or two data-* attributes to your HTML. And because you made the title and image dynamic, your options for customization are endless.
You can follow the technique you learned in this chapter to build your own components, taking advantage of any native API. Swap out the code in onClick to execute whatever Kotlin you’d like, such as accessing the Health Platform API,[51] interacting with the device’s sensors,[52] and more.
If you’re looking for more examples or inspiration, check out my open source bridge component library.[53] It includes a bunch of generalized, production-ready bridge components ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access