为 Galaxy S8 创建模拟器?- 安卓工作室 [英] Creating an emulator for Galaxy S8? - Android Studio

查看:44
本文介绍了为 Galaxy S8 创建模拟器?- 安卓工作室的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个新的硬件配置文件,试图为 Galaxy S8/S8+ 制作和模拟器.我将屏幕尺寸设置为 5.8/6.2 英寸(取决于 S8 还是 S8+,尽管这似乎不会影响模拟器),并将屏幕分辨率设置为 1440 x 2960,与设备一样.模拟器看起来与真实设备上的完全不同.在真正的 S8+ 上测试我的应用程序显示它的布局很差,但在模拟器上它似乎相对有序,我注意到它使用了我的 Nexus 6 模拟器 (xxxhdpi) 的尺寸.现在使用的尺寸值并不是什么大问题,因为考虑到 Nexus 6 不再生产,我很高兴逐步淘汰它.

I create a new hardware profile in an attempt to make and emulator for the Galaxy S8/S8+. I set the screen size to 5.8/6.2 inches (depending on whether S8 or S8+, despite the fact this doesn't appear to affect emulator anyway), and the screen resolution to 1440 x 2960, like the device. The emulator appears nothing like it does on the real device. Testing my app on a real S8+ shows it to be laid out poorly, but on the emulator it appear to be relatively organised, and I noticed it uses the dimens for my Nexus 6 emulator (xxxhdpi). Now the dimens values used isn't a big deal, because I'm happy to phase out the Nexus 6 considering it's no longer in production.

所以我在我的启动器 Java 类中添加了一些代码来获取模拟器的尺寸,这是我从我的 S8 模拟器中得到的:{密度=3.5,宽度=1440,高度=2792,缩放密度=3.5, xdpi=560.0, ydpi=560.0}除了高度表示 2792 而不是 2960(我认为这是注定要发生的)这一事实之外,我相信我看到了问题——密度是 3.5.正如怀疑的那样,这与 Nexus 6 的密度相同.所以我创建的模拟器不适用于 Galaxy S8,这在我与以扭曲方式显示我的应用程序的真实 S8+ 的比较中很明显.据我所知,Galaxy S8 的密度为 4,而不是 3.5.IDE 说该设备有 560dpi.现在我需要能够创建一个密度为 4 的模拟器,并且我已经放下了相同的规格.我怎样才能做到这一点?如何在不使用实物的情况下测试 Galaxy S8?IDE 没有为此设备提供预配置的模拟器.

So I add some code to my launcher Java class that that gets me the dimensions of the emulator, here is what I get from my S8 emulator: {density=3.5, width=1440, height=2792, scaledDensity=3.5, xdpi=560.0, ydpi=560.0} Besides the fact the height says 2792 instead of 2960 (I assume this is meant to happen), I believe I see the issue - the density is 3.5. As suspected, this is the same density as the Nexus 6. So the emulator I'm creating is not for the Galaxy S8, and this is evident in my comparison to a real S8+ which displayed my app in a distorted manner. As far as I'm aware, the Galaxy S8 has a density of 4, not 3.5. The IDE says the device has 560dpi. Now I need to be able to create an emulator with a density of 4, and the same specs I've already put down. How can I do this? How can I test for the Galaxy S8 without using the real thing? There isn't a preconfigured emulator for this device provided by the IDE.

非常感谢.

推荐答案

没有预配置的模拟器.根据我的经验,即使您尝试使用匹配的设备配置进行创建,它也没有多大用处,因为它仍然会运行股票 android.

There is no preconfigured emulator. As per my experience, even if you try to create with matching device configuration it won't be much of use as it will still run stock android.

所以,我发现三星提供了类似 firebase 的在线测试实验室.

So, I found that Samsung provides online test lab like firebase.

您可以访问 http://developer.samsung.com/rtlLanding.do 和一探究竟.如果您没有开发者帐户,他们会免费提供 5 分钟.

You can go to http://developer.samsung.com/rtlLanding.do and check it out. They give 5 minutes free if you don't have developer account.

根据三星,您可以获得以下信息:

As per Samsung, you can get the following:

  • 每天向每位三星开发者用户提供 20 个积分.
  • 拥有 1 个积分,用户可以使用远程测试实验室服务 15 分钟.
  • 最少预约时间:30 分钟(2 个学分)
  • 最长预订:每天 10 小时(40 积分)

更多详情:http://developer.samsung.com/remotetestlab/rtlAboutRTL.action

这篇关于为 Galaxy S8 创建模拟器?- 安卓工作室的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