官术网_书友最值得收藏!

Virtual devices

There are so many Android devices available on the market that it would be an impossibility to thoroughly test our apps on very many real devices . It is for this reason that the system allows us to create emulated devices using the virtual device manager.

The AVD Manager allows us to create both form factor and hardware profiles from scratch and to provide several ready-made virtual devices and system images that can be downloaded from various manufacturers' websites.

 AVD configuration screen

Android emulators can be notoriously slow, even on very powerful machines, and this is to be expected, as creating a fully functioning virtual device is a remarkably complex task. There are, however, a few things that can be done to speed things up a little by designing each virtual device to match the particular tasks of the app we are developing. For example, if your app does not make use of the device camera, then do not include it in the configuration. Likewise, do not allocate much more memory than the app itself requires.

Android virtual devices are not the only option available to us, and there are a small but growing number of third-party emulators. Many of these are designed with gamers rather than developers in mind; although Genymotion is specifically a development tool, it contains more functions and is generally faster than the native emulators. Its only drawbacks are that is only free for personal use and only provides system images for phones and tablets and not wearables or large screen devices, such as TVs.

Real-world devices naturally respond far faster than any emulator and, when it comes to testing basic functionality, using our own devices will provide swifter results. This approach is great for testing the fundamentals of an app but provide little to no feedback on just how our apps will look on the wide variety of screen sizes, shapes, and densities that Android devices can have.

Using real devices is a fast way to test application logic but developing apps for specific models or even generic size and shapes will inevitably require the creation of virtual devices. Fortunately, Android Studio comes equipped with an accelerated build process: Instant Run.

主站蜘蛛池模板: 景泰县| 西宁市| 新泰市| 新竹市| 玉屏| 临桂县| 汕尾市| 武陟县| 东阿县| 汉寿县| 肇源县| 涿鹿县| 稻城县| 仲巴县| 中方县| 秦安县| 绥芬河市| 庆阳市| 呼和浩特市| 石景山区| 房山区| 凌源市| 万载县| 洞头县| 平武县| 德兴市| 盱眙县| 盘锦市| 渭源县| 龙南县| 成安县| 开封县| 彭阳县| 微山县| 柞水县| 阿合奇县| 临沧市| 莆田市| 栾川县| 双流县| 怀安县|