简体   繁体   中英

Android Different Resolution Support in IBM Worklight

I am searching on different resolution support in IBM Worklight android . From this side i am reading tutorials IBM Worklight Tutorials In tutorial/module 09 they discuss about different resolutions. In the document there is line which telling:

By default, Android application assumes that the application HTML file was styled for a screen width of 320 pixels. When displaying graphical elements on wider screens, Android automatically scales images and fonts to the appropriate ratio. For example, on a 480-pixel wide screen, a 100-pixel wide image will be scaled by 480/320 (= 1.5) to 150 pixels in width

Now i make a Worklight Hybrid project and set a background image in it and two buttons on this image. Its a demo app in which i am testing different resolutions.

Now i deploy this app in android and run it on Tab 7 inch ,nexus 4 and tab 10.1 .Now my image size is 580x320 and bit depth is 24.

When i run this project on nexus 4 it gives the width of image correct but it do not scales the image height vise.

When i run this project on tab 7 2 , it shows the image having some extra white space on the left of image and extra white space on height of image means down the image.

When i run on tab 10.1 it shows the same behavior as the tab 7 2 did.

I am really confuse that which exact general size will be use so that all these scale on all screen sizes and not shows extra white space on width and on height

我建议您使用Worklight Skins ,以便在您的应用程序中支持多个Android设备(屏幕尺寸各不相同)。

Idan's answer works for me. I have a android tablet for some reason the app looks very blurry and huge buttons and fonts all the time. I have tried all the different target-densitydpi setting, the button might have change sizes. But everything is still very blurry.

Then I set this in the Android manifest as per Idan.

<uses-sdk android:minSdkVersion="8"  android:targetSdkVersion="13"/>

Now everything is sharp and crisp on my low resolution tablet. It turns out that Android would automatically do some scaling "screen compatibility mode" even though my device can support better resolution. Android will still treat this as low resolution and scale things automatically. By providing the target, it will stop this behaviour when the device is higher than that Android version. Read more here.

http://developer.android.com/guide/topics/manifest/uses-sdk-element.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM