当前位置:   article > 正文

android 获取屏幕分辨率_android::displayinfo

android::displayinfo

好不容易在模拟器上把程序调试通了,安装真机上,居然分辨率不正确,在模拟器上时正确的,获取分辨率的代码如下

android::DisplayInfo info;
android::SurfaceComposerClient::getDisplayInfo(android::DisplayID(0), &info);

使用c++实现的,

用java获取分辨率代码如下:

Display display = getWindowManager().getDefaultDisplay();
 int screenWidth = display.getWidth();
 int screenHeight = display.getHeight();

居然两种方法获取的分辨率不一样,导致真机上出现不正确的显示,

最后只好用java获取分辨率,传给c++层调用。


Kindle fire 配置使用

On the Kindle Fire Settings screen, go to "Device" and turn On "Allow Installation of Application From Unknown Sources"
Plug your Kindle Fire into your Mac.
Open ~/.android/adb_usb.ini with your favorite text editor
Add the value "0x1949" to the end of the file and save it.
You'll need to restart the adb server process to get it to re-read that file. Do that with "adb kill-server".
Run "adb devices" and you should see the attached device.

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/317256
推荐阅读
相关标签
  

闽ICP备14008679号