testing android app on different devices - android

I am developing one android application & planning to use it on android phones and tablets. Currently I am testing it with help of avd (Galaxy nexus). To use it on different devices with different sizes and densities, I want to test it on different avds.
My problem is instead of setting number of devices, can anybody suggest me few common avds whose configurations will cover most of standard devices (small, normal, large, xlarge).
In my eclipse, I am getting some nexus avds(10, s, one, 4, 7 etc) and some other devices( like 10.1"wxga, 5.4"fwvga etc etc). I am using adt bundle provided by google.
Thank you.

Why dont you use Samsung Remote testing lab.It provide to test your apps on different screen resolutions and also with the devices that do support temperature sensor etc.Please follow this link.I dont have any temperature sensor mobile but i need to test in one of my project.So i use Samsung galaxy Tab 3 for this purpose and also for some other things.I have also shown you the output.If you still need any help comment here.I think this might helps you :)

First of all you have to figure out which sort of devices you are going to target.
This link may be helpful to figuring out what type of filter you want to use in order to decide the targeted devices.
For most of the UI part you can rely on the AVDs provided by the Google Bundle choose the desired test AVDs (ldpi, mdpi, hdpi, xhdpi, xxhdpi).
But you should be ready for the surprises because some devices behave differently than the others. I mean the same build may be working fine for most of the devices but for a particular device the UI behavior may be different.
All the best.

Related

What if all resources are placed in one resolution for android app bundle

As we all know that Google launch new feature of distributing android apk using android-app-bundle that has so many advantages.
So my question is, how my app will behave if I place all the images/resources in single folder like drawable-xxxhdpi. e.g. Lets say I have one application that uses 5 images. Instead of taking different sizes for different resolutions, I place all the images in single folder (drawable-xxxhdpi) assuming lets android handle it based on device resolution.
As we know that android-app-bundle generates different different apks based on resolutions, languages and so on.
So in that case what will happen to my app ? How APKs will be generated for different resolutions (Android itself re-scales images and generates bundle ?) What will happen to app, will it crash or working properly for smaller resolution devices ?
I know this is non- coding question but its technical question. I tried to search for this but not able to find exact answer of it.
I may help to others as well.
Your app will work the same as before: Play serves to a given device the files that the Android platform would have loaded if it had served the APK with all the files.
In other words, if an mdpi device would have loaded the resource res/drawable-xxxhdpi/icon.png, then that's what Play will serve to that device.
--
Also, slightly unrelated to your question, but note that there are some downsides to providing resources only in xxxhdpi (regardless of whether you publish an APK or an Android AppBundle):
The Android platform will have to rescale these images at runtime on lower resolution devices, thus taking some CPU time and making your app slightly slower.
Your app is bigger than it could be on lower resolution devices. If you provided also the same resource in mdpi, it would obviously be smaller, and that's what Play would serve to an mdpi device, thus making your app smaller for those devices.
Resource not found exception will be triggered in devices with lower resolutions
Good and very helpful question, I think your application will work fine on xxxhdpi devices but those devices which are mdpi or hdpi will face layout issues. I don't think so there would be any other issue than this.

Testing for density independence

After finishing the programming part of my app I want to test it with the Android Emulator.
I tried to make my app density independent an now I want to test it with different emulator devices. Which resolutions and screen sizes should I test? Do you have a list of virtual devices, which you use to test your application before releasing?
Which api-Levels should I test? (My application uses bluetooth).
Thanks for your help.
Basically the correct answer here is to 'test every possibility'.
But this of course would be a huge job.
I usually take the Nexus devices as base lines, which will guide you through most of the possible and populair sizes.
Android versions you should check every one of them, starting with the version you want to support as lowest. Every version can react differently to not only your layout and styles, but also handle your java code differently .
You can find the Nexus devices and their sizes at http://developer.android.com/distribute/promote/device-art.html
Be sure to press 'Older devices'
In addition to this, you could try to get your hands on some populair devices from other manufacturers like Samsung and HTC, since they also have a hand in changing the way your layout and styles will behave.
There is no magic bulletproof answer.
You can use this Platform Versions to glean some information about what are the most common API lvls, and device densities being used.
But ultimately the answer to your question depends largely upon your target audience and the devices that they carry. The best case scenario is to test on as many different configurations as possible =) starting of course with the most widely used.
If you are designing an application, which is density specific, then you should test on all the possible densities. To test your application on various density device, you should have base device for each density for e.g Samsung Nexus - xhdpi, HTC One(hdpi) and similarly one base device for mdpi, ldpi. If you are also supporting Tablets have base device Tablets supporting different densities.
Additionally, you can avoid scaling with respect to device density by setting the following parameter in the manifest file supports-screens android:anyDensity=false

Preparing apps for the nexus 10

