简体   繁体   中英

Difference between running a program in Android emulator and physical device?

I'm starting the studies about android development with Android Studio and I was wondering if it's possible to build applications only running code on a physical device or do I need to emulate others devices in order to avoid errors, etc.?

The Android Studio emulator barely runs in my machine, so I need to know if it is essential for the apps development or if there are other alternatives.

If you need to run on different versions of Android, just what @CrazySports101 mentioned, but also test different screen sizes & resolutions to check UI responsiveness, it would be better to use emulators.

Obviously, you can start development using either a single emulator or physical device, but during your final testing stages, it would make sense to use emulators to test all your device specific usecases.

And yes, there are few limitations with using an emulator, like it cannot emulate network connectivity, other real-time data, such as GPS, sensors, battery issues, etc. Or usecases such as calling, receiving SMS is not possible as well.

If you have a physical device, you can just use that. No need to run the emulator at all. An emulator is mostly used because it is convenient and easy to test different versions of android. For example, some libraries/UI component may behave differently on different phones.

It is better to use a physical device if your app is using radios like Bluetooth etc.

If you just started to learn android studio and your device can barely run emulator, I would recommend you to go for physical device. Emulator makes you possible to try your product on different version of android and screen ratios, but you can not emulate network connectivity, real-time data, GPS, sensors, battery issues, calling, receiving SMS is not possible. But if you are trying to launch a product in a market you should go for emulator as you would need to try your product on different versions as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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