AppleInsider › Forums › Mobile › iPhone › Apple adds accelerometer, WebSockets support to Safari in iOS 4.2
New Posts  All Forums:Forum Nav:

Apple adds accelerometer, WebSockets support to Safari in iOS 4.2

post #1 of 17
Thread Starter 
With the release of iOS 4.2 for the iPhone and iPad, Apple has added WebSockets and accelerometer support in the Mobile Safari Web browser for developers.

The new features, detailed by Mobile Web Programming, allow Web developers the ability to offer users more features when a site is accessed from an iOS-powered device. In one example, author Maximiliano Firtman created a demonstration with a virtual on-screen ball that moves based on the orientation of an iOS device.

Firtman wrote the code in JavaScript and CSS3, and it relies on the newly added DeviceOrientation API in Mobile Safari. The application programming interface detects and delivers accelerometer data 50 times per second, and can also detect gyroscope data from an iPhone 4 or fourth-generation iPod touch.

Mobile Safari in iOS 4.2, released on Monday, also supports WebSockets, a W3C HTML5 API that will help chat and real-time applications that rely on a connection to a server using TCP sockets. Other updates to Mobile Safari include support for HTML5 forms, AJAX 2, print commands, and more.

Apple has pushed HTML5 and open Web standards for its mobile devices, including the iPhone and iPad. In September, AppleInsider revealed that Apple had created a "creative technology team" that would create new, interactive HTML5-based content to demonstrate the "innovative" capabilities of websites.



Apple also featured the interactive capabilities of HTML5 in a special section of its website launched in June. It includes features such as a 360-degree view of the entrance to Apple's iconic Fifth Avenue store in New York City, and an embedded trailer for the upcoming movie "Tron," all viewable without any browser plugins in a browser that supports HTML5, like Safari.

Apple's resistance to Adobe Flash also prompted the company to highlight HTML5-based sites that were deemed iPad ready before the touchscreen tablet launched earlier this year. Those sites rely on Web standards such as CSS3 and JavaScript, much like the new accelerometer and WebSockets support found with iOS 4.2.
post #2 of 17
The demo is kinda buried in the article...

http://www.mobilexweb.com/samples/ball.html

Pretty cool.
post #3 of 17
Just enable Flash on iOS and be done with it. Let me decide if I want to run it or not.
post #4 of 17
Quote:
Originally Posted by GQB View Post

The demo is kinda buried in the article...

http://www.mobilexweb.com/samples/ball.html

Pretty cool.


Just discovered it doesn't work in 4.2 GM1 (8C134). I guess they did a bit of tweaking during the delay.

Life is too short to drink bad coffee.

Reply

Life is too short to drink bad coffee.

Reply
post #5 of 17
The quake 3 HTML 5 demo was using websockets to connect other players in the LAN. Hopefully they hurry up with WebGL, webworkers and <device> tags.
post #6 of 17
Am I the only one who has noticed the virtual volume control to the left of the other media controls (in the multitasking tray)??
post #7 of 17
Quote:
Originally Posted by Joe hs View Post

Am I the only one who has noticed the virtual volume control to the left of the other media controls (in the multitasking tray)??

No you're not.
post #8 of 17
Quote:
Originally Posted by bcahill009 View Post

No you're not.

Oh good. I was getting worried.
post #9 of 17
It gets better.
2011 13" 2.3 MBP, 2006 15" 2.16 MBP, iPhone 4, iPod Shuffle, AEBS, AppleTV2 with XBMC.
Reply
2011 13" 2.3 MBP, 2006 15" 2.16 MBP, iPhone 4, iPod Shuffle, AEBS, AppleTV2 with XBMC.
Reply
post #10 of 17
WebSockets is in a messy state right now as most (all?) browsers implement the outdated version 76 which will be replaced with a newer one due to some serious issues discovered with the old proposal. Mozilla is right now discussing whether to prefix their implementation to discourage usage until the new version is specified and implemented.
post #11 of 17
Quote:
Originally Posted by powderdust View Post

Just enable Flash on iOS and be done with it. Let me decide if I want to run it or not.

you do decide by buying or not buying an iPad

iPod nano 5th Gen 8GB Orange, iPad 3rd Gen WiFi 32GB White
MacBook Pro 15" Core i7 2.66GHz 8GB RAM 120GB Intel 320M
Mac mini Core 2 Duo 2.4GHz 8GB RAM, iPhone 5 32GB Black

Reply

iPod nano 5th Gen 8GB Orange, iPad 3rd Gen WiFi 32GB White
MacBook Pro 15" Core i7 2.66GHz 8GB RAM 120GB Intel 320M
Mac mini Core 2 Duo 2.4GHz 8GB RAM, iPhone 5 32GB Black

Reply
post #12 of 17
oops never mind, post fail
post #13 of 17
Quote:
Originally Posted by powderdust View Post

Just enable Flash on iOS and be done with it. Let me decide if I want to run it or not.

Steve called, he said "Buy an Android".

Proud AAPL stock owner.

 

GOA

Reply

Proud AAPL stock owner.

 

GOA

Reply
post #14 of 17
So which version should.Apple 'enable' given that Adobe haven't made a version of Flash for iOS.

Go buy something that supports Flash if it's that important to you.

Quote:
Originally Posted by powderdust View Post

Just enable Flash on iOS and be done with it. Let me decide if I want to run it or not.

"The cobbler's children have no shoes", is a saying that applies a lot to companies who provide products and services. -KDarling on Google Search.

Reply

"The cobbler's children have no shoes", is a saying that applies a lot to companies who provide products and services. -KDarling on Google Search.

Reply
post #15 of 17
Quote:
Originally Posted by powderdust View Post

Just enable Flash on iOS and be done with it. Let me decide if I want to run it or not.

I'm a big fan of this model; works wonderfully on both desktop and mobile browsers. Keeps Flash out of the way for the 90% of the time I don't want it but lets me see Flash content when necessary.

Quote:
Originally Posted by AppleInsider View Post

...in a browser that supports HTML5, like Safari...

Err, I'm hesitant to use the term "supports" when HTML5 isn't even close to being finalized; this being particularly relevant for the <video> element, where <video> element content isn't even interoperable among different browsers that "support" HTML5
post #16 of 17
But what is really nice is that Safari seems to be a little quicker and a lot more stable on my 3G. From my perspective this is what is important! Safari crashes are hopefully a thing of the past.
post #17 of 17
Quote:
Originally Posted by Erunno View Post

WebSockets is in a messy state right now as most (all?) browsers implement the outdated version 76 which will be replaced with a newer one due to some serious issues discovered with the old proposal. Mozilla is right now discussing whether to prefix their implementation to discourage usage until the new version is specified and implemented.

prefixing... I'm being brought back to the 90's
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: iPhone
AppleInsider › Forums › Mobile › iPhone › Apple adds accelerometer, WebSockets support to Safari in iOS 4.2