Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Android Assets

Benny
December 18, 2018

Android Assets

Is it a high resolution tablet?

Benny

December 18, 2018
Tweet

Other Decks in Programming

Transcript

  1. Android Assets
    Kontextsensitiv
    2015

    View Slide

  2. Themen
    Ressourcen
    Punktdichten
    Größen

    View Slide

  3. Ressourcen*
    ∼ Screen size (4)
    + screen pixel density (8)
    + layout orientation (2)
    + language and region (4000)
    + mobile country code (400)
    + multiple qualifier drawable-de-rAT-land (1)
    + variants [product flavour + build type] (∞) + ...
    * http://developer.android.com/guide/topics/resources/providing-resources.html

    View Slide

  4. Punktdichte (I)
    1 Zoll = 2,54 cm
    3 dpi* = 3 ppi**
    * dots per inch 2 ** pixel per inch

    View Slide

  5. Punktdichte (II)
    Android Donut Gingerbread Honeycomb* Jelly Bean Jelly Bean*
    Generalized density low medium** high extra high tv
    extra extra
    high
    extra extra extra high
    Minimum dots per inch 120 160 240 320 213 480 640
    Scaling ratio 3 4 6 8 5,2 12 16
    Factor of default
    0,7
    5
    1 1,5 2 1,33 3 4
    Resource qualifier ldpi mdpi hdpi xhdpi tvdpi xxhdpi xxxhdpi
    * maintenance release 2 ** default

    View Slide

  6. Punktdichte (II)
    Android Donut Gingerbread Honeycomb* Jelly Bean Jelly Bean*
    Generalized density low medium** high extra high tv
    extra extra
    high
    extra extra extra high
    Minimum dots per inch 120 160 240 320 213 480 640
    Scaling ratio 3 4 6 8 5,2 12 16
    Factor of default
    0,7
    5
    1 1,5 2 1,33 3 4
    Resource qualifier ldpi mdpi hdpi xhdpi tvdpi xxhdpi xxxhdpi
    * maintenance release 2 ** default

    View Slide

  7. Beispiel - Umrechnung
    Gegeben
    Eine drawalbe-ldpi/icon.png Grafik mit der Breite 6 Pixel.
    factor of default low fl = 0,75
    factor of default xhigh fx = 2
    width low wl = 6
    Gesucht
    Die Breite in Pixel der drawable-xhdpi/icon.png Grafik.
    width xhigh wx
    Lösung
    w = w
    wx / fx = wl / fl
    wx = (wl * fx) / fl
    wx = (6*2)/0,75 = 16
    Die Breite der xhigh Grafik ist 16 Pixel.

    View Slide

  8. Größen
    Generalized Size small normal large xlarge
    Minimum
    width and height
    in dp* units
    320
    x
    426
    320
    x
    470
    480
    x
    640
    720
    x
    960
    * density independent pixels 1 dp = 1 dip = 1px in generalized density default

    View Slide

  9. * http://www.motorola.com/us/shop-all-mobile-phones-1/Moto-G/moto-g-pdp.html#moto-g-pdp-specifications
    Device Display Generalized Densitiy
    Moto G*
    720
    x
    1280
    360
    x
    640
    329
    normal xhigh
    Beispiel - Smartphone

    View Slide

  10. Verteilung
    * https://developer.android.com/about/dashboards/index.html

    View Slide

  11. Skalierbare Vektorgrafik

    xmlns="http://www.w3.org/2000/svg"
    version="1.1" baseProfile="full"
    width="100" height="100"
    viewBox="0 0 100 100">
    x="10" y="10" width="80" height="80"
    fill="#A4C739"/>

    View Slide

  12. View Slide