Layout for tablets in Android

I know this is an old question, but for the sake of it… According documentation, you should create mutiple asset folders like this res/layout/main_activity.xml # For handsets (smaller than 600dp available width) res/layout-sw600dp/main_activity.xml # For 7” tablets (600dp wide and bigger) res/layout-sw720dp/main_activity.xml # For 10” tablets (720dp wide and bigger)

Why my App is not showing up on tablets in Google Play?

At last adding a special case for Nexus 7 with in <compatible-screens> tag worked for me. As Nexus 7 has tvdpi density <compatible-screens> <!–no small size screens –> <!–all normal size screens –> <screen android:screenSize=”normal” android:screenDensity=”ldpi” /> <screen android:screenSize=”normal” android:screenDensity=”mdpi” /> <screen android:screenSize=”normal” android:screenDensity=”hdpi” /> <screen android:screenSize=”normal” android:screenDensity=”xhdpi” /> <!– all large size screens –> … Read more

Android: allow portrait and landscape for tablets, but force portrait on phone?

Here’s a good way using resources and size qualifiers. Put this bool resource in res/values as bools.xml or whatever (file names don’t matter here): <?xml version=”1.0″ encoding=”utf-8″?> <resources> <bool name=”portrait_only”>true</bool> </resources> Put this one in res/values-sw600dp and res/values-xlarge: <?xml version=”1.0″ encoding=”utf-8″?> <resources> <bool name=”portrait_only”>false</bool> </resources> See this supplemental answer for help adding these directories and … Read more

Tablet or Phone – Android

As it has been mentioned before, you do not want to check whether the device is a tablet or a phone but you want to know about the features of the device, Most of the time, the difference between a tablet and a phone is the screen size which is why you want to use … Read more

Media Queries: How to target desktop, tablet, and mobile?

IMO these are the best breakpoints: @media (min-width:320px) { /* smartphones, portrait iPhone, portrait 480×320 phones (Android) */ } @media (min-width:480px) { /* smartphones, Android phones, landscape iPhone */ } @media (min-width:600px) { /* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800×480 phones (Android) */ } @media (min-width:801px) { /* tablet, landscape iPad, lo-res laptops … Read more