I have seen several of these question from 1-2 years ago about Android pre-4.0. I want to ask this again for Android 4+.
I have a galaxy s3 running 4.3 and when I click on a pdf link it downloads the document rather than opening it in the browser.
I am building a website and it will have links to pdf documents. The desired behavior when one of my users clicks on the pdf link on their Android device is for the pdf document to just open like it would on a desktop browser.
Is there anything I can do to achieve this functionality, or does Android still not support this?
I cannot control the device that a user is using, so I'm looking for a solution that would achieve this functionality in as many cases as possible.
The stock browser does not support native viewing of PDFs. You can however redirect the link to google docs and view internally that way. To do this, launch your implicit view intent, as I suspect you are already doing, but prepend the URI with "https://docs.google.com/gview?url=" and Google will take care of the rest
Alternately, there are a few libraries that you will see linked around SO, but from what I saw while researching, most are proprietary and cost and even then they might not work 100%. Google docs is free and works as often as Google does, which given that this is their platform you have to imagine they make certain their service works close to 100% of the time.
it downloads the document rather than opening it in the browser.
"it" is a Web browser. There are many Web browsers for Android. A Web browser can do whatever it wants when the user clicks on a link to a PDF file.
The desired behavior when one of my users clicks on the pdf link on their Android device is for the pdf document to just open like it would on a desktop browser.
That is not the behavior of all desktop browsers, particularly depending upon user configuration (e.g., browser extensions). A desktop Web browser, like a mobile Web browser, is welcome to do whatever it wants when the user clicks on a link to a PDF file.
does Android still not support this?
Android is an OS. Android neither supports nor does not support this. Web browser applications will or will not support what you want.
I cannot control the device that a user is using, so I'm looking for a solution that would achieve this functionality in as many cases as possible.
You are welcome to test a variety of Android Web browsers, see if there are any that behave the way you like, and suggest to your users that you would prefer that they use those browsers. Your users, in turn, are welcome to honor or ignore your request.
Or, as Chris M points out, you are welcome to not show a PDF at all, but rather redirect the user to some URL that processes the PDF and renders it in some other way.
Related
is there a client based javascript way to detect Eddystone-URL beacons directly from the Chrome browser in iOS?
I know Chrome has the widget for the today view wich works fine, but I need to detect new Eddystones without pulling down the notifcations window.
Say a user clicks on a link provided by the widget, gets redirected to the Chrome app, does stuff, walks around and gets in range from another beacon.
Right now he would have to pull down the tab again to receive the new URI. But I need some sort of notification from within the Browser.
I hope you get the idea.
Thanks in advance!
Cheers
p.
Unfortunately, this is not possible. Understand that Chrome for iOS is just a thin app around the standard native iOS UIWebView, so there is nothing you can do in JavaScript that you cannot do in Safari. And Apple does not implemented any JavaScript bindings to the CoreBluetooth APIs that would be needed to detect Eddystone-URL beacons. The bottleneck is more of an iOS restriction than a Chrome browser one.
Note that this is not true for the Chrome browser on other platforms, notably ChromeOS, which does provide such JavaScript APIs.
I'm developping a web server based on SpringFramework 4 and I hope to return some files and open them directly in the browser.
So far, I succeed to treat PDF by using Header Content-disposition: inline. But it is not working for word/excel. Google Chrome proposes to download the later or download/open by application.
So I hope to know
whether or not it's possible to open them directly in the browser
if yes, how to do that
As far as i know there is no built in Excel viewer for most browsers (IE is different because it is part of Windows, and so is Office). PDF is a different story ... there are loads of plug-ins available.
You might want to consider opening it in google docs, or office.com.
Apparently, there is a plugin available for firefox ... http://www.microsoft.com/en-gb/download/details.aspx?id=27106
BUT that does mean any users will have to have it installed for them to get the behaviour you want!
We're using node-webkit for packaging an app made with HTML5 and js. Everything has been working well but now when we try to read the content using a screen reader (Apple VoiceOver or Jaws), the content seems inaccessible.
The screen reader is able to read the window's buttons and the window's title but can't read the HTML inside the app. Actually it doesn't work with the sample page that came out of the box with node-webkit so is not a problem of our app.
Any ideas or alternatives? Thanks!
Each platform (OS) like Windows, OS X and Linux(es) (and Android and iOS and countless others on mobile) has its own accessibility API. For example Windows Automation API on Windows 7 and 8 (open source softwares use IAccessible2 but it seems to be a useful extra layer to it. Whatever)
A software like a browser must communicate with the OS what it is doing via this API (it could be an email client, a spreadsheet, a file explorer, etc).
The OS will filter (examples: if it's not the active window, if a system thing happens like removal of a USB key or new notification)
This accessibility API will then inform assistive technologies (AT) like a screen reader (SR) of what's happening. A SR being a complex software with user configuration, it'll also filter, adapt, output via a speech synthesis and/or a Braille display, etc from what it was fed.
Though I'm only accustomed to web accessibility and not in anything related to software, browsers, APIs and their internal working (so I could be very wrong, sorry) I guess the communication related to accessibility from "WebKit" to the OS (and there's "WebKit" on Windows, OS X, maybe still Linux, etc) is managed by Chrome the software (and vanilla Chromium the software from Chromium the project), NOT WebKit the rendering engine. node-webkit is made around Chromium but does it pass along the messages related to accessibility API? If it does or can, you should have the same accessibility as in Chromium (good luck with that, compared to Firefox and IE). If it doesn't, that's a black box.
One would then need to add all this accessibility API management to make it work! Maybe it's just an option in node-webkit?
If you want to verify if anything goes out of a software related to an accessibility API, you can test with aViewer from The Paciello Group.
May be related: Blink accessibility (Chromium project)
I am creating an application that runs in chromium portable in full screen with the --kiosk flag. It is written in HTML, JavaScript, and CSS. I am also using the HTML5 File System to store some large sets of data. The application opens up in full screen, and the info bar to request permanent storage pops up.
The problem is that, while running in kiosk mode, you cannot select either "OK" or "Cancel" to the file system's request to store data. You can only close the info bar with the "X". This results in the file system not getting any kind of quota and the application fails.
So is there a way to have unlimited storage for an application running from "file:///"? I have tried using --unlimited-storage but it doesn't seem to work for a webpage.
Is there a way to open up in full screen without using --kiosk? Any other work arounds or suggestions are welcome.
What version of Chromium Portable are you using? I had a similar issue awhile back, but I don't have the same problem in the newer versions. I am using the latest version as of now which is Chromium Portable 30.0.1599.10 (released on 2013-08-21).
I want to check whether the user is viewing my site from a mobile device or PC. If it's a mobile device, I want to redirect my site URL like Google does...
If possible I would like to implement this in JavaScript. How can I do this?
You typically use the User-Agent header to detect the browser.
Here's JavaScript code that does basically that (only for mainstream browsers though, you'd have to add the Mobile User-Agents)
http://www.quirksmode.org/js/detect.html
And here's a list of mobile browser identifiers
http://www.zytrax.com/tech/web/mobile_ids.html
The list is not complete and will never be, given the rate new mobiles appear on the market, but what I did back when I did it is to store all received user agents in a database, and then look for them to classify them as mobile and which brand/model.
What you can't rely on though is JavaScript, it's better done in server code (not all mobile browsers execute JavaScript).
There is a related question here on SO but I couldn't find it.
See this existing question.
You will have better luck doing this server side, as many mobile browsers don't even support JavaScript. Basically you want to check the user agent and compare to a list of known mobile browsers.
Here is a simple answer for this query. This won't detect the mobile browser, but it redirects the page to our mobile.html page, through the following script;
Find out the browser window size and redirect it..
winWidth=document.all?document.body.clientwidth:window.innderwidth;
if (winwidth<800)
{
window.location.replace("mobile.html");
}