How do I change DPI for applications only (different density for system and separate for each app)? I suppose there exist some specific part of code to change DPI value.
3 Answers
Use App Settings for that. It needs a rooted device with Xposed Framework installed and its module be activated.
To change DPI for a specific app, launch App Settings → choose the app for DPI scaling (force-stop the app too) → switch the slider next to Settings → add DPI value and save.
See screenshots:
- first image -- before changing the DPI of the app
- last image -- after changing the DPI of the app
The rest is untouched, such as status bar or the keyboard app.
(Click image to enlarge)
-
This answer is so correct as long as you are in below Android 7. Exposed doesn't work in Nougat and there is no possibility to support. Does anyone know how to have per app custom DPI option in Nougat without Xposed?– MushfiqJul 7, 2017 at 11:58
You can use Tasker (paid; 7 day free trial) as well provided that OS is rooted.
- Profile: Application → select app fro DPI scaling
Task: Action: Code → Run Shell
Command:
wm density <DPI>
wm
implies Window Manager. Replace<DPI>
with the DPI you want.- Check Use Root
Exit task: Action: Code → Run Shell
- Command:
wm density reset
- Check Use Root
- Command:
That's it. Launch the app and the density of the whole system will change. Exit or switch the app and DPI would revert back to normal. The fluidity of the switch is not up to the level of App Settings, but it's acceptable.
-
This seems to make my device soft reboot. :/ The DPI appears to change but then it crashes and boots again. Apr 27, 2016 at 16:15
-
Make a slight change in density and then proceed. It works well in stock Android 5.0.2, that's why I posted this answer.– Firelord ♦Apr 27, 2016 at 16:19
-
I'm running CM12.1 on a Note 4. Tried only a small change but it's still crashing unfortunately. Thanks for the help though. Apr 27, 2016 at 16:27
-
CM supports changing density from Settings app -> Display? Have you tried it? Do you face the same issue? And you're not using a nightly build, correct?– Firelord ♦Apr 27, 2016 at 16:35
Use Xposed Installer + GravityBOX.
-
3We're looking for detailed answers here. Please see How to Answer and extend your answer into the required steps.– Firelord ♦Oct 13, 2015 at 19:47
-
@Firelord You're looking for "lazy" answers, but the link you provided states this one is adequate. The only thing it was really missing is a link. Apr 27, 2017 at 3:23