Lorenzo
Lorenzo

Reputation: 673

Cordova android different device, the correct way of responsive layout

i've tested my application with Samsung s4 and Samsung s4 mini...if i set the font for some pages to font-size: 50px; i see large enough in the s4 but too small in the s4 mini (shouldn't be the opposite?) i've tryied to dimension all my div and elements with the percentage (is this the correct way?) thank you, i'm new to this kind of things and still a bit confused.

Upvotes: 0

Views: 953

Answers (1)

user3255670
user3255670

Reputation:

@lorenzo,
I suggest you stop and learn about CSS and Android.

Here is one article to read:

From one of the article I quote:

According to a survey conducted by OpenSignal,there were nearly 19,000 distinct Android devices seen in 2014 with close to 12,000 devices seen the year prior. The initial problem caused by this large number of distinct devices is a severe difficulty in creating an OS to serve even the majority of them.

The problem is only partly due to differing devices though, as new OS versions often have to pass through vendors before they show up on new devices. Because Android is an open platform, vendors have the option to, and often do, add their own widgets and thematic "skins" to an OS version to run on their devices.

This may not make sense until you read what is in the last link. (I will quote from that article below)

Next you want to learn about the different font sizing methods. Learn about em and ex. Here is one article on that:

The read this:

I QUOTE:

I do know what web developers are interested in, however. They need CSS pixels. That is, the “pixels” that are used in CSS declarations such as width: 300px or font-size: 14px.

These pixels have nothing to do with the actual pixel density of the device, or even with the rumoured upcoming intermediate layer. They’re essentially an abstract construct created specifically for us web developers.

It’s easiest to explain when we consider zooming. If the user zooms in, an element with width: 300px takes up more and more of the screen, and thus becomes wider and wider when measured in device (physical) pixels. In CSS pixels, however, the width remains 300px, and the zooming effect is created by expanding CSS pixels as much as is needed.

Best of luck

Upvotes: 1

Related Questions