<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Alex Styl on Medium]]></title>
        <description><![CDATA[Stories by Alex Styl on Medium]]></description>
        <link>https://medium.com/@alexstyl?source=rss-4bd1dada568c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*heUuL6YXRV0FcQLOxp7Jeg.png</url>
            <title>Stories by Alex Styl on Medium</title>
            <link>https://medium.com/@alexstyl?source=rss-4bd1dada568c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 12:20:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alexstyl/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[From View to Composable: A Quick jump to Jetpack Compose from a Android View mindset (with Cheat…]]></title>
            <link>https://medium.com/@alexstyl/views-to-composables-d715b92c6055?source=rss-4bd1dada568c------2</link>
            <guid isPermaLink="false">https://medium.com/p/d715b92c6055</guid>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[ui]]></category>
            <dc:creator><![CDATA[Alex Styl]]></dc:creator>
            <pubDate>Mon, 04 Apr 2022 08:18:28 GMT</pubDate>
            <atom:updated>2022-06-20T14:54:48.349Z</atom:updated>
            <content:encoded><![CDATA[<h3>From View to Composable: A Quick jump to Jetpack Compose from an Android View mindset (with cheat sheet)</h3><figure><img alt="From View to Composable: A Quick jump to Jetpack Compose from an Android View mindset (with cheat sheet)" src="https://cdn-images-1.medium.com/max/1024/1*vUIiuYbxdwISitC1rdgRuw.png" /></figure><p>Building User Interfaces (UIs) using Jetpack Compose can be daunting after years of building interfaces with Android Views (XML anyone?). This article covers the basics of Jetpack Compose from an Android View background in order to speed up your learning of Compose.</p><h3>From View to @Composable</h3><p>In Jetpack Compose, each component that needs to be rendered on the screen can be defined as a Kotlin Unit function marked with the @Composable annotation like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0MutsY56sDxS-mo-MSDsyA.png" /></figure><p>We call those functions <em>composables</em>. The above composable will render a Card with a title and a subtitle, with a spacing of 10.dp in between.</p><p>Every time the title and description change, the UI will be updated to reflect the updated values. This is what we call <em>recomposition</em>.</p><p>You may only call composable functions from other composable functions. Because of this, activities that use Composable to render their layouts will look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PoPd5ZBZX5th12wVDYpSTA.png" /></figure><p>setContent {} is an extension function of the ComponentActivity [1]. Using composables in a Fragment needs a ComposeView like so:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nGLPj9Tq10ueo8ukOhU3ug.png" /></figure><h3>Set listeners and other common attributes using Modifiers</h3><p>In the View world, there are some common attributes and features found in most Views out there. Things like setting click and touch listeners, applying elevation, alpha, to name a few. For anyone creating their own custom views, there was a lot of boilerplate code to implement for your view to support such operations.</p><p>Compose introduces the concept of <a href="https://developer.android.com/jetpack/compose/modifiers-list">Modifiers</a>. Modifiers provide functionality and features to composables without being tied to specific composables. Some Modifiers can be used for styling the composable (see <a href="https://developer.android.com/reference/kotlin/androidx/compose/foundation/package-summary#(androidx.compose.ui.Modifier).background(androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Shape)">background()</a>, <a href="https://developer.android.com/reference/kotlin/androidx/compose/foundation/package-summary#(androidx.compose.ui.Modifier).border(androidx.compose.foundation.BorderStroke,androidx.compose.ui.graphics.Shape)">border()</a> , <a href="https://developer.android.com/reference/kotlin/androidx/compose/ui/draw/package-summary#(androidx.compose.ui.Modifier).clip(androidx.compose.ui.graphics.Shape)">clip()</a> , <a href="https://developer.android.com/reference/kotlin/androidx/compose/ui/draw/package-summary#(androidx.compose.ui.Modifier).shadow(androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Shape,kotlin.Boolean,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color)">shadow()</a>, <a href="https://developer.android.com/reference/kotlin/androidx/compose/ui/draw/package-summary#(androidx.compose.ui.Modifier).alpha(kotlin.Float)">alpha()</a>, <a href="https://developer.android.com/reference/kotlin/androidx/compose/animation/package-summary#(androidx.compose.ui.Modifier).animateContentSize(androidx.compose.animation.core.FiniteAnimationSpec,kotlin.Function2)">animateContentSize()</a>), others help with the placement and sizing of the composable (see <a href="https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/package-summary#(androidx.compose.ui.Modifier).fillMaxWidth(kotlin.Float)">fillMaxWidth()</a> , <a href="https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/package-summary#(androidx.compose.ui.Modifier).size(androidx.compose.ui.unit.Dp)">size()</a>, <a href="https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/package-summary#(androidx.compose.ui.Modifier).heightIn(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)">heightIn()</a>, <a href="https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/package-summary#(androidx.compose.ui.Modifier).padding(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)">padding()</a>) and others can bring functionality to the composable such as enabling click behavior or dragging (see <a href="https://developer.android.com/reference/kotlin/androidx/compose/foundation/package-summary#(androidx.compose.ui.Modifier).clickable(kotlin.Boolean,kotlin.String,androidx.compose.ui.semantics.Role,kotlin.Function0)">clickable()</a> , <a href="https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/package-summary#(androidx.compose.ui.Modifier).draggable(androidx.compose.foundation.gestures.DraggableState,androidx.compose.foundation.gestures.Orientation,kotlin.Boolean,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Boolean,kotlin.coroutines.SuspendFunction2,kotlin.coroutines.SuspendFunction2,kotlin.Boolean)">draggable()</a>, <a href="https://developer.android.com/reference/kotlin/androidx/compose/foundation/selection/package-summary#(androidx.compose.ui.Modifier).toggleable(kotlin.Boolean,kotlin.Boolean,androidx.compose.ui.semantics.Role,kotlin.Function1)">toggleable()</a>, <a href="https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary#(androidx.compose.ui.Modifier).swipeable(androidx.compose.material.SwipeableState,kotlin.collections.Map,androidx.compose.foundation.gestures.Orientation,kotlin.Boolean,kotlin.Boolean,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function2,androidx.compose.material.ResistanceConfig,androidx.compose.ui.unit.Dp)">swipeable()</a> ).</p><h3>From ViewGroups to Rows, Columns and Boxes</h3><p>There are some composables whose main purpose is to help you arrange other composables on the screen. Those composables are the <em>ViewGroups</em> of the Compose world.</p><p>The most common ones to get started are: Column , Row , Box , LazyColumn and LazyRow. These composables accept the composables they need to arrange withint a content lambda function. Some tend to provide a special Scope class receiver that enables access to specific Modifiers.</p><p>Instead of using a LinearLayout with a VERTICAL or HORIZONTAL orientation, use a Column or Row to arrange their composables vertically or horizontally respectively. Within their respective scope, you have access to the weight() modifier, which works the same way as a LinearLayout’s weight.</p><figure><img alt="Row { Text(“Main Header”) Spacer(Modifier.weight(1f) Text(“23 mins ago”) }" src="https://cdn-images-1.medium.com/max/1024/1*NlanwWqhKpRnTBbtcBIu3Q.png" /><figcaption>Copy paste code @ <a href="https://gist.github.com/alexstyl/3b0780a927938b8079595a2983abb848">https://gist.github.com/alexstyl/3b0780a927938b8079595a2983abb848</a></figcaption></figure><p>Instead of using a FrameLayout , use a Box in order to place composables on top of each other. In the Box’s Scope you have access to align which provides similar functionality to FrameLayout’s gravity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-jIERrmVFMdYRKQ79Zecsg.png" /><figcaption>Copy paste code @ <a href="https://gist.github.com/alexstyl/3b0780a927938b8079595a2983abb848">https://gist.github.com/alexstyl/3b0780a927938b8079595a2983abb848</a></figcaption></figure><p>Working with lists is straightforward in Compose. Instead of using a RecyclerView with an adapter and view holders, use a LazyColumn or LazyRow to create a vertically or horizontally scrolling list respectivelly. The LazyListScope grants you access to the item {} function, in which you can place the items of the list without having to specify a ViewType anymore. As a bonus, there is a stickyHeader {} function which will provide sticky header functionality to the item.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gj_7hKoXPiBz5eyQudv1Dw.png" /><figcaption>Copy paste code @ <a href="https://gist.github.com/alexstyl/3b0780a927938b8079595a2983abb848">https://gist.github.com/alexstyl/3b0780a927938b8079595a2983abb848</a></figcaption></figure><h3>Wiring business logic in your Screen level composables</h3><p>Even though all composables are pure Kotlin functions, you will quickly realise that some are different than others. A composable might represent an element on the screen (such as a contact photo) and others might represent an entire screen. The screen level composable (the top level one) is the place where you want to be holding objects such as your ViewModels, and pass down values emitted from the ViewModel to nested composables, while reacting to events emitted from its nested composables.</p><p>Having a composable receive the values it needs to render on the screen as parameters, while bubbling up any events such as click listeners is what we call <a href="https://developer.android.com/jetpack/compose/state#state-hoisting"><em>state hoisting</em></a>. It makes the composable <em>stateless</em> and enables reusability and flexibility. As an added bonus, any business logic wiring ends up living in a single composable instead of being scattered around.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2zDOOuLUySoPx5dohgCA1g.png" /></figure><h4>Recap</h4><p>This was a quick jump into Jetpack Compose coming from an Android View background. In the Compose world, each component that needs to be rendered on the screen is marked @Composable called a composable.</p><p>Use Modifiers to apply common functionality to any composable such as click listeners and elevation.</p><p>Composables such as Column , Row , Box,LazyColumn and LazyRow are the ViewGroups of the Compose world and can be used to arrange your composables on the screen.</p><p>Keep your composables stateless and do the wiring in the screen level composable to enable reusability and flexibility.</p><p><strong>⚡️ BONUS⚡ Views to Compose Cheat Sheet</strong></p><p>Here is everything covered in a glimpsable cheat sheet:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*_kpyyTPAY8-iXEVaqxGk0A.png" /></figure><p>PS: I am active on Twitter. <a href="https://twitter.com/alexstyl">Follow @alexstyl</a> for more Jetpack Compose tips.</p><p>Special thanks to <a href="https://medium.com/u/9706138c9bfb">Sebastiano Poggi</a> for proof reading this article.</p><p>[1] ComponentActivity is part of the androidx.activity:activity-compose dependency (<a href="https://developer.android.com/jetpack/androidx/releases/activity">link</a>)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d715b92c6055" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[If I were to start my Android career in 2022, here is how I would do it]]></title>
            <link>https://proandroiddev.com/if-i-were-to-start-my-android-career-in-2022-here-is-how-i-would-do-it-c7f149dc8cbf?source=rss-4bd1dada568c------2</link>
            <guid isPermaLink="false">https://medium.com/p/c7f149dc8cbf</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[engineering]]></category>
            <dc:creator><![CDATA[Alex Styl]]></dc:creator>
            <pubDate>Wed, 08 Dec 2021 17:22:33 GMT</pubDate>
            <atom:updated>2022-01-27T15:00:05.422Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y0buXYtRjCfv25S9tkIB1w.jpeg" /><figcaption>Android statues in Google Campus (Photo by <a href="https://unsplash.com/@gcoppa?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Guido Coppa</a> on <a href="https://unsplash.com/s/photos/android?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>)</figcaption></figure><p>The Android ecosystem has changed dramatically over the years and along with its development tools.</p><p>This article will cover how one can start their Android Development career, covering what is and isn’t important to learn, and what to do to land your first job.</p><h3>Should I learn Java or Kotlin for Android Development?</h3><p><a href="https://android-developers.googleblog.com/2017/05/android-announces-support-for-kotlin.html">Google announced official Kotlin support for Android Development in 2017</a>. Modern Android applications and libraries are written in Kotlin, even though Java is still used, primarily for legacy reasons. The two languages are very similar to one another and a project can use both languages. Java is older than Kotlin. This means that there is more tooling and support for Java. Kotlin is a modern language, making it simpler to use.</p><p>Google provides excellent support for both languages, although Kotlin is the officially recommended one for Android. In the industry, most companies ask Android Developers for Kotlin knowledge and experience, instead of Java. Because of this, I would encourage you to focus on learning Kotlin.</p><p>At the same time, do not ignore Java resources and tutorials online. There are plenty of Android resources written in Java which are still relevant to this date.</p><p>Android Studio, the official IDE for Android Development, is based on JetBrains IntelliJ IDEA. One cool feature it has is auto-converting Java code to Kotlin. This means that any snippet you might find online (i.e., on <a href="https://stackoverflow.com/questions/tagged/android">StackOverflow.com</a>) can be converted to Kotlin for you.</p><p>Other than Java and Kotlin, there are other alternative languages one can use (such as C#, Javascript, etc). We will briefly talk about them in a later part of this article.</p><h3>How to learn Android Development</h3><p>It is possible to learn Android Development 100% for free as long as you have a computer and access to the Internet. You do not need to own any Android devices to start learning or to build apps.</p><p><a href="https://developer.android.com/">The official Android Developers website</a> is a great starting point. There you will find resources on how to get started learning and publishing Android applications. For example, <a href="https://developer.android.com/courses/android-basics-kotlin/course">Android Basics in Kotlin</a> is excellent for covering the Android basics and it’s also 100% free.</p><p>Google also provides <a href="https://codelabs.developers.google.com/?cat=android">numerous Android codelabs</a>, too. When you get more advanced with Android Development and need to explore more topics in depth, codelabs are fantastic for hands-on learning.</p><p>The best way to learn is by doing. As soon as you have a rough idea of how to set up your own Android app, get building.</p><p>This is by far the best way to learn as:</p><ol><li>it will provide you with a lot of the skills for your future day to day work</li><li>it will make you more comfortable with dealing with code and looking for answers on your own</li><li>it will give you something tangible to include in your CV</li></ol><p>A small but well-crafted app will do wonders. Think about an app that you wish existed, or something you do everyday and wish was automated. It doesn’t have to be perfect or compete with Uber or Facebook; it needs to be completed and shipped.</p><h3>Career life-hack: Join a community</h3><p>Joining a community can have a tremendous impact in your career progression. Having a group of people that have the same struggles as you can feel much less frustrating and can lift each other up. This can also lead to long lasting connections with people in the industry.</p><p>The industry is much smaller than you might think. People tend to prefer working with people they already know. The best jobs in the market are not available through job postings but rather through word of mouth. Your friend in Dream Company Inc will be more than happy to refer you to your dream job instead of having to interview the thousand candidates that might apply. It’s a win-win situation.</p><p>Last but not least, communities usually share learning tricks, news, tools and memes. Instead of you having to search for everything on your own, people will gladly share it with you.</p><h3>How do I find communities to join?</h3><p>Check your local communities (such as your school/university/hacking groups) for anyone that happens to be learning Android. If you happen to have friends that are into Android Development, high chances are they are already part of a community, that they can happily refer you to.</p><p>Google has a directory of Google promoted communities (called Google Developer Groups or GDG) across the globe that <a href="https://gdg.community.dev/chapters/">can be accessed here</a>.</p><p><a href="https://www.meetup.com/find/?keywords=android&amp;source=EVENTS">meetup.com</a> can be used to look up for nearby and online Android meetups, which can be a good lead for finding communities.</p><p><a href="https://reddit.com/r/androiddev">/r/androiddev</a> is a great place to see what Android Developers are chatting about and it is one huge global community on its own.</p><p>Last but not least, have a look at Android’s official Twitter account <a href="https://twitter.com/AndroidDev">(@AndroidDev)</a>. It is really active and usually shares tons of helpful bits there.</p><h3>How to stand out when applying for a job</h3><p>Certifications and diplomas are quickly losing their value in the job market and <a href="https://www.glassdoor.com/blog/no-degree-required/">many big companies have stopped asking for Computer Science degrees</a>.</p><p>On the contrary, what makes candidates stand out from the rest is real world experience. Luckily in our profession, this is something that can be achieved using the Internet. Specifically:</p><ol><li>building and distributing a real world application to the world (i.e., via the Play Store)</li><li>creating a profile on GitHub and contributing to Open-Source Software</li><li>share your journey of learning online, via blog posts and social media</li></ol><p>The great thing about all the above is that they are timeless and will give you credibility throughout your entire career.</p><h3>I know C#, should I start with Xamarin instead? (or Flutter, React Native, and other similar frameworks)</h3><p>It is rare for a company to be working on Android apps without having an iOS version of the same app. In order to save effort and money, new technologies were created to generate both Android and iOS apps with the same code base. This produced frameworks such as Xamarin, Flutter and React Native.</p><p>Compared to native Android development, they are fairly different. They have their own tooling, programming language, communities, benefits and, most importantly, problems. While working with such technologies you will have to tackle the unique issues of each framework, on top of the ones that come with Android and iOS native development.</p><p>Start with the basics of Android Development and understand its quirkiness before getting yourself to more unknown territory.</p><h3>What is Jetpack Compose and should I learn it?</h3><p>Jetpack Compose is Google’s new UI framework for Android. It is a new way of writing UI using Kotlin. The new framework is a joy to work with and I can only say positive things about it.</p><p>Pragmatically, though, the framework got its <a href="https://android-developers.googleblog.com/2021/07/jetpack-compose-announcement.html">1.0 release quite recently</a>. This means that companies have not had many chances to use it yet, and many are trying to figure out how to use it in their apps. It’s not a requirement for many jobs, yet.</p><p>For those starting to learn Android now, focus on the Android basics and build your first Android app using Views. You can always hack a new app with Compose to see what it is about.</p><h3>Get building</h3><p>This is how I would approach my career if I were to start from scratch after 10 years of Android development. Hope this article covers all the unknowns you might have had about starting yours.</p><p>Special thanks to <a href="https://medium.com/u/8f49ec02da5e">Daniele Conti</a>, <a href="https://medium.com/u/f1cd8931f915">Chris Basha</a> and <a href="https://medium.com/u/9706138c9bfb">Sebastiano Poggi</a> for proof-reading this article.</p><p>PS: I am more active on Twitter, where I share what I am currently building. <a href="https://twitter.com/intent/follow?screen_name=alexstyl">Follow me (@alexstyl)</a> for updates and other Android sharings such as this one.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7f149dc8cbf" width="1" height="1" alt=""><hr><p><a href="https://proandroiddev.com/if-i-were-to-start-my-android-career-in-2022-here-is-how-i-would-do-it-c7f149dc8cbf">If I were to start my Android career in 2022, here is how I would do it</a> was originally published in <a href="https://proandroiddev.com/">ProAndroidDev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>