Comment On The Enterprise User Agent

"When the job ad specified that an 'enterprise' Senior Java Developer was needed, I knew I'd be in a treat for some enterprisey goodness," writes Chris B, "but what I didn't expect was the User Agent Detection Generation Framework. Here's what the API for this framework looks like." [expand full text]
« PrevPage 1 | Page 2Next »

Re: The Enterprise User Agent

2012-04-25 01:13 • by pnellesen (unregistered)
Strolskon:
Someone clearly needs to create a SaaS user-agent detection infrastructure to harness the power of the cloud and synergize the relationship between browsers and content-authoring and delivery systems.

My eyes! The goggles, they do NOTHING!

Re: The Enterprise User Agent

2012-04-25 01:26 • by Anomymoose (unregistered)
379824 in reply to 379803
CSS/html has you covered.
http://www.w3.org/TR/css3-mediaqueries/
Server different sheets, or sections of a style sheet based on media type / screen size. No need to sniff for the user-agent.

Re: The Enterprise User Agent

2012-04-25 02:32 • by will (unregistered)
Yet another win for those who have replaced thier user agent string with "Commodore 64"

Re: The Enterprise User Agent

2012-04-25 03:27 • by tablet user (unregistered)
379826 in reply to 379803
big picture thinker:

You wouldn't want to send a full desktop-based website (800+ pixel wide screen) with high resolution images to an Android or iPhone, would you?


Please don't ever implement web sites.

I often use my Android tablet to browse the web. Because of geniuses like you I get content designed pixel perfectly for mobile phones on my device that is _1280 pixels wide_. Normal websites would be perfectly usable without any scrolling but I'm served some dumbed down crap that looks awful on that screen.

Thanks, web developers.

Re: The Enterprise User Agent

2012-04-25 04:04 • by TheRider
It seems to be a very difficult concept to grasp for graphic designers and web developers that the_web_is_not_a_sheet_of_paper. Being a programmer who frequently has to build the web sites that such a graphic genius has designed, I keep having to tell her that she shouldn't bother to design a site for letter-sized paper, nor for 1280x1024 pixels, nor for any fixed amount of pixels, for that matter. Then she looks at me with a blank stare. But the monitor on her desk has 1280x1024 pixels. And the world revolves around her.

Re: The Enterprise User Agent

2012-04-25 04:05 • by Soske (unregistered)
379828 in reply to 379825
I didn't replace it, in came that way and in PETSCII furthermore.

Re: The Enterprise User Agent

2012-04-25 04:17 • by L. (unregistered)
379829 in reply to 379804
J:
YF:
I needed to do browser discovery for logging purposes only, but I'm not skilled enough to create this masterpiece...

...so I just coded this in Java: http://www.quirksmode.org/js/detect.html

Time consumed: ~1h

Fail?

Yes. That code can't detect the Android browser. It calls it 'Mozilla'.

Re: The Enterprise User Agent

2012-04-25 04:18 • by L. (unregistered)
379830 in reply to 379813
ubersoldat:
You're using Safari 5 on an unknown OS!


lovely

Safari is TRWTF . and its shipped with the worst OS of all times, where one does not simply maximize a window.

Re: The Enterprise User Agent

2012-04-25 04:24 • by L. (unregistered)
379831 in reply to 379821
smilr:
big picture thinker:

You wouldn't want to send a full desktop-based website (800+ pixel wide screen) with high resolution images to an Android or iPhone, would you?


Please stop making websites.

I specifically jailbroke my iOS devices so that I can put in the UAFaker addon to mobilesafari specifically so I can claim to be a desktop browser in order to prevent what you advocate.

I have zooming / panning capabilities in my mobile browser that permit me to efficiently view the normal or desktop versions of websites. I prefer them to the "mobile" stripped down versions of websites.

When in ladscape mode my screen resolution is above 800px wide anyhow and my eyesight is good enough that I can usually read text rendered that small on my phone's screen, and zoom in when necessary anyhow.

Stop dumbing down the internet. Damnum


