Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add M1 Mac support & Optimize app startup by deferring initialization of non-critical components #56

Merged
merged 8 commits into from
Jun 4, 2024

Conversation

thecraftman
Copy link
Contributor

This PR adds native support for running and building the Instant Weather app on Apple Silicon M1 Macs. Key changes include:

  • Update Android Gradle Plugin to 7.0+ and Gradle to 7.0+ for M1 support
  • Update Room library to 2.4.0+ for M1 compatibility
  • Update any other libraries to latest versions for better M1 support
  • Configure Android Studio emulator to run ARM images natively on M1
  • Update CI/CD pipelines to build and test on M1 agents
  • This allows the app to build and run much faster by leveraging the performance of the M1 chip. The emulator can now run ARM images natively for quicker app deployment and testing.

Also Optimize app startup by deferring initialization of non-critical components

Currently the app initializes several components like WorkManager, Analytics, Crashlytics etc. during app launch on the main thread. This slows down app startup.

We can improve this by:

  • Deferring initialization of non-critical SDK components until after app launch
  • Moving initialization work off the main thread wherever possible
  • Lazy loading features/screens not required during startup
  • Enabling R8 full mode to remove unused code
  • These optimizations can help bring the app startup time under 1 second to meet the Android Vitals baseline and provide a better experience to users.

@mayokunadeniyi mayokunadeniyi merged commit 52cc36b into mayokunadeniyi:main Jun 4, 2024
1 of 4 checks passed
@thecraftman thecraftman deleted the add-m1-support branch December 3, 2024 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants