I am building a mobile site that is based on google maps, basically displays a standard google map and some markers on it. What i would like to do and haven't found and info on it, is to detect mobile devices that don't support google maps and subsequently custom markers on it, using javascript maybe?
I would really appreciate if anyone could provide an example or point me to the right direction.
Thanks in advance
EV
List of supported mobile browsers:
http://www.google.com/support/mobile/bin/answer.py?answer=39891
I had a look and I think there probably isn't an API solution that allows you to check (like GoogleMaps.supportsThisBrowser(). So I think you might just have to sniff which browser version the user is using:
http://api.jquery.com/jQuery.browser/
And then compare their browser against the above list.
The FAQ is a bit unspecific and only states:
IE 7.0+, without Compatibility mode (Windows)
Firefox 3.0+ (Windows, Mac OS X, Linux)
Safari 4+ (Mac OS X, iOS)
Chrome (Windows, Mac OS X, Linux)
Android
BlackBerry 6
Dolfin 2.0+ (Samsung Bada)
But I read somwhere else that Android prior version 2.1 and iOS prior 4.0 is not supported either. It also depends on the specific device (HTC Hero for example is very slow rendering complex maps in the browser).
Related
Hi I am building a weather app and I was using Firefox and Chrome inspect mobile views to check how they would look on mobile devices.
This is the link to my weather app:
https://fervent-albattani-911414.netlify.app/?city=Beijing
On my Firefox developer tool, the iPhone 12 landscape of this app looks fine like this:
But when I go on my iPhone 12 and put it to landscape it looks like this:
https://drive.google.com/file/d/1x_PNSlMpdu6RZjybLzx2aSJyoNF2CTS_/view?usp=sharing
How do I fix this??
The developer tool is an emulator not an actual representation.
But since emulators do not replicate the software or the hardware of the actual physical mobile devices, they have serious limitations, as Google acknowledges. Simply put, these limitations result in serious testing errors.
Google even admits their emulator fails to accurately duplicate the behavior of the GPU and CPU in the mobile device hardware.
But here are two additional big deficiencies in the Chrome mobile emulator that Google doesn’t mention:
Chrome and Firefox mobile emulators uses a different rendering engine than either iOS or Android .
This can be shown when emulating a web browser -the Chrome mobile emulator uses a different JavaScript engine from Safari as Chrome uses V8 while Safari runs JavaScriptCore/Nitro. These differences will have a large effect on your actual resolution.
Note: simulation is often best for apps and emulation for websites. (Cloud based simulators help reduce the negatives of using simulators.)
References to mobile1st
I am developing a application based on javascript, it's a web app can run on browser. I intend to port it to a desktop app. I am using OS X 10.6.8 for desktop.
I am using chrome (latest version) for testing my web app, but when porting code to desktop, there are quite lot of bugs. I guess that it has a difference between chrome and webview on OS X 10.6.8. Please let me know which google chrome version that has webkit version is equal to safari 5.1.7 's webkit
If you mean the WebKit rendering engine, you can easily compare them by using user-agent strings.
Safari 5.1.7 has AppleWebKit/537.13+
Chrome 24 is the latest version that has AppleWebKit/537.13
I have a strange behavior on the iPhone browser. Is there a tool to debug the JavaScript of the iPhone browser?
I'm hoping there's something more advanced than simple alert() messages. Is there something with advanced tools like setting breakpoints and viewing object states?
With the release of iOS 6, Apple released Remote Web Inspector for their Mobile Safari, and this is huge. Basically you have all the features and power of Web Inspector in regular Safari, for your mobile apps, including Phonegap apps.
I've used weinre but this tool makes it obsolete for newer versions of iOS (unfortunately not for old versions of iOS, non-iOS devices, or if you're on Windows) since its a full-featured debugger with breakpoints and everything.
Requirements:
A Mac with Safari 6+
Either a USB-attached iOS 6+ device or xCode 4.5+ running an iOS 6+ simulator
How to activate the inspector:
In your simulator or device, open Settings > Safari > Advanced > Web Inspector > On
(this is on by default in the simulator)
In Safari 6+ for Mac, access your page from the Develop menu. You can enable Develop menu in Safari's Advanced Preferences if its not showing up.
More discussion at the bottom of:
http://www.mobilexweb.com/blog/iphone-5-ios-6-html5-developers
(Also, if you read about a "secret private interface" or iWebInspector somewhere, these are also made obsolete.)
check out weinre or use the remote version debug phonegap.
cu
you can also inject firebug using a simple bookmark. I've used it on the ipad and my debugging abilities were immensely enhanced.
I faced a simple use case in which I only needed to test my code on a Safari's JS engine (Merely debugging, simply running it and consuming traces).
To that end I used Epiphany web browser, which is both free and uses JavaScriptCore JS engine which is also used by Safari.
Epiphany isn't provided with developer tools, so I used http://jsconsole.com/ to view my traces.
Though it is a thin solution, it helped me find a line which worked on Chrome but didn't on Safari.
Step by Step Guide How To Enable JavaScript in iPhone
Open your iPhone settings.
Tap on safari in the app list.
Tap on Advanced option.
Enable Javascript iPhone with the help of switch push.
The Zepto.js website says:
Zepto.js is a minimalist JavaScript framework for mobile WebKit browsers, with a jQuery-compatible syntax.
Is it only recommended for use with apps that will be used on mobile devices or can it also be used in traditional computer browser web apps as well? What are the downsides of doing so?
I use jQuery a lot in my regular web apps (for computer browsers) and I've realized (after finding Zepto.js) that I don't always use all of jQuery's features, so Zepto.js is perfect for what I do.
Also, why is there focus on the 'WebKit' engine? Does it not work with mobile Internet Explorer on Windows Phone 7, Firefox Mobile on Android or Opera Mobile?
EDIT: The presence of $.os.android in addition to $.os.ios indicates that there is support for non-iOS platforms, so the last question is answered!
EDIT (final): I guess the real question is "Can the Zepto.js library, intended for use on mobile WebKit-based browsers, be used as a lighter-weight alternative to jQuery for the desktop also?" The answer is no.
Note: This answer is old, and not up to date anymore. Yes, Zepto started as a webkit-only, mobile-specific framework, but it has evolved since then as EBarr points out below.
So always check Zepto's website for the most up-to-date information.
Not to sound too harsh, but did you click the big button on the site to see the presentation?
You basically already answered the questions:
Yes, it's for mobile devices. Support for swipe and tap events doesn't exactly make sense on a desktop computer, where you use a mouse.
Yes, it's for WebKit specifically, because that's what's most used for mobile browsing. That means no support for IE/Firefox/Opera - mobile or desktop. As the presentation says, "No one is running IE6 on an iPhone". Most desktop-browser JS libraries exist specifically to eliminate browser differences. Zepto does the opposite.
jQuery is an offroad truck: Enormous but very capable both on- and off-road.
Zepto is a Formula-1 car: Small, fast, and built exclusively to be great on the racetrack, so it won't work right in any other situation.
It seems that Zepto's purpose has evolved. The site now notes :
Note that some optional features of Zepto specifically target mobile
browsers; as the original project goal was to specifically provide a
leaner alternative to jQuery on for the mobile web.
It lists the following as target platforms (note the inclusion of desktop browsers):
Browser support
Primary (100% support)
Safari 6+ (Mac)
Chrome 30+ (Windows, Mac, Android, iOS, Linux, Chrome OS)
Firefox 24+ (Windows, Mac, Android, Linux, Firefox OS)
iOS 5+ Safari
Android 2.3+ Browser
Internet Explorer 10+ (Windows, Windows Phone)
Secondary targets (fully or mostly supported)
iOS 3+ Safari
Chrome <30
Firefox 4+
Safari <6
Android Browser 2.2
Opera 10+
webOS 1.4.5+ Browser
BlackBerry Tablet OS 1.0.7+ Browser
Amazon Silk 1.0+
Other WebKit-based browsers/runtimes
EDIT
List above updated to reflect reality as of January 2013.
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
Supported, but only with an update
iPhone 3G
iPhone 2G (?)
PC or Mac computer with Firefox 3.5
Supported with some other snippet
?
What is the level of support in Blackberry, Android phones, etc?
As of today, the W3C Geolocation API (widely associated with, though not technically part of, HTML 5) is support in the following major desktop browsers:
Firefox (since 3.5)
Safari (since 5.0)
Google Chrome (version depends on OS)
Opera (since 10.60)
Internet Explorer (since IE 9)
There are at least two mobile browsers that implement the Geolocation API:
Safari Mobile (since iPhone OS 3.0)
Android (since at least Android 1.6)
On all of these platforms, you should be able to use navigator.geolocation.getCurrentPosition, etc.
Although I think it's a great practice to standardize on the (draft, by the way) W3C Geolocation API, it's worth noting that there are a few other options in the browser, which can be particularly helpful if you need to target an older platform.
Firefox 3.1 had support for Geode, which uses calls to navigator.geolocation with very similar syntax.
Loki is a plug-in built by Skyhook which works on Internet Explorer 6, Internet Explorer 7, Firefox 2, Firefox 3, Safari and Opera. The syntax is substantially different, but still easy.
Google Gears provides a geolocation API with a syntax fairly similar to the W3C API syntax. You can install Google Gears on Internet Explorer 6+, Firefox 1.5+, Safari, Opera Mobile and IE Mobile.
From a similar more recent topic:
"I'm working on an open source library that supports all javascript location capable phones with the W3C standard. So far it supports iPhone, Android, BlackBerry and some fringe browser platforms running in a browser. The lib can also be used when writing web stack standalone apps for Nokia OVI and the Palm WebOS.
http://code.google.com/p/geo-location-javascript/"
The W3C version works on android 2.*. On android 1.6 you can fallback to gears, which will work pretty much the same way. In theory the W3C standard should also work on Firefox mobile (Fennec), which currently is available for Nokia's Maemo devices and will be standard on MeeGo.
You don’t have to have the newest mobile phone to use GPS and Geolocation API. Almost every mobile browser (without proxy server) can be used to read position from buidin GPS. If You have Java and GPS in Your phone – You can use mobile-gps-web-gate – see at http://code.google.com/p/mobile-gps-web-gate/
I know this is an old question, but you'll find a list of devices that support geolocation here: http://www.quirksmode.org/webkit.html. This list is being maintained by the site author so it should stay up to date.
Franson's GPSGate is a commercial product that can expose a Windows machine's hardware GPS to any browser through javascript. The interface is a little different from the W3C's implementation though.
Update: the Express (lite) version of GPSGate is free.