device-detection

What are best practices for detecting pixel ratio/density?

99封情书 提交于 2019-11-27 01:32:36
问题 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 device or not, like so: var isMobileScreenWidth = ((screen.width / window.devicePixelRatio) < 768) 768px is the point at which we define mobile or desktop so 767 and below is mobile and 768 and above is desktop. This works perfectly, but I have

Using Modernizr to test for tablet and mobile - Opinions wanted

。_饼干妹妹 提交于 2019-11-26 15:52:27
问题 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 devices where the screen size could also equal that of a small desktop screen (1024 x 768) I would test for touch events as well. At this time I would like to focus on mobile/tablet devices that, as jQuery mobile puts it are, A-grade. I am not

How to detect which device view you&#39;re on using Twitter Bootstrap API?

喜你入骨 提交于 2019-11-26 15:15:33
问题 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 form when viewing the site on mobile devices. The mobile view has 2 buttons which when clicked toggle the search form or main nav on/off. However if I toggle off the search form and then resize my browser to desktop view the search form is still

How to detect device is Android phone or Android tablet?

China☆狼群 提交于 2019-11-26 15:11:41
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 warn phone users to download phone app when they install tablet app. Vice versa for tablet users download tablet app when they run phone app. Is there any easy way to detect the device type? Edit: I found solution on this link . In your manifest file you can declare screen feature for handset and tablets then Google Play decides download permissions

How do detect Android Tablets in general. Useragent?

杀马特。学长 韩版系。学妹 提交于 2019-11-26 14:13:58
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 a specific device like the Xoom Useragent since Android will most likely be on multiple tablet devices in the near future. We are using Umbraco CMS, and we have looked at using the 51Degrees.mobi solution, and at this moment this will not work for our needs. Maybe in the future. I know 51Degrees and some of the people at Umbraco are going to be doing

How to detect device is Android phone or Android tablet?

自闭症网瘾萝莉.ら 提交于 2019-11-26 04:19:15
问题 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 warn phone users to download phone app when they install tablet app. Vice versa for tablet users download tablet app when they run phone app. Is there any easy way to detect the device type? Edit: I found solution on this link. In your manifest

How do detect Android Tablets in general. Useragent?

∥☆過路亽.° 提交于 2019-11-26 03:49:54
问题 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 a specific device like the Xoom Useragent since Android will most likely be on multiple tablet devices in the near future. We are using Umbraco CMS, and we have looked at using the 51Degrees.mobi solution, and at this moment this will not work for

Determine if the device is a smartphone or tablet? [duplicate]

廉价感情. 提交于 2019-11-26 00:00:12
问题 This question already has answers here : Tablet or Phone - Android (30 answers) Closed 5 years ago . 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: \" + System.getProperty(\"os.version\") + \"(\" + android.os.Build.VERSION.INCREMENTAL + \")\"; s += \"\\n OS API Level: \" + android.os.Build.VERSION.SDK; s += \"\