Default <supports-screen> tag Android - android

I'm developing an Android App, and I'm creating some folders for supporting multiple devices.
But my question is, what is the default <supports-screen> tag in AndroidManifest?
If I don't write the tag, what devices will support? All? Just the folders that I created, for an example.." layout-ldpi,layout-mdpi", and my app will support just this densities?

You will support all devices with minimum SDK which you set in your Manifest.
From Android Developer site:
To optimize your application's UI for the different screen sizes and densities, you can provide alternative resources for any of the generalized sizes and densities. Typically, you should provide alternative layouts for some of the different screen sizes and alternative bitmap images for different screen densities. At runtime, the system uses the appropriate resources for your application, based on the generalized size or density of the current device screen.
You do not need to provide alternative resources for every combination of screen size and density. The system provides robust compatibility features that can handle most of the work of rendering your application on any device screen, provided that you've implemented your UI using techniques that allow it to gracefully resize (as described in the Best Practices, below).
Check the full guide on Supporting Multiple Screens
http://developer.android.com/guide/practices/screens_support.html

By default, your application would run on all devices across densities. If you create resources with specific resolution, while the application is run on the those devices, respective images would be rendered on the screen.
For example - Your application has ldpi folder only.
Scenario 1 - your application running on ldpi device. The images in ldpi folder would be rendered on screen.
Scenario 2 - Your application running on hdpi device. Since your application does not contain hdpi resources, the available ldpi resources would be rendered on screen (but it would be stretched/shrinken which would not look good)
Hope this answers your question.

Related

(Android) If I put an image file only in drawable-xxhdpi folder, is it working in all devices which have various densities

I only have an image made for xxhdpi density. If I put this file only in drawable-xxhdpi folder, would it be working in all devices of various densities? like ldpi, mdpi, xhdpi, xxxhdpi and so on I want to know if Android does this scaling job itself
thank you
Read Supporting Multiple Screens
Android runs on a variety of devices that offer different screen sizes
and densities. For applications, the Android system provides a
consistent development environment across devices and handles most of
the work to adjust each application's user interface to the screen on
which it is displayed. At the same time, the system provides APIs that
allow you to control your application's UI for specific screen sizes
and densities, in order to optimize your UI design for different
screen configurations. For example, you might want a UI for tablets
that's different from the UI for handsets.
So, For good practice you should create different drawables for different screen densities .

Do I really need small icons when I've provided an icon for xxxhdpi in android?

I'm very confused about various icon sizes required in android. Do I really need to have smaller icons for xxhdpi,xhdpi,hdpi,mdi if I've provided an icon for xxxhdpi and I want to show same icon for every resolution?
Since we are playing in dp why can't android just downsize them?
PS: I tried having only xxxhdpi icons and they looked perfectly fine on smaller screens for my use case.
You should read this link.
Just to summarize:
Using a size qualifier does not imply that the resources are only for screens of that size. If you do not provide alternative resources with qualifiers that better match the current device configuration, the system may use whichever resources are the best match.
Caution: If all your resources use a size qualifier that is larger than the current screen, the system will not use them and your application will crash at runtime (for example, if all layout resources are tagged with the xlarge qualifier, but the device is a normal-size screen).

Too large APK due to multiple densities and screens sizes?

Google suggests to create for each image 4 different versions - one for each density (ldpi, mdpi, hdpi, xhdpi). Sometimes you might even want to create others, based on the screen size (small, normal, large, xlarge).
This causes a weird situation where most of the app's images will never be used by the app, right?
How come Google doesn't create multiple APKs on their website, to target the best APK to the end user's device, so that 100% of the resources will be targeted on the device's specs? Or there is already such a thing?
Yes there is a support for multiple APK. Please refer here.
To address your need precisly you can certain filters in your manifest file i.e. <supports-screens> or <compatible-screens>

Publishing multiple versions of one app on Google Market

I have an Android app that I would like to display high quality images with. However there are many different screen sizes and ratios. I know there are filters to show apps in Market only for devices with small/medium/large screens.
If I put images of both sizes in 1 app it will double the size of the app, right?
Is it a good practice to make multiple versions for different screen sizes?
I would like to make 1 app in 3 versions for such devices:
medium screen mdpi
medium screen hdpi + large screen mdpi
large (tablets)
If it's possible to do it how can I specify them in manifests? Or is it somewhere in market?
Android has a built-in mechanism for having resources designed for different screen sizes and pixel densities. It's called resource directory qualifiers, and you can read all about it here.
For example, for small screen sizes, you could create a specific layout file and place it in the res/layout-small directory. For a larger screen, you could create a layout file with the same name and place it in the res/layout-large (or res/layout-xlarge) directory.
For pixel density, you could create a small version of your image resources and place them in the res/drawable-ldpi directory (lower pixel densities). And for higher pixel densities, you could create alternate versions and place them in the res/drawable-hdpi directory.
I'd encourage you to read the page on Supporting Multiple Screens, and let Android help you out with its built-in mechanisms. Creating three separate copies of your app is harder for you to maintain, and it confuses potential users (most of whom probably neither know nor care about "pixel densities"). What's to stop them from downloading the wrong version of your app, and getting a lousy experience because of it?
No one seems to be addressing the file size issue you're really asking about, so I'll try.
You should package your high quality images as a set of separate downloads, one for each type of device you plan to support. This makes your base app small, and ensures the end user's disk space is only filled by images it needs.
I've not done this myself, but hopefully the idea will send you on the right search path. I imagine you design the separate download as either resources on your own server, or another set of apps in the market (i.e. "MyApp Image Pack HDPI", "... MDPI", etc.).
As Donut mentions above android has excellent documentation for this here, here, here and here.
Note that all Manifest file changes and how to create one binary that will support different screen sizes, different densities AND different SDK's are at android website. But it requires careful planning and testing to do so.
The best way is to have ALL device configurations (listed here, including the Samsung Galaxy Tab simulater (large screen, hdpi) available here) in your development environment and test your app on them.
You have to create different .apk for each version and define this in your application's manifest file.use this link
http://developer.android.com/guide/practices/screens-distribution.html

How big is an android phone's screen?

How big is the smallest motorola android's screen, in pixels? I want to know what size I need to make my graphic without it being too distorted by the fill_parent.
Although this doesn't directly answer your question..
Android is the name of the operating system running on Android phones. Different phone models could have different resolutions and pixel densities. Therefore you have to be careful not to hardcode resolution values into your code. It might run well on one phone but poorly on another.
Check out these pages for details about supporting different screens:
http://developer.android.com/guide/practices/screens_support.html
http://developer.android.com/resources/dashboard/screens.html
It would be unwise to program for one screen size, especially if you plan on distributing your application later. You should design your application for as many screen sizes as possible.
Instead use nine-patch images and flexible layouts.
If you are designing an icon, the look at the android icon design guidelines and consider high, medium and low density screens. There are different resource folders for these too and android takes care of selecting the appropriate one for the current device.
motorola droid's display size is 480x854 px, according to specs, so it's rather non-standard

Categories

Resources