Questions tagged [device-detection]

Device detection is the process of deducing information, such as usable screen width and browser type, about a client device. For web services, device detection is typically performed by way of User-Agent string matching, as a way of tailoring content to different types of devices.

103 questions
285
votes
9 answers

Determine if the device is a smartphone or tablet?

I would like to get info about a device to see if it's a smartphone or tablet. How can I do it? I would like to show different web pages from resources based on the type of device: String s="Debug-infos:"; s += "\n OS Version: " +…
user1001635
  • 2,952
  • 3
  • 14
  • 17
105
votes
15 answers

How do detect Android Tablets in general. Useragent?

I have looked everywhere. We are using a Motorola Zoom to try our tablet site testing. The issue is that the Android Useragent is a general Useragent and there is no difference between tablet Android and mobile Android. I don't want to just target…
ClosDesign
  • 3,652
  • 9
  • 32
  • 56
58
votes
7 answers

How to detect which device view you're on using Twitter Bootstrap API?

I have just started to play around with Twitter Bootstrap API for a project I have coming up. The main nav contains 3 main elements: site nav social links nav search the site form I am using the collapse plugin to collapse the site nav and search…
James Howell
  • 1,280
  • 4
  • 20
  • 35
57
votes
8 answers

How to detect device is Android phone or Android tablet?

I have two apps for Android tablets and Android phones. For tablet app I set android:minSdkVersion="11". But nowadays Android phones like Galaxy S3 has Android version 4.0.4 so S3 users can download my tablet app from Google Play Store. I want to…
KAPLANDROID
  • 1,073
  • 1
  • 12
  • 21
41
votes
4 answers

Using Modernizr to test for tablet and mobile - Opinions wanted

I want to use Modernizr to detect whether a user is view a site on a desktop, tablet or mobile device. My initial first thoughts are obviously to check screen sizes that should be enough for mobile devices and also for larger desktops. For tablet…
mtwallet
  • 4,780
  • 13
  • 47
  • 71
31
votes
2 answers

What are best practices for detecting pixel ratio/density?

I am currently using JavaScript for mobile device detection on my website, this then allows me to serve different content for mobile or desktop users. Currently I use window.devicePixelRatio and screen.width to work out if the user if on a mobile…
lukehillonline
  • 1,720
  • 1
  • 21
  • 41
30
votes
6 answers

Best Open Source WURFL alternative

I am looking to do some device detection in PHP and I am looking into a few options. The one that looks the best right now is WURFL http://wurfl.sourceforge.net/. But I am very leery of it because of its non open source license. I am also wondering…
Mike
  • 11,085
  • 15
  • 55
  • 82
22
votes
4 answers

Detect mobile devices - and tablet devices

I am currently looking at some code for PHP detection of mobiles, which is probably quite easy. Now I just have got one problem - I want to make it possible to make unique view-files in my MVC-framework for tablets, mobiles and web pages. So I need…
denlau
  • 840
  • 2
  • 9
  • 21
20
votes
11 answers

Detect model of iOS device using Javascript or HTML?

So I'm serving H.264 .mp4 video on my website. I'm using open source HTML5 video player http://mediaelementjs.com/. Some visitors are viewing from Safari for iPhone. The iPhone 4 supports video playback only up to 720p, so if I make my videos…
17
votes
2 answers

Device detection if is android?

I have an meteor app that is deployed for both ios and android device and i want certain code to run on only ios device and not on android. I know that I can detect device using navigator.userAgent but this will only work if i have my app running on…
Nakib
  • 3,923
  • 7
  • 20
  • 45
10
votes
6 answers

How to detect the device on React SSR App with Next.js?

on a web application I want to display two different Menu, one for the Mobile, one for the Desktop browser. I use Next.js application with server-side rendering and the library react-device-detect. Here is the CodeSandox link. import Link from…
Benjamin Sx
  • 301
  • 1
  • 3
  • 12
9
votes
1 answer

Meteor device detection android or ios?

I have an meteor app that is deployed for both ios and android device and i want certain code to run on only ios device and not on android. I know that I can detect device using meteor device-detection package like Meteor.Device.isPhone() But is…
Nakib
  • 3,923
  • 7
  • 20
  • 45
8
votes
5 answers

Detect screen size and pixel density on the server-side?

I've been doing some research and I think I know the answer already, but I'm wondering if there's any means by which you can get a device's screen size and pixel density without the use of javascript or relying on CSS3 media queries. Essentially,…
dougoftheabaci
  • 485
  • 1
  • 4
  • 17
8
votes
2 answers

Php mobile/tablet/desktop detect?

How to detect with php, if the user use a desktop, mobile or a tablet?
eqiproo
  • 1,396
  • 4
  • 14
  • 18
7
votes
4 answers

Detect phone/tablet/web client using javascript

I am trying to detect if the end user is on a phone, a tablet or a pc I have been Googling for a while, apparently there are no easy solution. Well I guess I should not use Resolution, since nowadays some tablets have amazing resolutions. I should…
Matthew Yang
  • 565
  • 1
  • 10
  • 23
1
2 3 4 5 6 7