Converting iOS PT to Android DP?

15,778

The DP is supposed to be equal to the PT in IOS. You should not need any translation at all. They are both a representation of the experienced resolution, and they hide the true resolution.

By the way, you may have made a small mistake by using @2x as base for your design guide. When one works from a design guide one should not have to think about pixels, Only PT/DP. Only icons and images should be produced in different resolutions. The UI should be defined in PT/DP with 1x (The "official" resolution) as the base. For iPhone 4/4S that resolution would be 320x480 even though the actual resolution is 640x960. For Android it's not that simple because of the unrestricted sizes available for any vendor to produce. I would recommend using something like 1080p (DP) resolution for the design guide, but use a relative design, and be mindful of the components that will need to resize to accommodate any screen size.

Share:
15,778

Related videos on Youtube

Sandip Fichadiya
Author by

Sandip Fichadiya

Enthusiast mobile app developer having ~5 years of experience. My experience includes strong hands on with Native Android, iOS as well as cross platforms like Flutter and NativeScript. Proud creator of Gaming Mode Recent open source contribution: firebase_auth_ui for Flutter.

Updated on June 04, 2022

Comments

  • Sandip Fichadiya
    Sandip Fichadiya about 2 years

    I have a style guide of iOS app which specifies height, width, padding, font size etc in PT (1x as base). I have converted them successfully in pixels for various iPhones like iPhone 5,6,6s Plus, 7, iPad.

    Now I need to use the same style guide for Android App, but I am clueless how should I convert iOS PT to android DP or pixel?

    Is there any common method or something which can specify like: 30pt of 1x iOS converts into X dp (or pixel) of mdpi android?

    I have searched but couldn't find hint for this. If someone could help me here, that would be great.

  • Sandip Fichadiya
    Sandip Fichadiya over 7 years
    Ok, but for PT, it is mentioned that Points are an abstract measured value based on a pixel density of 163 PPI. The pixel dimensions can be calculated as follows: px = PPI * PT / 163 So based on your answer, I assume 30PT = 30DP for Android. But 30 DP for mdpi or hdpi or xxhdpi? How can I determine that? because if I consider PT as DP, then the iOS and Android UI looks a lot different.
  • Bjørn Ruthberg
    Bjørn Ruthberg over 7 years
    material.io/devices this list should help a bit. IOS-devices are very cleverly designed in such a way that every screen can scale up, but this is not the case for Android. Screens can be very different in aspect ratios, and to be able to define equal designs for both IOS and Android, one must define the designs using PT and DP, but be mindful of which parts of the design will be stretched when applicable.
  • Sandip Fichadiya
    Sandip Fichadiya over 7 years
    Sorry there was my mistake. I have the design based on 1x only. I have updated my question to reflect the same. I got your point for 1080p for android, but the problem for me is I only have design guide which has PT of 1x :( I can't ask for another guide. Is there any chance I can convert it to dp or px as close as possible, if not perfect.