如何测试Android应用程序?
开发了一个大小为40MB的应用程序。我需要测试它的所有屏幕支持,但 Android 模拟器确实是一个糟糕的选择(我觉得......)。几乎每次都会出现内存不足的错误)。开发人员如何测试他们的应用程序?
还有一个问题 我为四种不同的布局(正常、小、大和超大)设计了应用程序。每个设备(将来)都会满足这些布局参数吗?
我遇到了一个真正的问题,我在索尼 xperia minpro(小屏幕 240*320 2.4 英寸)和三星 Galaxy 5(小屏幕 240*320,2.8 英寸)中测试了我的应用程序,但布局在三星设备中重叠。这可能是一个严重的问题,实际上我们无法在每个设备上检查我们的应用程序..这也是不可能的。
TIA
Developed a application of size 40MB. I need to test it for all screen support but the android emulator really a bad choice(I feel... ). It gives Insufficient memory error almost every time). How developer test their application?
One more Question
I have designed app for four different layout(normal,small,large and xlarge). Will every device(In future) satisfy these layout params?
And i faced a real problem that i tested my app in Sony xperia minpro(Small screen 240*320 2.4inch) and in Samsung galaxy 5(smallscreen 240*320, 2.8inch) but the layout is overlapping in samsung device. This can be a serious problem , actually we cant check our app in every device.. that is impossible too.
TIA
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
40MB 对于 Android 应用程序来说太大了。许多用户在其设备上安装该应用程序时会遇到问题。您应该考虑将一些资源移出应用程序,并根据需要或在首次运行应用程序时下载它们。
布局类型列表(正常、小、大、xlarge)绝对不是最终的,因为很可能会有更大的屏幕(xxlarge)或很小的屏幕(xsmall?)。
40MB is way too big for an Android application. Many users will have problems installing the app on their devices. You should consider moving some resources out of the application and downloading them either on demand or on first app run.
The list of layout types (normal, small, large, xlarge) is definitely not final, for there quite possibly will be even larger screens (xxlarge) or tiny ones (xsmall?).
您可以为模拟器配置任意容量的内存,包括模拟的 SD 卡,因此内存不会成为问题。但是,40MB 相当大,因此您可能会达到包大小限制。
你要求我们预测未来 - 如果谷歌还没有宣布,我们就不可能知道他们正在计划什么,尽管我建议永远不会承诺保持屏幕尺寸或分辨率静态 - 技术不断发展今天适用的规格,明天就不再适用。
You can configure the emulator with any amount of memory you wish, including an emulated SD card so memory shouldn't be a problem. However, 40MB is quite big so you may be hitting the package size limit.
You're asking us to predict the future - there's no way we can know what Google are planning if they haven't already announced it though I would suggest that there will never be a commitment to keep screen sizes or resolutions static - technology constantly evolves and specs that are OK for today, will not be OK for tomorrow.
我见过字典大小为 40Mb,最佳实践是将数据库作为单独的文件下载。一些图形密集型游戏接近这个大小。如果您想模拟许多 Android 设备,请确保您的 PC 符合要求并且拥有最新的 SDK。
I have seen dictionaries weighing in at 40Mb, best practise is to download the database as a separate file. Some graphically intensive games approach that size. If you want to emulate many Android devices make sure your PC is up to snuff and you have the latest SDK.
您没有太多选择:您必须使用尽可能多的(且不同的)物理设备,来自不同的供应商和技术规格(屏幕等),以尝试检测尽可能多的特定错误。
这很困难,因为您通常仅限于少数物理设备。
举个例子,我最近在使用
相机
时遇到了困难,因为仅 Motorola Defy 发生了一个错误。我目前正在与相机
作斗争,但这次仅限于三星Galaxy。当您发现特定错误时,请尝试“通用方式”修复它:不要检测设备的供应商/版本来为其编写特定代码,而是尝试以适用于所有测试手机的方式增强您的代码。到目前为止,我从来不需要编写特定于给定设备的任何内容。我遇到的错误总是与许可性或特定情况相关,可以通过使公共代码更完整或更有弹性来处理这些问题。让我们说“尽可能少地做出假设”,因为我们知道我们倾向于在没有意义的情况下做出假设。
除了在尽可能多的物理设备上进行测试之外,还要创建模拟器。您可以将它们参数化,使其具有不同的屏幕布局、不同的嵌入式硬件、内存等。除了 Android 发行版附带的默认模拟器之外,您还拥有设备供应商提供的模拟器,它们可以重现这些设备的特殊性。例如,三星发布了 Galaxy Tab 模拟器。索尼爱立信发布了 EDK 手机模拟器。您可以通过常规 Android 发行版更新工作流程获取它们。
是的,因为 Android 发行版是向后兼容的。将来仍将支持任何这些布局,但可能会被“弃用”(因此不推荐,但仍然有效),并且肯定会创建新的布局类型。
You do not have so many choices: you have to use as many (and different) physical devices as you can, from different vendors and technical specifications (screen, etc), to try to detect as many specific bugs as possible.
This is difficult, as you are often limiten to a few physical devices.
To give you examples, I recently struggled with the
Camera
, for a bug happening with Motorola Defy only. I am currently struggling with theCamera
, but only for Samsung Galaxy this time.When you find a specific bug, try to fix it "the general way": instead of detecting the vendor/version of the device to write specific code for it, try to enhance your code in a way it will work for all tested phones. So far, I never had to write anything specific to a given device. The bugs I encountered were always tied to a permissivities or particular cases that could be handled by making the common code more complete or resiliant. Let's say by "making as less assumptions as possible" knowing that we tend to make assumptions without meaning it.
On top of testing on as many physical devices as possible, create emulators. You can parameter them to have different screen layouts, different embedded hardware, memory, etc. And on top of the default emulator that comes with the Android distribution, you also have emulators provided by the devices vendors and that reproduce the specificity of these devices. For example, Samsung released a Galaxy Tab emulator. Sony Ericsson released a EDK Cellphone emulator. You can get them thru the regular android distribution update workflow.
Yes, as Android distributions are backward compatible. Any of these layout will still be supported in the future, but may become 'deprecated' (so not recommended, but still working), and new layout types will certainly be created.