# Lessons Learned with Jetpack Compose

DevFeed: [Lessons Learned with Jetpack Compose](<https://devfeed.tech/articles/lessons-learned-with-jetpack-compose-23972.md>)

Original publisher: [Read original article](<https://medium.com/making-meetup/lessons-learned-with-jetpack-compose-29ab74387fc?source=rss----6981e268ba45---4>)

Author: Joe Williams

Published: 2023-05-12T15:44:18Z

Content type: tutorial

Language: en

Sources: [Making Meetup - Medium](<https://devfeed.tech/sources/making-meetup-medium.md>)

Topics: [Jetpack Compose](<https://devfeed.tech/topics/jetpack-compose.md>), [ui](<https://devfeed.tech/topics/ui.md>), [Android](<https://devfeed.tech/topics/android.md>), [XML](<https://devfeed.tech/topics/xml.md>), [Android Studio](<https://devfeed.tech/topics/android-studio.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-studio](<https://devfeed.tech/tags/android-studio.md>), [compose-ui](<https://devfeed.tech/tags/compose-ui.md>), [declarative](<https://devfeed.tech/tags/declarative.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [meetup](<https://devfeed.tech/tags/meetup.md>), [swiftui](<https://devfeed.tech/tags/swiftui.md>), [view-binding](<https://devfeed.tech/tags/view-binding.md>)

## AI overview

This developer article shares Meetup's experience adopting Jetpack Compose alongside SwiftUI and integrating Compose into an existing Android app. It explains the benefits of declarative UI, including faster UI development and simpler component reuse, while discussing the transition from XML layouts and view binding. It also covers Compose previews, Live Edit, and ComposeView and AndroidView for integration with traditional layouts.

## Source excerpt

Photo by Brett Jordan on Unsplash At Meetup, we are all-in on declarative UI. Our Organizer app was built from the ground up with Jetpack Compose and SwiftUI. We like it so much we've been integrating it into our existing Meetup app whenever possible. That road has not always been a smooth one, though, and we'd like to share some of what we've learned on that journey. Making the switch is worth it No doubt, some developers are hesitant to pick up yet another newly emerging Android technology. I certainly was. It's tempting to stay in the comfort of XML layouts and view binding. But wouldn't it be nice to create a screen with just one file? Do you really want to keep filling in boilerplate code for RecyclerViews and Adapters? We found that once everyone is on the same page with Compose, UI development speeds up significantly. Reusing a UI component is now just a matter of writing the declaration for it. No more extending a view, dropping it into an XML file, and then hooking up the backing code. Set up previews and use Live Edit When switching from XML layouts to Compose, the first downside that may jump out at developers is one of previewing the UI. For standard XML, changes made are reflected immediately in the design view, while Compose requires the app to be built. There are two things that can help alleviate this problem: Previews and the Live Edit feature. Declaring previews allows you to see how your composables will look in a running app. This is especially useful for commonly used elements. For instance, we have a MeetupButton that gets used across both of our apps, so having previews of each version of it helps us quickly identify which one to use when we're building a screen. Previews also make it easy to test layouts without repeatedly running your application and simulating states: Alongside previews, Live Edit lets you make changes to your composables while the app is running and see those changes immediately. Simply deploy your app from Android Studio