mobile-website

Is there a way to force horizontal / landscape layout on mobile devices?

拜拜、爱过 提交于 2019-11-27 08:45:27
I'm building a mobile version of a website, and in this specific case it would look perfect in horizontal layout. Is there a way to force this layout no matter user setting are? Answer with some universal way is appreciated, but also if you know how to achieve this on any specific platform (iPhone, android..) so maybe we can collect a decent set of rules to target majority of mobile users. Michael Mullany There is a hack that will accomplish this, but I seriously advise against using it - your design should adapt to whether someone is in portrait or landscape mode. Step 1: Query the window

Is it okay to use <input type=“tel”/> now?

耗尽温柔 提交于 2019-11-27 05:26:42
问题 I'm working on a mobile phone web app and I have several text fields that could benefit from <input type="tel"/> . iPhones will adjust the keyboard for the user, but I'm worried about breaking backwards compatibility. What I'm hoping is that browsers/phone that support this can assist the user and other browser will fall back to a standard text field? Is this an acceptable practice? Does it even work? 回答1: Yes, any unsupported type will revert to the 'type=text' format. I found a good page

How to fetch device information from a progressive web app

守給你的承諾、 提交于 2019-11-27 03:36:16
问题 How to fetch device information (Google Advertising Id or IDFA) from a progressive web app https://developers.google.com/web/progressive-web-apps/ 回答1: Google Advertising ID is not accessible to progressive web app running in browser and so the installed PWA. Said that, you can make it available to your installed PWA using an Android service(which is a native code getting the Google Advertising ID) and passing it to your PWA using Deep links, by setting a Indent filter to your PWA with a URL

Redirect mobile devices to alternate version of my site

柔情痞子 提交于 2019-11-27 03:35:54
We've got an alternate version of out website ready for mobile devices. The content we serve is different and it works well. What is the best way to detect which version to serve. We don't have a list of all mobile devices so to use the user-agent header is tricky as we may miss something. We thought about useing device screen width - but what happens if the mobile device doesnt support javascript. How do we sniff this ? You could use a device description database (such as WURFL ) which will recognise the client device from the request headers. You can then query that database to decide if the

Android Browser textarea scrolls all over the place, is unusable

天大地大妈咪最大 提交于 2019-11-27 02:42:58
问题 So I've built a nice, shiny HTML5 application that is targeted at mobile Safari, and Android's default browser. The Android versions I'm testing it on are 2.1 and 2.2. My app has a textarea on one of its pages, and this textarea tends to have a good amount of text in it at times. Its basically a free-form writing field. This works as expected in iOS. However on Android, as you type, the screen scrolls wildly up and down on every keystroke, often you can't see what it is you're typing as you

Detecting mobile browser in GWT [closed]

旧时模样 提交于 2019-11-27 01:24:05
问题 I want to implement a web application with separate user interface for mobile and PC. Do you know how can I detect whether it is mobile or not? In general, do you have any suggestion for implementing such application in GWT? 回答1: On the client side, you can use the Navigator class to get the platform and the user agent string: Navigator.getPlatform Navigator.getUserAgent Identify devices and platforms that way. 回答2: If you are used to developing with the MVP pattern or want to make a mobile

Strange behavior of select/dropdown's onchange() JS event when using 'Next' on Mobile Safari Dropdown list item select box

江枫思渺然 提交于 2019-11-27 01:10:24
This is a hard one to articulate and I am new to mobile web development so please bear with me: On my webpage, I have 3 Nested dropdown lists (Area, Town, Street). Nested as in, each dropdown's items are modified when the selection in the dropdown above it changes. e.g selecting an Area changes the Town and Street lists and selecting a Town changes the Street list. I use XMLHTTPRequests in the onchange() javascript event of the dropdowns to fetch and populate the other downdowns. This works fine on Android and Desktop browsers. On Mobile Safari , when a drowdown is touched, a list is shown

Which Devices Support Javascript Geolocation via navigator.geolocation?

送分小仙女□ 提交于 2019-11-27 00:23:17
The iPhone supports geolocation in mobile Safari via the following call: navigator.geolocation.getCurrentPosition( function(pos){ var lat = pos.coords.latitude; var long = pos.coords.longitude; }, function(){ /* Handler if location could not be found */ } ); I'd like to build a good list of devices that have one of the following: support this feature out of the box , or support this feature with an upgrade, or support geolocation with equivalent fidelity of data with some other snippet of Javascript. I'm only familiar with my own device, so this is my list so far: Out of the box: iPhone 3GS

“Add to homescreen” button in Android does not show website as a Web App

故事扮演 提交于 2019-11-27 00:04:12
问题 I've created a mobile-friendly web site with jQuery Mobile and added some meta info so that it should be pinned to iOS and Android homescreens and should be launched as a web app (in other words: in a browser, but without browser navigation elements). It works fine for iOS, but it doesn't work for Android 4.4.2. I followed this tutorial for creating Android-Compatible web apps: Despite adding all the meta info as listed in the tutorial, Android does show the "Add to homescreen" button for my

Meta-tags for mobile – should they be used?

喜欢而已 提交于 2019-11-27 00:00:41
问题 Meta-tags "Viewport", "MobileOptimized" and "HandheldFriendly" can be used to provide appropriately formatted HTML-content to mobile devices. Are these tags good things? They seem pretty platform specific in many cases, and even when not platform specific (viewport), they seem to require device specific attributes in order to work properly. Should they be used? Where and when is it appropriate to use them? Are there alternatives (without user-agent recognition)? Note: I have been using CSS