You are on page 1of 4

Link tham kho : 1. http://developer.android.com/guide/practices/screens_support.html 2. http://developer.android.com/guide/topics/resources/providingresources.html#AlternativeResources . http://developer.android.com/a!out/dash!oards/inde".html #. http://developer.android.com/guide/practices/screens-distri!ution.html $. http://developer.android.com/guide/practices/screen-compat-mode.html %. http://ste&an222devel.!logspot.com/2'12/1'/android-screen-densities-si(es.html )*i dra+a!le, ta s- design c.

c icon, image v/ !ackground sao cho ph0 h1p v*i k2ch th3*c :
Low density Small screens QVGA 240x320 -----------------------------------------------drawble-small-ldpi drawble-small-land-ldpi Low density Normal screens WVGA400 240x400 x432! -----------------------------------------------drawble-ldpi drawble-land-ldpi "edi#m density Normal screens $VGA 320x4%0 -----------------------------------------------drawble-mdpi drawble-land-mdpi "edi#m density Lar&e screens $VGA 320x4%0 -----------------------------------------------drawble-lar&e-mdpi drawble-lar&e-land-mdpi $i&' density Normal screens WVGA%00 4%0x%00 x%(4! -----------------------------------------------drawble-'dpi drawble-land-'dpi )oom medi#m density lar&e b#t *2%0x%00 res! -----------------------------------------------drawable-x'dpi drawable-x'dpi-land +,i -.i res/layo#t c0a pro1ect android t'2 3 res/layo#t/my4layo#t5xml // layo#t 6or normal screen si7e 8de6a#lt8! res/layo#t-small/my4layo#t5xml // layo#t 6or small screen si7e res/layo#t-lar&e/my4layo#t5xml // layo#t 6or lar&e screen si7e res/layo#t-xlar&e/my4layo#t5xml // layo#t 6or extra lar&e screen si7e res/layo#t-xlar&e-land/my4layo#t5xml // layo#t 6or extra lar&e in landscape orientation 1. Low density Small screens QVGA 240x320 (120dpi) layo#t-small-ldpi 240x320! layo#t-small-land-ldpi 320x240! 2. Low density !ormal screens "VGA400 240x400 (x432) (120dpi) layo#t-ldpi 240 x 400 ! layo#t-land-ldpi 400 x 240 !

3. #edi$m density !ormal screens %VGA 320x4&0 (1'0dpi) layo#t-mdpi 320 x 4%0 ! layo#t-land-mdpi 4%0 x 320 ! 4. #edi$m density Lar(e screens %VGA 320x4&0 (1'0dpi) layo#t-lar&e-mdpi 320 x 4%0 ! layo#t-lar&e-land-mdpi 4%0 x 320! ). Galaxy *a+ ( 240 dpi ) layo#t-lar&e 900 x *024! layo#t-lar&e-land *024 x 900! '. %i(, density !ormal screens "VGA&00 4&0x&00 (x&)4) (240 dpi) layo#t-'dpi 4%0 x %00! layo#t-land-'dpi %00 x 4%0! -. .oom (medi$m density lar(e +$t 12&0x&00 res) (1'0 dpi) layo#t-xlar&e %00 x *2%0! layo#t-xlar&e-land *2%0 x %00! Also add /ollowin( code in 5mani6est /ile :s#pports-screens android3smallScreens;8tr#e8 android3normalScreens;8tr#e8 android3lar&eScreens;8tr#e8 android3xlar&eScreens;8tr#e8 android3any<ensity;8tr#e8 /=

Low density Small screens QVGA 240x320 res/layo#t-small-ldpi res/layo#t-small-land-ldpi Low density Normal screens WVGA400 240x400 x432! res/layo#t-ldpi res/layo#t-land-ldpi "edi#m density Normal screens $VGA 320x4%0 res/layo#t-mdpi res/layo#t-land-mdpi "edi#m density Lar&e screens $VGA 320x4%0 res/layo#t-lar&e-mdpi res/layo#t-lar&e-land-mdpi $i&' density Normal screens WVGA%00 4%0x%00 x%(4! res/layo#t-'dpi res/layo#t-land-'dpi )oom medi#m density lar&e b#t *2%0x%00 res! res/layo#t-xlar&e res/layo#t-xlar&e-land