stop dumbing down the internet, said the iOS user... Did you know you could majorly improve your browsing experience by removing safari and installing a real browser ?

Re: The Enterprise User Agent

2012-04-25 04:29 • by L. (unregistered)
379832 in reply to 379827
TheRider:
It seems to be a very difficult concept to grasp for graphic designers and web developers that the_web_is_not_a_sheet_of_paper. Being a programmer who frequently has to build the web sites that such a graphic genius has designed, I keep having to tell her that she shouldn't bother to design a site for letter-sized paper, nor for 1280x1024 pixels, nor for any fixed amount of pixels, for that matter. Then she looks at me with a blank stare. But the monitor on her desk has 1280x1024 pixels. And the world revolves around her.


Now now, don't go asking all those fail webdevs to do a fully adaptable website design, they don't have any button for that in their dreamweavers / wordpress / joomla noobtoys.

Besides, monitor res matters not when a luser installs every available toolbar...

Re: The Enterprise User Agent

2012-04-25 05:45 • by fixed (unregistered)
379833 in reply to 379801
Jay:
PiisAWheeL:
Strolskon:
Someone clearly needs to create a SaaS user-agent detection infrastructure to harness the power of the cloud and synergize the relationship between browsers and content-authoring and delivery systems.
With a comment like that my guess is that you work in a marketing department somewhere.


You need to add something about "utilizing paradigms".


And go into more depth on how the broad specifics will be actioned going forward.

Re: The Enterprise User Agent

2012-04-25 06:39 • by Lord0 (unregistered)
Needs more XML

Re: The Enterprise User Agent

2012-04-25 08:43 • by frenzic (unregistered)
379835 in reply to 379825
Great. Did that right away.

Re: The Enterprise User Agent

2012-04-25 08:45 • by frenzic (unregistered)
379836 in reply to 379825
will:
Yet another win for those who have replaced thier user agent string with "Commodore 64"


Great. Did that right away.

Re: The Enterprise User Agent

2012-04-25 09:14 • by C-J (unregistered)
You are all wrong, you use 960.gs and adapt.js. Works like a charm.

Re: The Enterprise User Agent

2012-04-25 10:23 • by Randompseudonym (unregistered)
379847 in reply to 379832
L.:
Besides, monitor res matters not when a luser installs every available toolbar...


That's what LARTs are for.

Re: The Enterprise User Agent

2012-04-25 10:56 • by ybred (unregistered)
379859 in reply to 379775
TroelsL:
This solution needs more service oriented architecture to facilitate social discovery.


I'm pretty sure I heard this exact same line from marketing.

Re: The Enterprise User Agent

2012-04-25 11:30 • by Shinobu (unregistered)
379867 in reply to 379808
Tim B-L:
If you're counting pixels you're doing it wrong! A user-agent should be able to resize images so they fit, or let you scroll. Your HTML should also be able to resize so it fits. If it can't, please go shoot yourself now for me, please please!!! YOU ARE THE PROBLEM!!!!!!!!
THIS. Think about it. The latest iPhone has 640 pixels horizontal resolution. If your content doesn't adapt to that, it will look crappy on a lot of desktops as well, especially if the user has the browser window open side-by-side with some other window, like a word processor or something.
The web is not a piece of paper, and a web page must adapt to whatever space is available. And checking the user agent won't tell you that.

Re: The Enterprise User Agent

2012-04-25 12:10 • by Jack (unregistered)
379877 in reply to 379822
Aussie Contractor:
The download size to fully display a page in the "desktop" version is 125kb and on the "mobile" version it is <2kb. When you are standing 450Km from the nearest town using my app on your Nokia 6550 you will thank me.
Perhaps if you give everyone that <2kb version they'd thank you too.
Aussie Contractor:
My web apps all have a mobile version detected by the server.
Nice. So you have to test everything twice, right? Oops. There's more than one "mobile" platform! Dammit! Now we're testing everything 10 times. And next year, when the new $COOL_THING comes out, we'll have to test again. Maybe even rewrite. Sounds like perpetual employment for something that should have been done only once. Sweet revenue stream for you, sucky costs for your employers and sucky experience for your users.

