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
I would suggest using Worklight Skins in order to support multiple Android devices (with varying screen sizes) in your application.
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
Related
I'm part of the Android development team at a small company in the city where I live.
We're working on building different apps and currently there's this app we have the design as a .sketch file but the layouts are only drawn for iOS devices and we need to adapt based on those guidelines. The thing is there are 2 different layouts for the iPhone SE and for the iPhone X. They are mainly the same but a few things differ like font sizes, margins, paddings, etc.
I want to implement the design on Android to also be dynamic depending on the user's resolution (or DPI, better said) so I'm trying to use the dimens-xyz.xml files to set my sizes in there and use those values as references in my layouts so I only write one layout xml for each screen, no matter the DPI.
So far, so good. My question is: What are the Android equivalent screen DPIs for the iPhone SE and iPhone X? What dimens-xyz files do I need to use in order to keep the UI consistent for smaller and larger screen devices and have the UI be "responsive".
It's hard to find a relevant answer on Google because it's kind of a technical question and when Google sees iphone and screen in the same search query it starts throwing results of comparing screens for iOS vs Android phones.
PS: I have 0 prior knowledge on iOS development and internals
For iPhone SE, having a 4.7 inch display and 1334 by 750 resolution, you can go with 4.7 WXGA which is a 720 by 1280 equivalent in Android (the closest i could find).
As for Iphone X it has a resolution of 2436×1125, with a 5.8 inch display giving a PPI of 462.63. Closest in Android would be Pixel 3A, with 2220x1080 and 440 dpi.
I have problem in Android app.
My layouts don't working correctly on 480*800 screens
On HD, Full HD and qHD it working correctly
For example my axml code:
http://pastebin.com/a07PB0MV
How can I make it working correctly
Both the Xamarin Android designer and Android Studio(which many use for UI design) have a dropdown for different device layouts. This should help with at least visually looking at the app on lower resolution phones.
You could also use a screen density specific layout, where a specific layout is created for the smaller phone screen sizes(like 480x800).
https://developer.android.com/guide/practices/screens_support.html
See the section on "Using new size qualifiers"
I have two sizes of 5.1 inches, a 4-inch for 480x800.
When I design in 5.1 screen and run with 4 inch screen, I have some trouble that some button missed position on screen.
I designed by layout.
Android runs on a variety of devices that offer different screen sizes
and densities. For applications, the Android system provides a
consistent development environment across devices and handles most of
the work to adjust each application's user interface to the screen on
which it is displayed.
Please read below Links
Supporting Multiple Screens
How to support multiple screen in Android
How to support different screen size in android
Supporting multiple screen size - Android
Place your view inside a <ScrollView>. Doing so will mean users with smaller devices will be able to scroll the view if it is too large.
I'm developing a small game for Android with Phonegap. I'm using media queries to support 3 different screen sizes (width from 480 to 1920 px).
For Android version lower than 4.4 all works fine. But when I test it on a full HD resolution, Android displays all scaled like on a 480px screen. All seems to be very big. So having a full HD resolution does no make any sense.
Well, setting the target SDK version to 18 fixes the problem, but I would like to known what is happening there.
The documentation says, Android is scaling all to fit on the page. But why does it scale so much? Why not for higher resolution? There is no code that could explain this. I made the media queries especially to handle different resolutions.
I'm working with a board wich has android 2.3 as base SO. This board has connected an 7" screen and I¡m using this set to develop an app.
While developing this app on eclipse, I'm using RelativeLayouts. This app will only be for an especific screen size, so for the moment I don have the need to use diferent resolutions to fit other screen sizes.
The problem that I'm getting is that I have developed all this program using on eclipse a 7" screen base, but when runing the app on the board, the layout doesn't fit the screen. It makes the same effect as if you create a layout fitting a 7" screen with RelativeLayouts, and then you change this resolution to 5.4". The layout gets oversized and doesn't fit well the screen.
So, what would be the problem? As i said, the screen is 7" and I'm developing for 7". I don't know why happens this.
Its simple, the pixel density of your board is different from the pixel density of your emulator (on eclipse).
I am assuming you did not set a "fixed" size on your images and layouts, only selecting match_parent for width and height, right?
What is happening is that android is scaling (or not) its resources based on your screen pixel density, and that gives you the difference between the emulator and the board.
Screen size does not means equal screen pixel density, and that can cause you a lot of trouble if you do not manage this correctly providing different resources and qualifiers.