简体   繁体   English

Android模拟器与真实设备

[英]Android Emulator vs Real Device

开发人员应该注意哪些不同之处?

I am aware of these limitations: 我知道这些限制:

  1. Pre-installed software. 预装软件。 Real device can have preinstalled a lot more applications than emulator. 真实设备可以预先安装比模拟器更多的应用程序。
  2. You cannot use "capture" photo/video functions in emulator. 您无法在模拟器中使用“捕获”照片/视频功能。

According to emulator documentation , its limitations are: 根据模拟器文档 ,其局限性是:

The functional limitations of the emulator include: 模拟器的功能限制包括:

  • No support for placing or receiving actual phone calls. 不支持拨打或接听实际的电话。 You can simulate phone calls (placed and received) through the emulator console, however. 但是,您可以通过模拟器控制台模拟电话呼叫(放置和接收)。

  • No support for USB connections 不支持USB连接

  • No support for device-attached headphones 不支持设备连接耳机
  • No support for determining network connected state 不支持确定网络连接状态
  • No support for determining battery charge level and AC charging state 不支持确定电池充电水平和AC充电状态
  • No support for determining SD card insert/eject 不支持确定SD卡插入/弹出
  • No support for Bluetooth 不支持蓝牙

IMO you can use emulator to simplify UI development, to view UI on "device screen", to be sure that app layout is ok, app can be run, you can test some special cases by simulating gps position, network speed or messaging etc. But testing on real device is a must. IMO你可以使用模拟器来简化UI开发,在“设备屏幕”上查看UI,确保应用程序布局正常,app可以运行,你可以通过模拟gps位置,网络速度或消息等来测试一些特殊情况。 但是必须在真实设备上进行测试。

With the 1.5 SDK the following limitations exists (from the SDK website ): 使用1.5 SDK存在以下限制(来自SDK网站 ):

  • No support for placing or receiving actual phone calls. 不支持拨打或接听实际的电话。 You can simulate phone calls placed and received) through the emulator console, however. 但是,您可以通过模拟器控制台模拟拨打和接听的电话。
  • No support for USB connections 不支持USB连接
  • No support for camera/video capture (input). 不支持相机/视频捕捉(输入)。
  • No support for device-attached headphones 不支持设备连接耳机
  • No support for determining connected state 不支持确定连接状态
  • No support for determining battery charge level and AC charging state 不支持确定电池充电水平和AC充电状态
  • No support for determining SD card insertion/removal 不支持确定SD卡插入/移除
  • No support for Bluetooth 不支持蓝牙
  • No support for Multitouch 不支持多点触控

Based on experience I've noticed the following differences in actual developemnt: 根据经验,我注意到实际开发中存在以下差异:

  • There are bugs you'll be able to ignore in the emulator that will crash the device (not closing Cursors for example) 您将能够在模拟器中忽略将导致设备崩溃的错误(例如,不关闭游标)
  • You interact with the device differently than the emulator. 您与设备的交互方式与模拟器不同。 I use landscape mode a lot more with the real device than I do with the emulator. 我使用横向模式使用真实设备比使用模拟器更多。
  • There's a different CPU. 有一个不同的CPU。 Things that are fast on your emulator will be slower on the real device. 在真实设备上,模拟器上速度很快的东西会变慢。
  • You can dogfood with the device. 您可以使用该设备进行养狗。 It is harder to dogfood with the emulator. 使用模拟器进行狗食更难。

There is a google group here if you need real device testers. 如果您需要真正的设备测试人员, 这里有一个谷歌小组。

人们无法使用模拟器测试触摸事件,模拟器必须通过鼠标点击模拟器进行测试,任何开发人员都要开发基于触摸屏的应用程序。

I'd say the main thing is that there are several "real devices" currently using Android, and there will be more, with different hardware endowments -- some will have GPS and some won't, ditto for touchscreen, real keyboard as opposed to virtual on-screen one, camera resolution, etc, etc. 我要说的主要是有几个“真正的设备”目前正在使用Android,并且会有更多,有不同的硬件禀赋 - 有些会有GPS而有些则不会,同样适用于触摸屏,真正的键盘而不是虚拟屏幕,相机分辨率等等

While the OS will do a lot of the heavy lifting for you, you still want to make sure your design a user experience that makes sense on every Android device you intend to support, despite the variation in their HW features -- in this sense, designing applications for Android is more similar to designing them for, say, Linux, Windows, or the Web (cater for a wide variety of hardware-configuration details), rather than eg Macs or iPhone (where you need to consider a much narrower set of possible HW configurations). 虽然操作系统会为您做很多繁重的工作,但您仍然希望确保您的设计具有对您打算支持的每个Android设备都有意义的用户体验,尽管其硬件功能有所不同 - 从这个意义上讲,为Android设计应用程序更类似于为Linux,Windows或Web设计它们(满足各种硬件配置细节),而不是像Mac或iPhone(你需要考虑更窄的集合)可能的硬件配置)。

The emulator is (or tries to be;-) "one" Android device -- but there will be others ("real" ones;-) with different screen resolutions, input peripheral devices, etc, etc... 模拟器是(或试图成为;-)“一个”Android设备 - 但会有其他(“真正的”;-)具有不同的屏幕分辨率,输入外围设备等等...

One comment regarding google accounts: With version 8 of the google APIs for Android 2.2, you can add a google account on the device. 关于谷歌帐户的一条评论:使用适用于Android 2.2的谷歌API版本8,您可以在设备上添加谷歌帐户。 However, it will only allow authentication for tests of the google APIs (eg google documents) but not syncing of contacts etc. 但是,它只允许对Google API的测试进行身份验证(例如谷歌文档),但不允许同步联系人等。

这是一个错误,因为尝试了摄像头和视频支持(错误):摄像头和视频意图在“捕获”后不会将其输出存储在MediaStore数据库中。

In simple term an emulator is a device that runs on your computer screen whereas a real device is something you can hold. 简单来说,模拟器是在您的计算机屏幕上运行的设备,而真实设备是您可以容纳的设备。 There may be a few differences when it comes to use such as you can not use an em. 在使用时可能会有一些差异,例如您无法使用em。 I have written a detailed post about this you may consider reading. 我已经写了一篇关于你的详细帖子 ,你可以考虑阅读。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM