Pages

Tuesday, August 28, 2012

Reading compatible-screen in compiled AndroidManifest file

The android manifest file is transformed  to binary representation during compilation. We can used  AXMLPrinter2 to recreate the XML version from binary one. But it won't be the same as original one, more sometimes it cannot be compiled again because it is not valid!

Such situation can appear when we have compatible-screen node in manifest. According to specification the its syntax is:
<compatible-screens>
    <screen android:screenSize=[ "small" | "normal" | "large" | "xlarge"]
    android:screenDensity=[ "ldpi" | "mdpi" | "hdpi" | "xhdpi"] />
    ...
</compatible-screens>
However in recreated file we doesn't find any of the above values but its numeric equivalent. Check the following table for precise values.
large

screenSize value [screen dpi]
small 200
normal 300
large 400
xlarge 500
screenDensity value [lowest of screen size in px]
ldpi 120
mdpi 160
hdpi 240
xhdpi 320

0 komentarze:

Post a Comment