简体   繁体   English

在 AVD 与实际支持 Android 的设备上进行开发

[英]Developing on AVD vs Actual Android enabled device

I just started to learn how to program an Android applications.我刚开始学习如何编写 Android 应用程序。 Coming from a C# world, one thing that bothers me greatly about Android programming is the fact that it takes forever to actually test your app because you have to fire up AVD or wait until the app is installed on your actual device whereas for Winforms/WPF applications, you just hit that debug button and everything loads within split seconds.来自 C# 世界,Android 编程让我非常困扰的一件事是实际测试您的应用程序需要很长时间,因为您必须启动 AVD 或等到应用程序安装到您的实际设备上,而对于 Winforms/WPF应用程序,您只需点击该调试按钮,所有内容都会在几秒钟内加载。

My first question is, which is a more preferred way of developing to maximize efficiency?我的第一个问题是,哪种开发方式更能提高效率? Develop on AVD or an actual device?在 AVD 或实际设备上开发? Are there any suggestions on how I can improve my development speed?有什么建议可以提高我的开发速度吗?

A few things, most people leave the AVD open whilst they are developing so that they don't have to wait ten minuets every time they open it, however if you have a very slow computer and this is not an option then yes it will talk a while有几件事,大多数人在开发过程中让 AVD 保持打开状态,这样他们每次打开时不必等待十分钟,但是如果您的计算机速度很慢并且这不是一个选项,那么是的,它会说话一会儿

If you have a faster computer then AVD is likely to be less laggy, but for a completely lag free testing place, use your actual device.如果您的计算机速度更快,那么 AVD 的延迟可能会更低,但是对于完全无延迟的测试场所,请使用您的实际设备。

If you are making games you should look into libgdx because it allows you to test your apps on your desktop, then by changing one line, export them as .apk files and test on you android device如果您正在制作游戏,您应该查看 libgdx,因为它允许您在桌面上测试您的应用程序,然后通过更改一行,将它们导出为 .apk 文件并在您的 android 设备上进行测试

For a lot of apps and features within apps you will be left with no option but to test on your real device.对于应用程序中的许多应用程序和功能,您别无选择,只能在真实设备上进行测试。 Because it can take a while moving the .apk file to the actual device, I would recommend using an on device IDE to make small edits to your code whilst testing certain hardware features such as the volume buttons or the accelerometer.因为将 .apk 文件移动到实际设备可能需要一段时间,我建议使用设备上的 IDE 对代码进行小的编辑,同时测试某些硬件功能,例如音量按钮或加速度计。 As for on device IDEs I would recommend AIDE - https://play.google.com/store/apps/details?id=com.aide.ui&hl=en至于设备 IDE,我会推荐 AIDE - https://play.google.com/store/apps/details?id=com.aide.ui&hl=en

On the whole, I would recommend using eclipse with AVD, for the majority of your development on the majority of your apps, but for any apps that you need hardware functions for, I would recommend using an on device IDE (search the play store for android development for more options if you don't like my recommendation).总的来说,我建议将 Eclipse 与 AVD 结合使用,对于大多数应用程序的大部分开发,但对于任何需要硬件功能的应用程序,我建议使用设备上的 IDE(在 Play 商店中搜索如果您不喜欢我的建议,请查看 android 开发以获得更多选择)。 Most importantly don't list your app until you have tested it on multiple screen sizes on the AVD, and you have tested it on you physical device最重要的是,在您在 AVD 上的多种屏幕尺寸上测试过您的应用程序之前,不要列出您的应用程序,并且您已经在您的物理设备上对其进行了测试

保持AVD打开,您可以继续对其进行调试和测试,它会自动关闭并使用新代码重新打开,至少我是这样做的,我也是一样,来自C#没有Android经验。

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

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