>ron& Android"ani6est5xml

*5

<eclarin& an App is ?nly 6or $andsets


<compatible-screens> <!-- all small size screens --> <screen android:screenSize="small" android:screenDensity="ldpi" /> <screen android:screenSize="small" android:screenDensity="mdpi" /> <screen android:screenSize="small" android:screenDensity="hdpi" /> <screen android:screenSize="small" android:screenDensity="xhdpi" /> <!-- 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" /> </compatible-screens> ... <application ... > ... <application>

<manifest ... >

</manifest>

25

<eclarin& an App is ?nly 6or >ablets


<s pports-screens android:smallScreens="false" android:normalScreens="false" android:lar!eScreens="tr e" android:xlar!eScreens="tr e" android:re" iresSmallest#idthDp="$%%" /> ... <application ... > ... </application>

<manifest ... >

</manifest>

)em x@t sA dBn& 3 android3any<ensity;8tr#e8 tron& s pports-screens 35 C#blis'in& "#ltiple ACDs 6or <i66erent Screens Alt'o#&' we recommend t'at yo# p#blis' one ACD 6or yo#r applicationE Goo&le Clay allows yo# to p#blis' m#ltiple ACDs 6or t'e same application w'en eac' ACD s#pports a di66erent set o6 screen con6i&#rations as declared in t'e mani6est 6ile!5 For exampleE i6 yo# want to p#blis' bot' a 'andset -ersion and a tablet -ersion o6 yo#r applicationE b#t yo#Gre #nable to maHe t'e same ACD worH 6or bot' screen si7esE yo# can act#ally p#blis' two ACDs 6or t'e same application listin&5 <ependin& on eac' de-iceGs screen con6i&#rationE Goo&le Clay will deli-er it t'e ACD t'at yo#G-e declared to s#pport t'at de-iceGs screen5 IewareE 'owe-erE t'at p#blis'in& m#ltiple ACDs 6or t'e same application is considered an ad-anced 6eat#re andmost applications should publish only one APK that can support a wide range of device configurations 5 S#pportin& m#ltiple screen si7esE especiallyE is wit'in reason #sin& a sin&le ACDE as lon& as yo# 6ollow t'e &#ide

to S#pportin& "#ltiple Screens5

"ore 3 0n addition to t,e traditional s$pports1screens parameters re/er to t,e new Si2e Q$ali/iers la$nc,ed in 3.2 Using new size qualifiers *,e di//erent reso$rce con/i($rations t,at yo$ can speci/y +ased on t,e space a3aila+le /or yo$r layo$t are s$mmari2ed in ta+le 2. *,ese new 4$ali/iers o//er yo$ more control o3er t,e speci/ic screen si2es yo$r application s$pports5 compared to t,e traditional screen si2e (ro$ps (small5 normal5 lar(e5 and xlar(e). *a+le 2 *o ,elp yo$ tar(et some o/ yo$r desi(ns /or di//erent types o/ de3ices5 ,ere are some n$m+ers /or typical screen widt,s 320dp3 a typical p'one screen 240x320 ldpiE 320x4%0 mdpiE 4%0x%00 'dpiE etc!5 4%0dp3 a tweener tablet liHe t'e StreaH 4%0x%00 mdpi!5 900dp3 a JK tablet 900x*024 mdpi!5 J20dp3 a *0K tablet J20x*2%0 mdpiE %00x*2%0 mdpiE etc!5 6sin( t,e si2e 4$ali/iers /rom ta+le 25 yo$r application can switc, +etween yo$r di//erent layo$t reso$rces /or ,andsets and ta+lets $sin( any n$m+er yo$ want /or widt, and7or ,ei(,t. 8or example5 i/ '00dp is t,e smallest a3aila+le widt, s$pported +y yo$r ta+let layo$t5 yo$ can pro3ide t,ese two sets o/ layo$ts res/layo#t/main4acti-ity5xml L For 'andsets res/layo#t-sw900dp/main4acti-ity5xml L For tablets :mani6est 555 = :s#pports-screens android3reM#iresSmallestWidt'<p;89008 /= 555 :/mani6est=