I am writing an application for Android. And I test it only on one device (tablet). You can, of course, use emulators, but they are very slow. And you still have to use them :) Most of all I care about what could be the problems when running the application on a regular phone with an android (with a small screen). For example, fragments. As far as I understand, on the phone in some cases only a specific frost will be displayed. What to consider and how to avoid problems?

  • use dp instead of pixels, but about other problems, you will tell us ... - Gorets

1 answer 1

It is necessary to read the new guides on just the difference in the interface between the tablet and the phone. Here is a good example: Android Training , Dev guide

In short, this is the point:

  1. To set the size of components use either match_parent or wrap_content. If you cannot use these constants, then you need to use values ​​that are independent of the screen size, that is, dp, dip and sp are preferable for fonts.
  2. Provide for the behavior of the UI when changing the orientation of the screen (from portrait to landscape or back)
  3. About the fragments. From the last link there is a picture. For a smartphone, one fragment contains activites, which are transferred to another activations and a new screen; for a tablet, one fragment updates another. Well described in the dock by reference.

In general, it is better to test the application on 4 devices, at least, preferably from different manufacturers, although the smallest resolution (240x320) can be excluded, as endangered, and we get - 320x480, 800x480, 1024x600, ideally, the screen density should be different to cover everything (mdpi, hdpi, ldpi, xhdpi)

And a binding document: This

I guess you have a hard time with English. All answers to typical questions are in the documentation with which you need to work of course.

Merry Christmas!