Tool for quickly testing Android layouts - android

Android layouts are very tricky to get right. Especially for an inexperienced layouter like me. At the moment I use the following workflow:
Design the layout in IntelliJ, using IntelliJ's GUI preview window
Test the layout on my device
Test the layout on different emulator images
This approach has several problems:
The IntelliJ is very inaccurate (often the layout looks very different on the device)
Testing on my device is good, but here I have only one fixed resolution and PPI
The emulator takes AGES to start up. If using multiple emulators things get worse
That's why I'm looking for an alternate solution: a tool, that quickly renders Android layouts (no app logic required). This tool should support different resolution and PPI settings and should be as close to the actual looks on real devices as possible.
Is there such a tool?
What other alternatives are there?

Related

My android app looks different on the phone than android studio

My android app looks different on the phone than android studio
look at screenshot
app in the phone screenshot
App in the Android studio screenshot
why is that? and how can I fix that?
Your preview shows what your layout would look like on a Pixel 3, which is quite a large phone. From what I saw on your screenshot looks like your device isn't quite as large so I'd recommend you to use ConstraintLayout for 2 reasons:
Consistency across different screen sizes - it's much more likely your layout will look the same on a large screen and a small one
Better performance, especially for your case since you'll be able to do everything with a single layout, without having to nest several layouts
For more information on ConstraintLayout, please check out this post I wrote on Medium

How Can I test my android app for multiple devices?

I'm developing an Android app... when I run it on my Motorola it runs ok, but when I launch it in my Samsung device, that has less screen size, the app doesn't show some buttons. It seems that the resolution is different in either both devices.
How can I configure my app so I don't have problems running in mostly devices?
As stated #abed in his answer, ConstraintLayout should be good for solving most of this issues, but you can never know that it will be fine on all devices.
Testing on multiple devices is one way to be sure, so if you expect that there will be problems, or that something should be different. You can easy see behavior on multiple devices inside android studio like this:
So just change phones with different resolution and observe behavior. If you want different behavior create new layout for that resolution.
when you build your layout Use <androidx.constraintlayout.widget.ConstraintLayout
check this https://developer.android.com/training/constraint-layout

different appearance on different phones for Android

We are getting ready to release an app, there is a slight difference in appearance on my development phones a Moto X and Galaxy Nexus, and my clients phones. He has a HTC One S with Android 4.4.4. Are there any websites or tools that I can test the appearance on for different phones? He lives in Brazil and me in Florida, so using his is out.
You should use the Android Virtual Device for this. You can use whatever version of android you would like, there are tons of predefined device sizes/resolutions or if none of those suit your needs you could always define your own.
Are you using Eclipse/ADT as your IDE? If so, the layout editor provides different views for a handful of different devices.
I am having trouble attaching a screen shot, so I will just explain. In the layout editor, you will see drop-down selectors for (a) Device/Screen Type, (b) Orientation, (c) Application Theme, (d) Android API level. This provide reasonable previews of you layouts.

How to test android application?

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
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?).
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?
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.
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?
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.
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.
How developer test their application?
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 the Camera, 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.
Will every device(In future) satisfy these layout params (normal,small,large and xlarge)?
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.

Best way to test Android layout before submitting to market

reading about all these different resolutions and hardwares for Android I am a little unsure if the layout I created for an Samsung Galaxy will actually work the same way on all (most) Android devices.
I did not use anything fancy or complicated. However I had to use fixed width in several places to align text and buttons nicely. ALso there is some text with linebreaks that could look differntly if on narrower screens
How can I be sure that my layout will work on other devices? Or is this actually a no issue? Testing in the debugger is sooooo slow, that I actually never got it to work properly.
Thanks very much!
You can set up multiple emulators with different screen sizes, that simulate the possible targets.
In the emulator Ctrl-F11/12 (thanks #ccheneson) allows you to change the orientation, so that you can test that as well.
The emulator may be slow, but to see how the layouts look like it should be fast enough - you may still test the logic on a real device.
Also emulator speed seems to be highly dependent on the screen size.

Categories

Resources