Reputation: 10402
I implemented the application which will supports the small screen ldpi and hdpi. It is working for only one either ldpi or hdpi. Because my application layout have some distance between the views. so i want differentiate the ldpi and mdpi. how to implement this can any body help me.
For this i am creating the layout-small folder in the res. is any name conventions like layout-small-ldpi (or) layout-small-mdpi or exiting or not. same like normal and large (layout-normal-ldpi or layout-normal-mdpi or layout-normal-hdpi). Please give the naming convention clearly.
thanks
Upvotes: 0
Views: 3298
Reputation: 10363
In your res folder you have 2 folders: drawable and layout.
You can add folders with a postfix with "-hdpi" for hdpi specifics, "-mdpi" for mdpi and "-ldpi" for ldpi.
So you should have these folders: drawable-hdpi drawable-mdpi drawable-ldpi layout-hdpi layout-mdpi layout-ldpi
You can also use specifics for landscape orientation or even SDK versions. Read http://developer.android.com/guide/topics/resources/providing-resources.html for more info
Upvotes: 2
Reputation: 2218
To seemlessly support landscape / portrait mode, screen with different densities, you need to put appropriate "drawables" with following naming convention @ res directory. res directory will be @ root level of you application folder. For example LunarLander\res. res has different directories for storing images (drawables), layaout (for UI) and values (for font support).
You need to use the same name for all modes, this name shall be used in the application regardless of the mode.
Nomenclature is something like . (This may not be the exhaustive list) where type would be drawable / layout / values etc. language would en / fr for english and french respectively. (this list is also not complete) mode would be land / port for landscape and portrait respectively density would be hdpi / mdpi / ldpi for high / medium and low density screen respectively.
Example Suppose I have a background image, which needs to look differently for landscape and portrait mode. Then I will place two different images for background into res\drawable-land and res\drawable-port\ folder under the name background_image.png. I will refer to these in my application (or layout) using background_image as the name. The android system will appropriate choose the image based on the mode.
Same is applicable to ldpi / hdpi or en / fr.
Basically you need to create appropriate folder structure and keep the same name for entities. (string, drawable, layout etc)
Shash
Upvotes: 0