2min chapter

Fragmented - Android Developer Podcast cover image

245: Treehouse, Redwood and Zipline with Colin White

Fragmented - Android Developer Podcast

CHAPTER

How to Use Redwood to Generate Code for Your iOS Colleague

Redwood is a Kotlin compiler plugin, it basically just generates code for you. It's not actually generating any elements for the individual toolkit. It just generates an interface that then you have to implement yourself. The way it works today at cache up is say we want to add a new widget to our Schema. And then I can write compose functions that call into this redwood button function. But I just then pass off this button interface to the iOS developer and they work on writing that interface for their platform.

00:00
Speaker 2
So basically once you have these, once you, once redwood does its work, so to speak, because like you were saying, it's a Kotlin compiler plugin, it basically just generates code for you, essentially, right? And it generates, if you're on an, on Android, it generates like, you know, view related code. If you're an iOS, it generates UI kit related code. And if you're in the web, so to speak, it generates like HTML elements, right? Yeah.
Speaker 1
So it's not, it's not actually generating any elements for the individual toolkit. It just generates an interface that then you have to implement yourself.
Speaker 2
Oh, I see, got it got okay. So because that was going to be my other question. So like say, you know, your iOS colleagues want to also use this with you, right? What they would do is they could, both of you could use the same schema, so to speak, because you know, that should hopefully be common. And once you apply a redwood, it generates the interfaces, but then your iOS colleague would have to like, you know, use the implementation for that interface on iOS, potentially using UI kit or Swift UI or something. And on the Android side, you know, we just do like you implement the interface using existing views, you know, our regular, random views or potentially, you know, compose UI or something. Totally.
Speaker 1
Yeah. So the way it works today at cache up is say we want to add a new widget to our schema, say I'm adding a button, I'll add in a button definition into our schema. And then I can write compose functions that call into this redwood button function. But I just then pass off this button interface to the iOS developer I work with, the Android developer I work with. And they, they work on translating on writing that interface for their platform. So the these interfaces, they can, yeah, they can be implemented in Swift as well, because of, of course, call a multi platform works works great with interoperability.

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode