feat: Add Baseline Profile for Smoother UI, Faster Animations, and Op… #187
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
🚀 What’s New
This PR integrates Baseline Profiles into the project to significantly enhance app performance. By allowing the Android Runtime (ART) to pre-optimize critical code paths during installation, this results in:
⚡ Faster cold and warm startups
🧈 Smoother scrolling
🎞️ More fluid UI animations
📲 Snappier screen transitions and navigation
This improvement is particularly noticeable on lower-end and mid-tier devices, leading to a better initial user experience.
🎯 What’s Included
✅ Integration of the profileinstaller library.
✅ Project configuration to collect and package the baseline profile for optimization.
Note: The baseline-prof.txt file, which defines the critical code paths, needs to be generated using the steps below.
🛠️ How to Generate and Use the Baseline Profile
Configure Baseline Profile Generation:
Go to Run/Debug Configurations.
Click the + icon and select Android Baseline Profile.
Choose your app module.
Ensure "Generate Baseline Profile for all variants" is selected.
Click Apply and then OK.
Generate the Baseline Profile:
Run the newly created Baseline Profile configuration (make sure a device or emulator is connected). This will run instrumentation tests to capture key interactions and generate the baseline-prof.txt file.
Build with the Baseline Profile:
Switch the build variant in Android Studio to benchmarkRelease.
Build or generate an APK/AAB. This build will now include the generated Baseline Profile for optimization.