androidperformanceperformance-estimation

Android device performance estimation techniques


I am developing an Android application and I am facing what I thought would be a common issue, but to my surprise there doesn't seem too be much documentation about it (or I didn't know how to search).

Basically, the issue is about estimating the performance of a device. In an activity, I have scenario where I can play an animation (fade out of multiple views), but in some devices the animation is overkill and makes the application run slow. So in that scenario, instead of playing the animation, I can set the visibility to INVISIBLE, which is far better performant but less appealing for the user.

My problem is in detecting when should I use the animation and when should I use the simple visibility change. I don't know how to detect it because this doesn't really depend on the SDK version, nor the phone model. I guess some indicators would be how much RAM is available or something like that. But I would like to know if there are any common techniques used for similar scenarios.


Solution

  • You can use the method isLowRamDevice()

    Also to calculate the memory usage information, You can use http://developer.android.com/reference/android/app/ActivityManager.MemoryInfo.html