Oh please can't we go back to the good old days when everyone used Windows 95 on an 800x600 screen and the only way to communicate with someone else was to email them a Word document?

Re: The Enterprise User Agent

2012-04-25 13:06 • by Jay (unregistered)
In the early days of the web, the server sent what was basically a stream of text, with some markup and maybe a few images, and the browser laid it out to fit in the available space. One of the beauties of the system was that the person who created teh content didn't know or care what browser the user had, what their screen resolution was, what size the browser window was, etc. The browser just scaled and flowed text and made it fit.

Then some genius came along and decided that we needed to have a "richer experience", by which they meant that the server should specify all the formatting details.

The advantage and wonder of this scheme is that I now routinely visit web sites that have all the content in a narrow band in the middle, with big empty space on either side. Or worse, a web page assumes a screen wider than my browser window, so text falls off the edge and I have to constantly scroll left and right. As a developer trying to accomodate users who want these fixed layouts, getting the content right is now about 30% of the job. The other 70% is tinkering with layout to get everything position on the page just exactly the way they want, with all the fancy borders and icons and dancing bear graphics.

But all this inconvenience does not come without offsetting advantages. Now we can get exactly the right number of words on each line. Users are no doubt incredibly impressed by the beauty of the border we put around a block of text and how those findly rounded corners all meet just right. Why, I bet if we had square corners on the "Submit Order" button instead of rounded corners, they'd just exit our web site in disgust and go buy from someone else.

</rant>

Re: The Enterprise User Agent

2012-04-25 13:12 • by Real Tim Berner Lee (unregistered)
379892 in reply to 379794
Tim B-L:
The web is about connecting everything to everything, and everyone to everyone.

If you're even looking at the User Agent string you're doing it wrong!

Faker!! I am real Tim Berner Lee!

But even though you are faker, you are right about not looking at User Agent string. Important things are browser capabilities and window width, both of which can be tested.

Also to consider: data transfer to mobile is slow and it's a good idea to avoid sending large images if you will only show small ones.

Re: The Enterprise User Agent

2012-04-25 14:53 • by OccupyWallStreet (unregistered)
379905 in reply to 379821
smilr:
I specifically jailbroke my iOS devices so that I can put in the UAFaker addon to mobilesafari specifically so I can claim to be a desktop browser in order to prevent what you advocate.


There are tons of web browsers available for iOS that let you change the user-agent, no need to jailbreak for that (a lot of features that require jailbreaking are now standard or have alternatives in the app store).

And most mobile sites had "view full site" links that disabled the mobile version if you really needed it. But there are few of them I really use.

You'd have to take a LOT of convincing me that say, the full version of amazon.com is far better than the mobile version. Less tapping/scrolling around and zooming, for starters, neverminding that the mobile version loads 10 times quicker.

Re: The Enterprise User Agent

2012-04-25 14:54 • by Sanjiiv (unregistered)
It would probably be easier (and just as enterprisey) to write your own XML parser which converts the properties file to a giant "case / switch" at compile-time.

Re: The Enterprise User Agent

2012-04-25 19:36 • by The REAL real Tim Berners-Lee (unregistered)
379926 in reply to 379892
Real Tim Berner Lee:
Faker!! I am real Tim Berner Lee!

That's funny, i'd have thought the real Tim would be able to spell his own name.

Re: The Enterprise User Agent

2012-04-25 20:54 • by MarkJ
There's a class missing. Where's UserAgentAntiPattern.java?

Re: The Enterprise User Agent

2012-04-26 00:39 • by Echber the Other (unregistered)
All this talk about resolution-independence and not checking UAs is missing something that's just a little bit important: size or density-independence. A 1-inch button on a big 800x600 CRT isn't a 1-inch button on a 3.5" phone. Mobile layouts tend to have big, 'friendly' interfaces for a reason.

Re: The Enterprise User Agent

2012-04-26 01:48 • by L. (unregistered)
379935 in reply to 379934
Echber the Other:
All this talk about resolution-independence and not checking UAs is missing something that's just a little bit important: size or density-independence. A 1-inch button on a big 800x600 CRT isn't a 1-inch button on a 3.5" phone. Mobile layouts tend to have big, 'friendly' interfaces for a reason.


