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.

111 questions
315
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
  • 3,262
  • 3
  • 16
  • 17
108
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,894
  • 9
  • 39
  • 62
61
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,392
  • 5
  • 24
  • 42
60
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,099
  • 1
  • 12
  • 23
42
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
  • 5,040
  • 14
  • 50
  • 74
38
votes
12 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
  • 653
  • 1
  • 7
  • 18
35
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
  • 2,430
  • 2
  • 32
  • 48
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
  • 12,359
  • 17
  • 65
  • 86
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
  • 916
  • 2
  • 9
  • 21
20
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
  • 4,593
  • 7
  • 23
  • 45
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…
9
votes
6 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
  • 665
  • 1
  • 6
  • 19
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
  • 4,593
  • 7
  • 23
  • 45
8
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
  • 605
  • 1
  • 13
  • 23
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,736
  • 4
  • 17
  • 18
1
2 3 4 5 6 7 8