Tablet or Phone - Android

后端 未结 30 2501
难免孤独
难免孤独 2020-11-22 08:33

Is there a way to check if the user is using a tablet or a phone? I\'ve got problems with my tilt function and my new tablet (Transformer)

30条回答
  •  迷失自我
    2020-11-22 09:25

    I'm recommend android library 'caffeine' That's contain get Phone or tablet, and 10inch~!

    very easy use.

    the library is here.

    https://github.com/ShakeJ/Android-Caffeine-library

    and use

    DisplayUtil.isTablet(this);
    DisplayUtil.isTenInch(this);
    

提交回复
热议问题