Reputation: 11053
There are these Android screen size categories small, normal, ....
I thought by defining the app screens for those separately one would have covered nearly 100% of the most common screens, however, today I was proven wrong:
There is the HTC Legend with 320 x 480 (width x height) and the Samsung Galaxy with 480 x 800, both chose to be displayed with the normal definition (since I don't have large)
What is the best way of handling this? Do I really need to define all screens on large format too?
Actually the width is not the problem - the same definitions work for small, normal, large - but the height really makes trouble.
Doou you just make the screen scollable for the height to work?
Thanks for any ideas!
Upvotes: 1
Views: 259
Reputation: 3520
If you want to you can further specify screen size by the minimum dimension. Here is the directory to put the layouts for screens with the smallest width of 600dp:
layout-sw600dp
Although, I think this may only work for >=3.2 :(. However, there may be a clever way to take advantage of selector precedence. Read up.
I know this is a little late to recommend, but in general, try to using linear layout, weights, and 9-patch to make sure that your layout can be used for all resolutions. Ideally, you should only need a different layout for xlarge vs the rest.
Upvotes: 2
Reputation: 7385
One thing to do is to use 9-patch images wherever possible, Another approach would be to setup a server side mechanism that will tell the client what assets folder to use. So, on first launch after download, the client sends the server the handsets User Agent string. The server determines the best assets size and sends that info back to client, which caches it. From here on the client know which folder to use.
This breaks when the app is uninstalled and installed again later. But this too can be addressed, as in this scenario the client app will behave as initial launch after download use case.
Upvotes: 1