The Android Screen Fragmentation Myth
rustyshelf.org
rustyshelf.org
I attended a Facebook/Parse hackathon where FB detailed issues about a certain bug in specific CPU's with respect to a C++ based photo processing library. Certain Android phones would randomly crash. There is also the infamous compass video [1] where multiple devices all with different hardware report different readings. As a developer, the Android Emulator makes me think I'm going to have a consistent user experience, but based on hardware, I may not.
In my personal experience, I built this game (http://joeblau.com/orb./) which runs on iOS and Android and I noticed a crazy bug where it would only crash on S4's from Sprint, not from Verizon or AT&T. I re-worked some code to get the application working eventually, but the fact that something would only break on a specific carrier's version of the hardware was crazy to me. The problem is not Android; Android as an OS is actually very good. The problem is HTC, Samsung, Motorola and all of the other hardware manufacturers that build the handsets. Thankfully Google is doing what it can to address the hardware issue by announcing their Android One program, but that hurts other hardware competitors.
It used to be you could run Linux on MIPS, SPARC, Alpha, PowerPC, Intel, etc, and not be able to tell the difference from an end user perspective. Then everyone got dollar signs in their eyes, and Google managed to fudge the whole "open" thing so that people were okay with binary drivers (I also blame Ubuntu for acceptance of this), and now you see the mess it's resulted in.
Don't get me wrong, I'll take the Android bazaar with its wide variety of choice every day (and twice on Sunday) over the one-size-fits-all-we'll-tell-you-what-you-need style of iOS, but the insanity with differentiating things via closed methods needs to stop. And the Android/Linux developers are aware of the problem and dealing with it the best they can; the problem is all the handset manufacturers and carriers fucking things up.
I'm not saying Canonical is entirely innocent, but they do employ a lot of fervent free software advocates and developers. What we need to fix the situation is more pressure on hardware vendors to release specifications and free software. Perhaps if Ubuntu Touch takes off, Canonical will be in a better position to provide that pressure.
Very much this. Even with the vast power that kernel developers wield, even with offers to write (for free!) and integrate drivers into mainline[1], the biggest pull is still consumers. Push your hardware vendors to (at a minimum) release specs; it's the right thing to do.
[1] - For seven freaking years this offer has stood: http://article.gmane.org/gmane.linux.kernel/487536 And yet we still have retarded fucking hardware companies who won't release specs. Fuck 'em - don't buy from them.
A thousand times this! It seems that carriers exist for the solely purpose of fucking things up.
I was looking into this a few days ago (for a much more off-the-wall reason I won't go into) and it turns out that Samsung actually will ship devices under the same brand (such as "Galaxy S5") that use entirely unrelated SoCs depending on the radios the device is intending to support: some devices use Qualcomm's Snapdragon, and some use Samsung's own Exynos, so there are tons of possibilities open for these kinds of "Sprint-specific" issues :(.
http://www.cnet.com/news/the-chips-of-samsungs-galaxy-s5-exy...
The real fragmentation is in hardware support (don't get me started on OpenGL-ES drivers) and manufacturers that modify the OS in crazy ways. It's quite frustrating to receive crash reports with stack traces showing a crash originating in some manufacturers custom code, with no way of knowing what went wrong.
A lot of games and certain apps also list "compatible devices" in their Play Store description area. Some developers even warn users not to pay for and download the app if their phone is not supported.
Android fragmentation is unfortunately very real.
To be fair, iOS has it's own issues with HTML5 development.
A bunch of devs building slick HTML5 apps would go against this.
Which prompts the question whether it was really that bad after all, or just a gut reaction to something that was different.
But this is no longer true, or at least true to a much lesser extent. With current hardware you can achieve 60fps reliably even with a layout engine running constraint evaluations for every frame. It makes sense to make it easier to target variable screen geometries now, which was not the case 7 years ago.
Pixel perfect layouts had NOTHING to do with that performance gap, and iOS devices have far and away the best GPUs of each generation. iOS devices consistenly push fewer pixels (lower resolution screens) with faster GPUs than Android does.
The only reason people think Android devices are such power houses is because everyone still just looks at the CPU core count and clock speed. Which has almost no impact on scrolling and animation performance.
EDIT: For example compare the Galaxy Nexus to the iPhone 4S. Both shipped Nov 2011, both use PowerVR GPUs. The GN is rendering 920k pixels, the 4S is only 615k pixels! The GN is making due with the SGX540 at 307MHz, whereas the 4S has the SGX543MP2 at 266mhz or so - literally double the GPU power of the GN, and for a lower resolution screen.
ios8 makes it plainly obvious that "something" is coming that will throw out the "the size of the screen shall be 5 and 5 shall be the size of counting, not 3 nor 4 but 5" paradigm. That or multitasking similar to windows 8 maybe.
But this shouldn't be all that crazy hard, we had how many years to deal with 800x600/1024x768/etc...
The other big improvement was the Fragments API that came with Android 3.0 Honeycomb (February 2011), but that came with a compatibility library that worked all the way back to Donut. And it was more about decomposing your UI into components that could be arranged differently for phones and tablets, not about adjusting a single UI within a device class.
They split phone sizes (2-10") into four generalized sizes (small, normal, large, xlarge). Then they split screen density into generalized densities (ldpi, mdpi, hdpi, xhdpi) based on 3:4:6:8 ratios. The example on the page lists 5 different layout XML files (the 4 previously mentioned + extra large landscape orientation) for different sizes, and three folders for image assets in different densities.
But, there are tablet layouts for Android 3.2+, which use a completely different system based on size qualifiers where you can provide minimum/maximum pixel sizes for layouts.
The logic for iOS seems super simple in comparison.
With a few Android projects under your belt, you have probably internalized how everything works, and which parts are fringe cases you can ignore. But if you're new to this (or a journalist/analyst with limited technical depth), it seems like an absolute mess. Simply rewriting this documentation and providing better tutorials and resources could go very far to clarify the situation.
Also, even if you are supporting 2.x, you don't HAVE to have a separate layout file for each generalized size. If you make a flexible layout that works on all sizes, you can just declare it once (and doing so is not difficult in most cases).
I totally agree the documentation needs work. Some areas have not been updated in a very long time.
On a 1080p or even 2160p TV, the text should absolutely go all the way across, using a large font readable from across a room. On a high-resolution tablet, the font should still likely go all the way across the screen in portrait mode, and most of the way across in landscape mode, even though either one likely has more than 1024 pixels. On a phone, the font likely should go all the way across the screen in either portrait or landscape mode.
Hacker News
Also, my ultimate point is that reading text at a normal size that goes longer than 1024 pixels before wrapping isn't exactly pleasant.
Personally, I use ratpoison, typically with one window full-screen.
What's your setup like?
This is no different than how newspapers are done. Just because you have a giant piece of paper doesn't mean you should let the text flow completely across it.
Well duh. If you ignore all the things that give you trouble/fragmentation you automagically get a trouble-free/fragmentation-free environment. Silly
Without an api adequate for handling different screen sizes and resolutions, it was hard to develop an application for one device then port it to other devices. I use the term "port" because usually this was actual porting; in some cases it would have been better to have a separate binary for each target device than to have a single binary for all devices.
I think the reason Windows Mobile developers were so rare compared to developers for emerging platforms like iOS and Android despite Windows Mobile having been around longer is that the alternatives learned from WM's poor example to create better apis. When I switched from Windows Mobile to playing around with Android 2.1, there was so much more I could do with layouts and the simulator in the IDE to target more devices. Newer versions of iOS, Android 4, Windows Phone, and others have all been improved in this regards even more, to the point that I now think of screen fragmentation as something of a non-issue when I tinker with mobile apps.
Can anyone recommend some good tutorials or guides for producing elegant layouts that respond well to different screen sizes? I understand the basic mechanics and laid out in the dev guides, but I'm a bit lots when it comes to putting it all together elegantly.
> The above diagram and analysis also only take into account phones, not tablets, _where designing for physical screen size becomes more important than resolution._
Android is re-compiling/re-optimizing for ART, so why not re-export the SVG in PNG format, at the right screen size, at first run?
Each version(4.0, 4.1, 4.2, 4.3) has a slightly different version of the default browser and WebViewUI component(and don't get me started on Samsung devices which have their own issues regarding the default browser) with it's own quirks and rendering issues.
They kinda fixed that in KitKat 4.4, using Chromium 30 as the basis of the WebViewUI component, but KitKat deployments in the wild are in the single digits.
(Which is just part of the whole problem -- there's also the hardware features and OS version issues which are even more important).
What exactly is the issue with this? Just like with any other sane widget toolkit designed since the 80's for varying screen or window sizes, Android's layouts and widgets work perfectly fluid to occupy more or less space. One layout works just as well on a 4-inch phone as it does on a 5.5-inch phone, and it will naturally fit more content on the bigger screen.
The only problem is with tablet screens where blowing up a user interface designed for a small phone screen technically works but is pretty terrible to use. This is no different from another unnamed mobile platform where you also need to design a separate tablet layout.
It becomes an issue if you're not a sloppy kind of designer/programmer, who just lets the widget flow to occupy more available space. It's not like design only use things like a text entry boxes or a web-views (widgets that just letting them get more space is usually fine and natural).
Second, it becomes an issue for every app where you want to have a custom interface -- so the built-in Android widget and layout are of no use to you. This holds for most games, customly designed apps, etc.
It becomes an issue if you're not a sloppy kind of
designer/programmer, who just lets the widget flow to
occupy more available space.
So it's sloppy to build your UI in the exact way it was intended to be built? Not hard-coding every widget sizes is somehow... sloppy? Because the impression I get is that if you can make your app handle different screen sizes appropriately without having to meticulously hand code for every resolution, you're coming out way ahead of the game. That way you present a nice, consistent UX across all devices, and don't have to scramble every time a new resolution or device size comes out.It's also possible to do this with custom interfaces - a little extra attention to your layout engine will net huge benefits in terms of time saved in designing layouts for each of the possible resolutions.
Hardware variations, vendor customizations, capabilities variance - these are real issues. Building a UI that flows well across most resolutions and sizes? Not so much.
[edit for grammar]
What? In most cases, that is exactly the right thing to do. Your content should be the center of the app in the first place.
> It's not like design only use things like a text entry boxes or a web-views (widgets that just letting them get more space is usually fine and natural).
Why don't you name some actual, concrete examples instead of making vague statements like this? Where do you think that this is an issue?
> Second, it becomes an issue for every app where you want to have a custom interface -- so the built-in Android widget and layout are of no use to you. This holds for most games, customly designed apps, etc.
What does a "customly designed app" even mean? There are countless examples of Android applications designed beyond the norm (http://androidniceties.tumblr.com/) and they don't seem to have any problem doing so - and guess what: they're using the Android frameworks just like everybody else.
And just like application developers, game developers have been working with a myriad of different screen resolutions for ages now. The only people having a problem with this are those exclusively developing for a certain fruit device that has shot itself in the foot by not designing for varying resolutions in the first place.
It's not rocket surgery.
Also: Use RelativeLayout. Get your designer to design directly in the layout editor, and test them on screens he finds important and representative. That way he won't specify designs that can't be implemented.
The background image looks like this (not my game):
http://blog.gemserk.com/wp-content/uploads/2013/01/mainmenu-...
the area inside red rectangle is guaranteed to be shown on all devices, and area outside that is the filler.
Now, to make sure your "action area":
- uses device native resolution for crisp image and
- is not too small
...you have to have all the assets in different sizes. I found that having 4 different sizes does this nicely:
1. targeting 800x450 action area
2. targeting 1280x720
3. targeting 1920x1080
4. targeting 2560x1440
Now, you could pick different boundaries, but a lot of devices use 800, 1280 or 1920 as their base width.The only drawback to this is that some tablets with 1024px width would have a lot of filler area because they would use 800x450 assets. So, having:
5. targeting 1024x576
would make it complete. But I'm not sure there are many 1024px devices out there, so I skipped that one.The tools on Android are very similar to the ones on the web - they are designed to scale and stretch because they need to.
Just try creating a mobile website that supports common "modern" devices. Have fun trying to wrap your brain around all the idiosyncrasies across various versions and browser implementations (Android Stock vs Chrome etc) that will endlessly dirty your code if you want the site to look at all correct in a majority of Android devices.
The Android emulator is pretty nice... once you figure out how to set it up for whatever device you're trying to test. It's a ridiculous resource hog though by default (there are ways to mitigate this if you're on an Intel chip). Say what you will about simulation vs. emulation but the iOS Simulator is a dream to work with (again, for web development) and I've never had it mislead me even though it isn't truly emulated. But then you realize there is no way to install the Chrome browser unless you are hooked up to the Android Marketplace (even if you're on the latest version of OS). The best you can get is Chromium, which is a pain to install and doesn't work on some AVDs.
All that ranting aside, I've never had a problem with screen sizes, even when working on responsive stuff. But, yeah, Android is basically the Internet Explorer of the mobile space. You'll keep hearing "oh the next version will fix that!" and it may... but you'll be stuck supporting the versions that are broken for years to come.
[1] http://jimbergman.net/webkit-version-in-android-version/
My point exactly.