1

I am trying to develop an app compatible with the galaxy S4. I understand I need to add the screen density 480 in the manifest, but is it classed as normal or large screen as people are saying different things?

For example, if I ran the following code on a galaxy S4, what would size result in?

int size = getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK;

size = 2 = Normal, 
size = 3 = Large
Dandroid
  • 221
  • 2
  • 13

1 Answers1

2

In your development, you should do nothing specific for a galaxy SIV, everything will scale.

If you want to play with different resources, you can use the qualifiers in your folders:

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)

This page will learn you a lot of usefull tricks: http://developer.android.com/guide/practices/screens_support.html

Waza_Be
  • 39,407
  • 49
  • 186
  • 260
  • Thanks for the useful info, however I am still intrigued what the outcome of the code would be – Dandroid Aug 14 '13 at 15:06
  • 1
    @Dandroid It will come out to be normal. See my answer from the comment above. – TronicZomB Aug 14 '13 at 15:32
  • @TronicZomB indeed I checked out the link you provided and it showed some confusion with regards to Normal or Large size. Have you ran the code or are you just guessing? – Dandroid Aug 14 '13 at 15:40
  • If the S4 falls under the normal size bucket then that code will return just that. – TronicZomB Aug 14 '13 at 15:42
  • I asked the question to ensure there was no "if" – Dandroid Aug 14 '13 at 15:46
  • 1
    There is no 'if'. Just develop like usual and your app will be compatible. Take care of 600dp for small tablets and 720 for 10 inches and there is NOTHING to worry about for the SIV. There are more than 6000 Android devices out there, there is no code for specific devices – Waza_Be Aug 14 '13 at 15:53