How to detect Android in JavaScript?

Let’s learn how to detect Android in JavaScript. The most accurate or helpful solution is served by Stack Overflow.

There are ten answers to this question.

Best solution

Detect Android phone via Javascript / jQuery

How would i detect that the device in use is an Android for a mobile website? I need to apply certain css attributes to the Android platform. Thanks

Answer:

Take a look at that : http://davidwalsh.name/detect-android

Read more

Xavier at Stack Overflow Mark as irrelevant Undo

Other solutions

JavaScript/Hammer.js: How to detect Android pinch to zoom innerWidth?

I want to know the innerWith/viewport width of the pinch to zoom when it's zoomed. If it's below 500 px I want to change the image with: $("img#ad").attr("src", "http://img0.www.suckmypic.net/img/1/L/mmy4jT8s/jsFiddle3.png"...

Answer:

I've answered your question on SO: http://stackoverflow.com/questio... Test this JSFiddle: Edit this...

Read more

Luqmaan Dawoodjee at Quora Mark as irrelevant Undo

Detect Mac Command key being pressed in IE (Javascript)

I have a web page that is using Javascript to detect whether the Command key on the Mac is being pressed when the user clicks a link. This works fine on Mozilla, but it appears that IE does not implement the metaKey attribute on events (event.metaKey...

Answer:

I strongly suspect the event.ctrlKey is the one you want: <script> function ck(e) { var ctrl...

Read more

bay-ga at Google Answers Mark as irrelevant Undo

As a web app owner, how can you detect when someone has re-published your app via UIWebView on iOS or a WebView in Android?

I have a very popular web app that I've discovered a number of people are re-publishing as Android and iOS apps without my permission.  Id like to present users with a link to our official apps.  Is there a way to use Javascript to probe the environment...

Answer:

Do you have your own iOS and Android apps?  If so, you can add a custom header to the page requests...

Read more

Pat Roberts at Quora Mark as irrelevant Undo

Answer:

As others have noted, you can pretty easily check the navigator object. For mapping user agent strings...

Read more

Ryhan Hassan at Quora Mark as irrelevant Undo

Is it possible to detect when a request is sent by the browser and when an answer is posted?(with javascript)?

I am using jQuery to pop up a dialog box that might contain different things from iframes to image to ajax...I need a way to detect when a request is sent and when the loading is completed ( the answer to the request) in order to create a "loading...

Answer:

Not sure why frame should be a problem. The tags that support onload events are: body, frame (and iframe...

Read more

Salmane S at Yahoo! Answers Mark as irrelevant Undo

How to detect the Facebook like button in JavaScript?

I am attempting to detect the facebook like button in a chrome content script written in javascript. I've tried many methods including: var fbXML = document.getElementsByTagName('fb:like'); for (var i=0;i<fbXML.length;i++). { alert("found...

Answer:

Get some facebook likes .js files from http://userscripts.org & extract what you need.

Read more

Rajanshu Ujjwal at Quora Mark as irrelevant Undo

What devices support the "tel:" hyperlink (RFC 3966) and how can you detect those devices with javascript?

On iPhones and other mobile devices you can use "tel:" instead of "http://" or "mailto:" in hyperlinks. This allows the phone to call the number in the hyperlink. On desktops and some other devices this "tel:"...

Answer:

The tel: URL scheme works perfectly with Desktop Safari. You just need to: Install and configure a software...

Read more

Bertrand Lupart at Quora Mark as irrelevant Undo

How to detect horizontal scroll position relative to anchors in Javascript?

Ok, I'm building a horizontal scroll website for a photographer. We have some really nice wireframes done and I'm looking to create a neat effect where it highlights the specific photo you that is on the left of the screen at all times or more specifically...

Answer:

You can find the position of any element by grabbing its offset. http://www.quirksmode.org/js/fin...

Read more

Todd Iceton at Quora Mark as irrelevant Undo

How do I use JavaScript to make native Android apps?

I know about PhoneGap and most probably I will be using that, but I don't have any experience with HTML and CSS. What other JavaScript libraries exist that can make JavaScript mobile UI development easy? Also are there any easier alternatives to PhoneGap...

Answer:

You cannot use JavaScript for Native Android app development, by definition that would be an Hybrid...

Read more

Rishabh Poddar at Quora Mark as irrelevant Undo

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.