I was reading documentation on some bad practices when building a website. The MDN said this is very old and a bad practice but there are certain cases in which it is acceptable. Such as device detection.
https://developer.mozilla.org/en-US/docs/Browser_detection_using_the_user_agent
If I were to build a mobile site and use UAS to detect the device to send a user to a less data intensive website; should I? I know there is fluid and responsive layout but most of those website include rules for a fix desktop width too. Are there any edge cases of devices that do no include mobile in their UAS?
I realise this is an old question but hopefully this isn't too late for you.
I would be very wary of using the UA alone to do anything for the reasons mentioned in the article you linked.
That said, there are plenty of situations where you can give a better user experience by using a device detection library like 51 Degrees and being aware of a few things.
In particular you mention less data intensive version of the website. There is something of a trend in places like India, where access to poor quality data connections is the norm, to use browsers like UC browser and Opera mini.
These work by going via a proxy and stripping out a lot of the heavier weight stuff in a web page. Needless to say, this can destroy your lovely ultra-modern, highly responsive interface.
51 Degrees will tell you if the browser is of this type with an attribute called IsDataMinimising and you can adapt accordingly, giving the user a better experience while also saving your bandwidth.
Full disclosure: I work for 51 Degrees.
As it is shown in Project Tango GTC Video, some local features are extracted and tracked for motion estimation that is then fused with accelerometer data.
Since any developer may need to track features to develop his/her apps, I was wondering if there would be a way to get those features through APIs.
Although it is possible to extract some point and retrieve their flow using estimated 6DOF pose returned by the APIs, it adds extra overhead. Another issue with this approach is that the pure visual flow (including outliers) is not achievable and is influenced by IMU data.
So my question is that if these features are tracked using hardware-accelerated algorithms, how can we get them using APIs without having to implement it and do a redundant task.
Any answer and suggestion would be appreciated.
It is straightforward to compile OpenCV for the Tango with nVidia's TADP package. Use 3.0r4. You may need to merge some OpenCV-4-Android bits but it's easy, and the ES examples will fail on the device but don't sweat it.
Google released the "Project Tango ADF Inspector" on play store - I haven't actually had any time to play with it, but its the first thing to offer any look inside that data - I think Google considers this data sensitive and is cautious in this area, with good reason - If you look for the starred "important" note on this page you should get a feel for the sensitivity of that issue.
I have a responsive (RWD) website which works OK on mobile devices. My problem is that pictures are sort of "heavy" on smartphones and uselessly large on older phones.
I know there are plenty of tools either offline or online (such as: http://www.resizeyourimage.com/) to resize pictures and I know I could roll my own image resizer with GD and the like (PHP here), but I was wondering if someone here is aware of a way to have images automatically resized.
For example by piping them through a proxy of some kind, such as:
http://cloudservice/w_320/http://myserver/mypic.jpg" />
A free service highly preferrable.
This way I wouldn't have to retrofit old pictures nor is it necessary to provide multiple versions of the same picture.
I hope my question makes sense...
There are many such services, and a similar question has been asked before.
All reliable solutions will also requires a tiny bit of client-side javascript. Cookies don't work on the first page load (which is most of them), and sniffing gives useless data if you're doing RWD with breakpoints. Excepting slimmage (and solutions with <noscript> tags), most will download 2 copies of each image (or worse, fail accessibility and SEO requirements).
I favor the DRY & CSS-friendly Slimmage.js, as its author, but there is also Picturefill for those who want art direction support (and are willing to handle the resulting markup complexity). Both can be used with any RIAPI-compliant server-side module, such as ImageResizer (disclaimer of authorship applies here too).
If you have access to a Windows (or linux/mono) server, consider self-hosting.
Dynamic imaging SaaS products appear and fail on a regular basis, so have a backup plan in place to replace the URLs if your SaaS isn't RIAPI-compliant. If your HTML isn't dynamic or can't be post-processed, you're going to have... fun.
A few services (free or in beta):
CDNConnect (RIAPI-compliant third-pary service based on ImageResizer)
BoxResizer (free, but uptime not guaranteed)
Sqish
Resizor
Some non-free (and non-compliant) services
http://www.resrc.it/pricing/us
https://responsive.io/plans#pricing-list
https://www.maikoapp.com/
http://www.thumbr.io/plans_and_prices
You should check out WURFL Image Tailor.
Works pretty much as you describe. You refer the images through a proxy like this:
<img src="//wit.wurfl.io/[full-url-to-your-image]">
The proxy will then detect the screen size of the user-agent and resize the image accordingly. This service also take some arguments that allows you to explicitly set height, width and percentage of screen size.
One image resizing service you can use is https://gumlet.com. You can use any image source with it and resize images exactly as per your need.
For example, to get image width of 300 px, you can write
https://subdomain.gumlet.com/image.jpg?width=300
P.S. I work at Gumlet.
Our training department has developed a number of interactive training videos that are in SWF format. Is it common to use a different dedicated host for large numbers of SWFs (like is often done with Video) or are SWFs usually light enough weight that they can be hosted on the same platform as the main site without causing too much additional impact on things?
Please pardon my ignorance here... thanks!
I would think the biggest impact you're going to see on your servers (aside from disk space required for storage of the SWF files) is the bandwidth consumed as people download these videos from your servers.
We provide a web application with a frontend completely developed in Adobe Flash. When we chose Flash 6 years ago, we did so for its large number of features for user interaction, like dragging stuff, opening and closing menus, tree navigation elements, popup dialogs etc.
Today it's obvious that AJAX/JS offers roughly the same possibilities and because of the number of frameworks that are readily available, it's very feasible to implement them.
Is there a technical reason one should choose either technology over the other? By "technical", I mean performance, security, portability/compatibility and the like. I don't mean aspects such as the very non-programmer way development is done in Flash or whether it makes sense to switch an app from one to the other.
As I just explained in another question, it seems to me that JS is way ahead in terms of market share and I'm wondering whether we are missing some important point if we stick to Flash.
In addition to what others have said, Flash is constrained in the "rectangle" and cannot be added to a normal html page in an un-obtrusive manner.
#Gulzar I think when more browsers will support the video tag like mozilla 3.1 does we'll see even more adoption of ajax/js over flash.
Adobe Actionscript is a statically typed language, Javascript is dynamically typed. Depending on your point of view, this may be a good thing or a bad thing.
With Javascript/HTML/CSS you're going to be heading into cross-browser compatibility hell, especially if you want to support older browsers. This can be mitigated by the libraries that are available, but it's still a big headache. With Flash, you write the code once and it just works in all browsers.
Even with the libraries available, Flash user controls are simply more advanced than anything you can find in the world of Javascript/HTML. In Javascript, you are not going to find anything that comes close to the simplicity and power of a databound user control that Flash provides.
I don't see how Javascript has more of a "market share" than Flash. Pretty much anyone with a web browser has a Flash plugin installed. I'd be curious to know how many people disable Javascript but have a Flash plugin.
Also keep in mind that you're going to be in for a huge learning curve and lots of development time if you decide to switch your technology base so you'd really better have a good business reason to do it.
This decision also has a lot to do with what your application does and who your install base is.
Edit: I see people have mentioned that the iPhone doesn't have Flash support. I would expect this to change with the install base of the iPhone - Adobe would be crazy not to support it.
Correctly designed AJAX apps are more googleable than Flash
Correctly designed AJAX apps are more easily deep linkable than Flash
AJAX doesn't require a plugin (Flash is pretty ubiquitous, so it's not really a big deal)*
AJAX isn't controlled by a single company the way Flash is
Edited to add:
* Except for the iPhone, as Abdu points out.
JS and Flash both have great presence on the web with overlapping capabilities. One area JS is still lacking is in rendering video.
Flash, used well, allows easy localization and internationalization.
Furthermore, it is much easier to use Flash in an accessible manner; you can feed screen readers the right text, instead of having them iterate over all of the possible form elements.
I think Flash should be limited to online games, videos and animation. Otherwise use html and Ajax. It's a web standard and supported by almost all devices.
AFAIK, the iPhone doesn't support Flash. That's a fast growing segment you're blocking out already. Keep it simple and efficient.
Although flash is pretty ubiquitous on desktop browsers, mobile support is very limited (flash lite? yeah, right). I get really frustrated looking up a restaurant on my phone only to find the entire site is flash based and I can't even get a phone number or address!
One benefit of Flash is that it has a few facilities to help do cross domain type operations safely, which can be helpful. Flash also has (limited) support for some hardware, which is not possible with Javascript.
Personally, I'd try to use as much Ajax as possible before turning to something like Flash. From the UI perspective, it is better in that the controls and basic authoring is a little more developed. The Sound Manager project is a good example of effectively using a small amount of Flash while keeping the remainder in Javascript.
I suspect one of the reasons javascript is becoming more popular is that it's more easy to retrofit into an existing application.
As I can't accept two answers, I'm going to merge Christ Upchurch's and 17 of 26's answers in my own post. I think, these two together pretty much sum up what I wanted to know. Thanks guys!
If you're dealing a lot with polygons, then Flash is still easier to program and debug. With AJAX there are a lot of libraries to handle polygons, but the more libraries your app uses, the slower it gets.