A
A
Artem2013-07-22 12:01:54
Android
Artem, 2013-07-22 12:01:54

Image size for background in android app?

There is an Android app. It has a regular Activity with an ActionBar. There is a need to put a picture in the background in this Activity. The source of the image is in vector, so I can export it in any resolution.
The problem is that now there are already devices whose screen resolution exceeds FullHD. So how to solve this problem competently? Is it possible to put a vector image on the background of an Activity? If not, just throw a picture in different resolutions in the drawable? Then what permissions?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ivnika, 2013-07-22
@Ivnika

In such cases, I tried to split the image into a background and a picture itself, then we fill the entire screen with the background and fit the picture in the center. In this case, everything is quite correct on any screens (again, your vector is convenient). Depending on the picture, other options are possible - background and picture aligned to the bottom of the screen and width.

V
Vladimir Yakushev, 2013-07-22
@VYakushev

One of the possible options is the option proposed by Ivnika. Another option is to prepare two square images filled with background and side width to the maximum width for hdpi and xhdpi. In this case, the image itself must fit within the minimum width for hdpi and xhdpi. But this option loses a lot when one image is used for the background, and another for the picture. Anyway, on some devices you cannot avoid stretching the background, and on devices with the maximum resolution for xhdpi and hdpi, the main picture on the background will be smaller than required. When using separate images for the background, you can choose a well-compressed JPEG (or PNG that can be tiled), and for the picture you can make good PNG quality for each of the resolutions.

P
palmut, 2013-07-22
@palmut

Another option is to use the svg-android library .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question