Android帧率修改

1.app设置帧率

  • 影响范围:仅影响当前App,退出App后帧率恢复正常
  • 参考代码
java 复制代码
// 读取系统支持的Display mode
Display defaultDisplay = getWindowManager().getDefaultDisplay();
Display.Mode[] supportedModes supportedModes = defaultDisplay.getSupportedModes();

WindowManager.LayoutParams layoutParams = getWindow().getAttributes();
// 设置mode 0的帧率
layoutParams.preferredDisplayModeId = supportedModes[0].getModeId();
getWindow().setAttributes(layoutParams);

2.命令行的方式

java 复制代码
// 末尾数字0是modeId,也可以替换为1,2;不同的数字对应屏幕的能支持的不同帧率档位
adb shell service call SurfaceFlinger 1035 i32 0
相关推荐
mygljx6 小时前
MySQL 数据库连接池爆满问题排查与解决
android·数据库·mysql
xinhuanjieyi7 小时前
ruoyimate导入sql\antflow\bpm_init_db.sql报错
android·数据库·sql
闲猫8 小时前
基于RABC的权限控制设计
android
星霜笔记11 小时前
GitMob — 手机端 GitHub 管理工具
android·kotlin·github·android jetpack
LiuYaoheng12 小时前
问题记录:Android Studio Low memory
android·ide·android studio
独隅12 小时前
Python 标准库 (Standard Library) 全面使用指南
android·开发语言·python
always_TT12 小时前
strlen、strcpy、strcat等常用字符串函数
android
qqty121713 小时前
MySQL Workbench菜单汉化为中文
android·数据库·mysql
2401_8955213413 小时前
MySQL中between and的基本用法
android·数据库·mysql
云云鬼才14 小时前
CoCo编辑器、图形化编程怎么调用Scheme(跳转应用)
android