Posts

Showing posts with the label Mobile

Get the Jetpack Compose Preview Auto Generated with Android Studio's Otter Release | AI Magic

Image
  Discover how Android Studio Otter’s latest release transforms Jetpack Compose development through AI-powered tools that eliminate boilerplate and speed up UI iteration. In this post, learn about Compose Preview Generation and Transform UI — the features that let you generate live UI previews with mock data automatically and modify your layouts using natural language commands in the IDE. Whether you’re a beginner or seasoned Android developer, these tools will streamline your workflow and unleash your creative potential. What is Compose Preview Generation? This feature automatically generates Compose preview functions and mock data for your composables. Instead of manually writing boilerplate preview code, Android Studio Otter’s AI creates it for you — saving time and allowing you to focus on crafting great UI. Practical Demonstration I created a screen recording showing these features in action inside Android Studio Otter — generating previews for a user profile card and updating...

Managing App Versioning and Changelogs- 6

Image
 When you release a new version of your Android app, there are a few important details that need to be updated: the version number, version code, and changelog. These are all critical for tracking releases and communicating new features or fixes to your users. Managing these elements manually can be time-consuming and error-prone, especially as your app evolves. But with Fastlane , you can automate versioning and changelog management, saving you time and avoiding mistakes. In this section, we’ll explore how to automate app versioning and changelog management using Fastlane . Step 1: Automating Versioning with increment_version_code Every time you upload a new version of your app to the Play Store, you need to increase the version code . This is required by Google Play to differentiate between different versions of your app. If you don’t increment the version code correctly, your app upload will fail. Fastlane makes this simple by automating the version code increment with the incre...

Implement SharedViewModel in Pure Jetpack Navigation App

Image
  We all must have used SharedViewModel in Fragment based navigation using activityViewModels(). But now… what if our app is built in 100% Jetpack Compose? No fragments, No FragmentManager, No ViewModelStoreOwner. So… if we have 2 basic authentication screens LoginScreen and RegisterScreen, how can we share viewmodel/state across composables? 👇🏻 // Inside any Composable screen val parentEntry = remember(navController) { navController.getBackStackEntry( "auth_graph" ) // Your navGraph route } val viewModel: SharedViewModel = viewModel(parentEntry) Now both LoginScreen() and RegisterScreen() inside auth_graph can share the same SharedViewModel. ❤️ 💡 Why this matters If we’re building multi-step flows (Auth, Checkout, Onboarding), this keeps our architecture clean, and state scoped. Checkout the Git Repo from here… https://github.com/dev-vikas-soni/compose-shared-view-model If you enjoyed the article and would like to show your support, be sure to: 👏 Applaud for the story...

Automating Build and Release Process in Fastlane - 3

Image
Now that you’ve set up Fastlane in your Android project, it’s time to automate your build and release process. The beauty of Fastlane lies in its ability to take over the repetitive tasks you’ve been doing manually, allowing you to focus on what really matters — coding new features and improving your app. In this section, we’ll walk through how to automate everything from building your app to releasing it to the Google Play Store — all with a single command. Step 1: Create a Build Lane in Your Fastfile The first thing you’ll need to do is define a lane for building your app. A lane in Fastlane is simply a collection of tasks you want to automate. Let’s start by adding a simple build lane to your Fastfile . This lane will run the Gradle task that builds your app in release mode. Here’s how to set it up: platform :android do desc "Build the release APK" lane :build do gradle( task: "assembleRelease" ) end end gradle(task: “assembleRelease”) : This comma...

Setting Up Fastlane in an Android Project- 2

Image
                                        Setting Up Fastlane in an Android Project So, you’ve heard how Fastlane can make your life easier, but how do you actually set it up in your Android project? Don’t worry! The process is simple and straightforward, and in this section, we’ll walk you through it step by step. By the end, you’ll have Fastlane up and running, automating your app’s build and release process like a pro. Step 1: Install Fastlane First, you’ll need to install Fastlane on your machine. The good news? Fastlane is compatible with both macOS and Linux, and it’s easy to install with Homebrew (if you’re on macOS) or RubyGems (for other systems). For macOS (using Homebrew): If you’re on macOS, you can install Fastlane with the following commands in your terminal: brew install fastlane For Linux and other systems (using RubyGems): If you’re on Linux (or just prefer usin...

JIT vs AOT Compilation | Android Runtime

Image
           D id you ever think, what happens when you install your app in your Android device, it shows INSTALLING for fraction of second and app get opens. What happens exactly behiend the scene? Found Interesting???? Cool !!! let’s clear all the doubt in this blog. You would have definetely read the buzz words JIT(Just-in-time) and AOT(Ahead of time) at many ocassions. We’ll dig it down in details in this article, stay tuned…. Android apps run on Android Runtime (ART) , which replaced Dalvik since Android 5.0 (Lollipop). ART supports both JIT (Just-In-Time) Compilation and AOT (Ahead-Of-Time) Compilation to improve performance and efficiency. JIT (Just-In-Time) Compilation How it Works: Compiles bytecode into native machine code at runtime (when the app is executed). Stores frequently used methods in memory to speed up subsequent executions. Advantages: Faster app installation because it doesn’t require full compilation beforehand. Reduces s...