1

解像度とピクセル密度に基づいて対角線の画面サイズを計算する関数を作成しました。つまり-

def find_display_size(d):

  width=float(720);
  height=float(1280);
  dens=float(294);
  wi=float(width)/(dens);
  hi=float(height)/(dens);
  x = math.pow(wi,2);
  y = math.pow(hi,2);
  screenInches = math.sqrt(x+y);
  diagScreenSizeRoundedoff = round(screenInches)
  logger.info("screenInches "+str(screenInches),also_console=True)
  logger.info("diagScreenSizeRoundedoff"+str(diagScreenSizeRoundedoff),also_console=True)

adbシェルを使用して情報(解像度とピクセル密度)を取得したい。このコマンドを試しているとき-

$adb shell wm density

Result-
Physical density: 320

私が得ている結果は、デバイスの物理密度(= 320)ですが、特定のデバイスのピクセル密度は(~294)です。これら2つの違いが正確に何であるか、またadbコマンドを使用してピクセル密度を見つける方法、この場合は〜294を知りたいです。

PS-私が取り組んでいるデバイスは-MOTO XT1068です

4

1 に答える 1