Indeed density is the biggest issue these days, with more tablets and phones using 1080p+ resolutions everyday. The only thing that would make any sense today is considering device type + physical size of browser window + have a resolution independent layout for each category. even more fail for the web coding world.

Re: The Enterprise User Agent

2012-04-26 01:53 • by L. (unregistered)
379936 in reply to 379934
Echber the Other:
All this talk about resolution-independence and not checking UAs is missing something that's just a little bit important: size or density-independence. A 1-inch button on a big 800x600 CRT isn't a 1-inch button on a 3.5" phone. Mobile layouts tend to have big, 'friendly' interfaces for a reason.


I forgot.. I read this yesterday

http://www.html5rocks.com/en/mobile/cross-device/

there's a piece about how high res touch devices report 50% res and render everything at twice the size, thus yielding the same one inch button on both ipad 2 and 3.

Re: The Enterprise User Agent

2012-04-26 08:50 • by pure
Dunno if anyone posted this already, but if there is a justitifaction, maybe this is it:

http://webaim.org/blog/user-agent-string-history/

TRWTF?

Re: The Enterprise User Agent

2012-04-26 10:01 • by Lockwood (unregistered)
379956 in reply to 379836
frenzic:
will:
Yet another win for those who have replaced thier user agent string with "ZX Spectrum"


Great. Did that right away.


FTFY

transverbero. I seem to have transverboed back to not being signed in.

Re: The Enterprise User Agent

2012-04-29 17:06 • by Kuba
380068 in reply to 379891
Jay:
Then some genius came along and decided that we needed to have a "richer experience", by which they meant that the server should specify all the formatting details.

The advantage and wonder of this scheme is that I now routinely visit web sites that have all the content in a narrow band in the middle, with big empty space on either side.
I hate to be the harbinger of bad news, but it truly, awesomely sucks to read stuff that's too wide. Get a published book and see how many words there are on a line of prose. Then look on a random webpage, on a line that has prose in the same language. If there are significantly more words, it becomes very hard to read. I don't mind the "narrow strip" formats as long as they maintain a certain number of words per line.

Re: The Enterprise User Agent

2012-05-01 20:34 • by CZeke (unregistered)
If you're Doing It Wrong just by looking at the user-agent string, what's it there for?

Re: The Enterprise User Agent

2012-05-09 06:20 • by pikzen (unregistered)
380667 in reply to 379797
C#:

String response = new StreamReader(con.GetResponseStream()).ReadToEnd();


Java:

BufferedReader br = new BufferedReader(
new InputStreamReader(
new InputStream(con.getInputStream())); // I've seen less wrapping on a gift
String response = "";
String lineRead = br.readLine();

while (lineRead != null) {
response = response + "\n" + lineRead;
lineRead = br.readLine();
}
// etc.


Most of the bashing is justified. Stop being so goddamn verbose, Java

Re: The Enterprise User Agent

2012-05-09 06:26 • by pikzen (unregistered)
380668 in reply to 379877
Nice. So you have to test everything twice, right? Oops. There's more than one "mobile" platform! Dammit! Now we're testing everything 10 times. And next year, when the new $COOL_THING comes out, we'll have to test again. Maybe even rewrite. Sounds like perpetual employment for something that should have been done only once. Sweet revenue stream for you, sucky costs for your employers and sucky experience for your users.


To be fair, most desktop designs do not go well on a mobile browser. Even if the resolution is good enough, the size of the screen is a problem.

Re: The Enterprise User Agent

2012-06-06 07:38 • by waterloomatt (unregistered)
382600 in reply to 379781
LOL - great!!

Re: The Enterprise User Agent

2012-08-02 10:24 • by db (unregistered)
386218 in reply to 380667
String response = org.apache.commons.io.IOUtils.toString(con.getInputStream());
//or pick any of at least 3 other libs to do it..
« PrevPage 1 | Page 2Next »

Add Comment