I am working on an android Audio Recording application, our app is currently designed to work on all android phones, the Nexus 7 and the Motorola Xoom tablets.
I was wondering if there are any guidelines or best practices to re-design/modify our app for Nexus 10. More specifically, any pointers on the below points would be really helpful:
UI guidelines to support the new 2560x1600 resolution
Android resource files related modifications (based on similar guidelines)
Any sample or open sources apps that have been modified to work on the nexus 10
Best practices creating and running a nexus 10 emulator since there is no such AVD device by default (screenshot below). Any thoughts on creating one, keeping the high resolution in mind.
As long as you have xhdpi assets, and layouts made for 10" tablets, you shouldn't have to do anything (except add a new xxhdpi launcher icon, as #Mattias mentioned).
To make a Nexus 10 AVD, navigate to Device Definitions:
Then, click New Device. Fill it out something like this:
Now it will be listed in the devices drop-down that you show above.
Regarding your second point, resources:
While the nexus 10 is a xhdpi device, it will use the launcher icon from xxhdpi "one bucket up" if available, so make sure to provide one as it will look much better/clearer/sharper. Reason is that there is room for a bigger icon on this device. Launcher icon size at xxhdpi is 144x144 pixels.
For reference see:
https://plus.google.com/118292708268361843293/posts/ePQya3KsTjW
The best way to emulate the Nexus 10 is to use AndroVM. I am currently running Android on it with the full Nexus 10 2560x1600 resolution and it fits onto my HD screen if I set AndroVM to use 320dpi.
Oh.. and it's VERY fast :-)
I personally use it over emulators and real hardware devices as it's extremely responsive and the deployment of the APK is lightning fast.
I do not contribute to the AndroVM project myself by the way, but it has speeded up my own development cycle considerably. In all development cycles, a developer waiting to see if their code tweaks work using an emulator or a hardware device adds considerable time overhead. I would thoroughly recommend using AndroVM regardless of screen size during normal code development.

what kind of mobile will be updated to Android 4.0.3 or 4.1 version?

I made an application under Android emulator provided worked perfectly on all types of dispositives (small, normal, large, xlarge) (-ldpi,-mdpi, -hdpi,-xhdpi). But the last few days I saw that in some phones with the latest versions of android (these phones consist with a lower bar like tablets) did not look properly.
So my question is: what kind of phones have or can upgrade to these versions of android? (small-HDPI, normal-HDPI, normal-xhdpi???)
Thank you!
Theoretically, nothing stops a manufacturer from making an ldpi device capable of running ICS or JB. However, in practice, most devices with ldpi and even mdpi to some extent do not have good enough processors in both CPU and GPU departments to be able to run the newer version of Android.
Till date, the lowest I've seen an ICS device go screenwise is a normal-mdpi display. However, I do not know the details of every device in existence, and there could be lower devices as well.
You should design your app keeping in mind all device configs, at most excluding only ldpi and small displays.

7in tablets in Android - screen size qualifiers

I encountered a weird behaviour when starting to test my app on some 7in Android models and I would like to find out if others are finding the same problem and what people recommend as a fix.
Here are the details:
The application has full tablet support, which is triggered with qualifiers for the layouts. xlarge devices get the tablet mode with multiple fragments being displayed on the screen.
For newer Android versions there are also some values that set variable that change the UI on the flow using the sw600dp qualifier as well as the xlarge one.
The problem:
I am now testing on the Kindle Fire and the RIM BlackBerry Playbook and also want to support the upcoming Google Nexus Tablet (or whatever it will be called) and other 7in form factor devices.
Both the playbook as well as the fire have a 7in screen and a 1024x600 screen resolution.
However the playbook seems to trick Android into thinking it is a xlarge device, while the fire does not do that.
Both the tablet as well as the standard UI work fine, but imho the tablet mode is nicer and is fine to be used on the 7in device. However if I push the layout into the large qualifier to also get that tablet mode on the fire I will also get it e.g. on the Note or other quite a bit smaller devices.
With Android 4x I can use the sw600dp and other qualifiers but what about older versions? I assume a 7in device is supposed to behave like a tablet but what about e.g. the Note..
What are best practices for this scenario? Are my observations with the playbook reporting xlarge correct?
However the playbook seems to trick Android into thinking it is a xlarge device, while the fire does not do that.
Device manufacturers are the ones who choose which buckets a device goes in with respect to size and density. This goes double for manufacturers like RIM and Amazon, who do not want the Play Store and therefore do not have to abide by any particular compatibility requirements the Play Store dictates, so they are welcome to thumb their noses at Google's guidance.
What are best practices for this scenario?
I can't tell you "best".
However, if there are specific devices for which you wish to override some layouts to use a specific size, here's what I would try (assuming the layout you would be using for normal cases is known as R.layout.main):
Step #1: Create res/layout/main_funky.xml as a symlink or hardlink to res/layout-xlarge/main.xml (and likewise for -land, etc.).
Step #2: In your Java code, wherever you refer to R.layout.main (e.g., onCreateView() of a Fragment), decide whether to load R.layout.main or R.layout.main_funky depending upon android.os.Build data to detect these oddball devices by model. Since R.layout.main_funky is one of your normal main layouts, all of your code that depends upon widgets should be unaffected by this choice.
Step #3: In your particular case, add MMPD (magic Maven pixie dust) to steps #1 and #2... :-)
Are my observations with the playbook reporting xlarge correct?
I bought a Playbook, determined that RIM's distribution model is... unpleasant, and did the bare minimum to have a book chapter on it. I haven't tried to see if it is -large, -xlarge, or something else.
That being said, the NOOK Tablet IIRC suffers from this (claiming to be -xlarge rather than -large).
I would expect a Google Nexus tablet, if such a thing comes to fruition, to correctly honor size buckets, plus be running a new enough Android version that -sw600dp and kin will work.

Categories

Resources