Android: Optimizing Apps in your hands? — Part 2

Minimize the Application Size

https://developer.android.com/topic/performance/reduce-apk-size

Effective API design

  • Consistency: The developer should know that expect, leaving no space for least astonishment.
  • Completeness: Having reduced workarounds

Starting from UI and going all the way to data can be one great way to design a consistent and complete API payload that improves your app’s performance. Just because you can send, don’t send everything from mobile to your API. Only send what’s required.

https://docs.oracle.com/cd/E76467_01/alloc/pdf/141/html/operations_guide/alloc-og_restful-impl.htm

Cache Data to Optimize for Offline Mode

  • Reduce your server load
  • Reduce the number of your mobile phone’s radio usage, improving your app’s battery life

If you don’t have a testing team at your disposal, try switching your phone into the airplane mode and test your app for offline performance.

Optimizing Screen Size for High Mobile App Performance

As a rule of thumb:

  • Build for small and medium screens
  • Optimize for MDPI and HDPI
  • Implement adaptive UI flows

Don’t have a 100’s of devices to test the screen size and resolution? Test with emulator configurations.

Memory Usage in Android

Considering RAM limitations throughout app development, and apps that are running in the background can hog unnecessary resources.

But, you can optimize your app by:

  • Limiting the lifespan of services, consider using intent service to limit the lifespan
  • Release UI resources when users move to a different UI
  • Utilize memory efficient code constructs
  • Minimize the use of external libraries

How Fast does your App Launches?

Bottom line, apps need to start quickly!

  • Instantiation of many views
  • Expensive content like decoding bitmaps
  • Running layouts

To make your app launch faster on Android:

  • Avoid memory churns due to allocation and garbage collections whenever possible
  • Use tools like Apteligent to monitor and optimize your app launch time
  • Avoid initialization code in your app’s object
  • Remember, an app that has been launched recently, and an app that is launching for the first time will behave differently

Restoring User Data on New Devices

Preserving settings data can help enhance the quality of your application by:

  • Any setting modified by the user
  • Push notification settings
  • Whether the user has seen the welcome screens and introductory onboarding screens

Find Latency Killers

To effectively deal with latency related issues:

  • You can restrict third-party latency sources when your network quality is poor
  • Reduce the need for latency killer APIs that you might be using on your mobile

--

--

🎓 “A person who never made a mistake never tried anything new.” —Albert Einstein

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Leo N

🎓 “A person who never made a mistake never tried anything new.” —Albert Einstein