I have an application running on tablet devices with two panes, for the left one I have a simple animation on replacing a fragment:
private void loadLeftFragment(Fragment fragment, boolean isAnimated) {
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
if (isAnimated) {
fragmentTransaction.setCustomAnimations(android.R.anim.slide_in_left,
android.R.anim.slide_out_right);
}
fragmentTransaction.addToBackStack(null);
fragmentTransaction.replace(R.id.left_frame, fragment).commit();
}
Please notice the animation peace of code. It runs perfectly smooth on Nexus 7, but on Galaxy Tab 2 it is not. So I experimented with android:hardwareAccelerated="true/false"
tag in AndroidManifest.xml. And what I got is that when the value is set to false
the animation on Galaxy Tab 2 is such as on Nexus 7, i.e. smooth and good looking. I didn't expect such a behavior assuming it should be vice versa - setting the hardwareAccelerated
value to true
makes things 'smoother'. But it happens if I set it to true
I see lags, when false
it is just nice! What I'm missing here? Thank you.
Hardware acceleration is the process to use device hardware to speedup drawing operations of android application. In other word, android use hardware acceleration to speed up 2D rendering or fast up the image and video rendering. It is by default enabled if your Target API level is >=14.
Hardware acceleration increases performance of the web browser. When the feature is enabled, some users experience issues that resemble the following when they view various websites: Hardware or software compatibility issues, such as websites that contain streaming or full-screen videos.
Should I use tethering hardware acceleration? Hardware acceleration is good because it boosts performance for certain tasks. But sometimes, it may cause issues such as freezing or crashing in Google Chrome or other browsers, forcing you to disable the feature to fix the issue.
Without hardware acceleration, most of these pages will stutter and freeze. Once you turn hardware acceleration on, you can enjoy digital fireworks, play around with a blob, or try solving a 3D Rubik's cube. Letting your CPU process and perform all tasks by itself greatly slows down your computer.
Well it all depends on the memory usage. What happens when you turn on hardware acceleration is, app’s animations and UI rendering happens with the GPU and that causes the system to take a hit to memory usage. Loading up the OpenGL drivers for each process takes memory usage of roughly 2MB, and boosts it to 8MB. On devices with limited RAM, this can be a real issue. When more RAM is eaten up, the system will necessarily have to close more background tasks to save memory.
So this option must be used cleverly and depending on the target devices.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With