Showing posts with label html5. Show all posts
Showing posts with label html5. Show all posts

Sunday, 24 March 2013

Putting a webserver inside a Phone!

The Project SmartBerryBox

This project born during an hackathon at CodeMotion Conference in Rome.
Thanks to this project I won a wonderful BlackBerry Z10.
The idea is showed in the following video:



What does it happens?
It is an HTML5 game running in the browser.. and the phone, a blackberry 10 devalpha device, it is used as a pad/controller.

This project is full of different tecnology:

  • a standalone webserver: mongoose runs inside the phone
  • the communication between the phone and the browser is made with websockets
  • html5, canvas, jaws js, javascript for drawing and moving the game

How?
1. The server is inside the phone and the browser download the html5 game files, at first connection; like a visit of an html page.
2. The browser establish a websocket connection with the web server.
3. Whenever an event from the controller/the phone touchscreen, occur, the phone send with websocket the controller event(left,right,fire pressure) to the html5 game that update the movement of the player ship, on the canvas.

Why?
Your phone can do more and more..
Don't you want to use those CPU Cores for something useful and funny? :)
Smartphones are replacing portable console but they can replace home console, at least for casual gaming!
And this is just Today!
You just need a browser with HTML5 and websocket capability and your phone.
The browser (inside a smartTv for example) became the screen, the phone is the pad.
Your phone is something that it is able to adapt to different context and games,  just changing UI or use different hardware like the accelerometer.

Imagine a multiplayer game context, where every phone is connected each other and it is able to act as a controller: you and your friends playing in front of the tv: a quiz game, a car race, etc.
Cool, isn't it?

All the code I did, run on a BlackBerry 10 device, but since it is full of opensource tecnology it is easy to port the code to Android, maybe IOS.. with Native SDK.
The fundamental part is running mongoose with USE_WEBSOCKET flag.

I don't think windowsphone is able to run it, due to platform limitation: no native c/c++ code..as I know..

I will give all the code to the community in the next days, a blog post will follow and the source code on github also.
Do you like it?

Wednesday, 12 September 2012

If you are better than facebook engineer..than go ahead with HTML5

Yesterday, M. Zuckerberg talked about HTML5 as a mistake for the facebook iphone and android app.

Exactly:
When I’m introspective about the last few years I think the biggest mistake that we made, as a company, is betting too much on HTML5 as opposed to native… because it just wasn’t there. And it’s not that HTML5 is bad. I’m actually, on long-term, really excited about it. One of the things that’s interesting is we actually have more people on a daily basis using mobile Web Facebook than we have using our iOS or Android apps combined. So mobile Web is a big thing for us.
Quote from http://blog.tobie.me/post/31366970040/when-im-introspective-about-the-last-few-years-i

(maybe people use Web Facebook instead of native version because the previous version was buggy. Changes are hard to made)


I totally agree about HTML5... but I also think that for any app out there, use HTML5 as a one solution for all the mobile platform out there, and as the main platform to build app is a mistake.
I don't have a good opinion of HTML5 on mobile, for many reason:
  • it is a growing and evolving tecnology with a not defined standard: there are 2 standards now..
  • you lose the link to the hardware and also control, if you need it.
  • I don't believe personally to solution/framework that can works everywhere.. You need compromise; compromise means poor integration & bad performance and so a bad user experience.
  • Not all the mobile browsers are the same: on android platform, you can find different browser installed, with different rendering engine. Yes you can choose to support only some browser.. but don't you choose HTML5 because it can runs everywhere?
  • Javascript performance may differ a lot from a platform to another: means slow speed on some device.
  • The time spent improving App/OS integration..cost.
  • No store exist yet... and if it exists.. needs a lot of app that are not native (if not why a user should point to the html5 store?)
  • it is early: maybe in the future will be the best choice. We don't really know if it will be the best and when.. we know is not now.
It also have good points:
  • HTML is a good solution for content rendering: if you need to show rich text, with images as an example.
  • Easy to prototype an app.
and I also don't think to be better than all those nerds engineer at facebook.. so...

Platforms matter
As a personal experience IOS and Android have done a lot in terms of HTML5 integration..and they are continuing to do it but it is not enough, at least for now...for an example in these platform you can't access:
- camera and than shoot photos (for example no QrCode sorry)
- PIM
- Media
- .. many others things
I don't have any experience on Windows Phone platform.. so I can't say more about that.

Damn, I want to make an HTML5 app
You have some choices:
  • if you don't need hardware integration, your app display contents grabbed from a web service.. you can accept UI compromise..performance...and you will package your app inside a WebKit window of a native app.. ok go ahead with your HTML5 app
  • choose a platform with HTML5 capabilities: Firefox Mobile OS and BlackBerry OS 10.
I have saw enough things of Firefox Mobile OS to say it is not ready, not interesting and it is in a evolving state.. and more important.. may have a 0% market impact when you will see a firefox phone.
It's simple early for Firefox Mobile OS. Someone said Tizen? Same story there.

BlackBerry is pushing a lot their new platform BBOS10, but first of all, they are believing in you, as a developer: pushing a lot of support on forums and social network.

They can't make mistakes (who really can?) for the new platform release (2013) and they have a real HTML5 support on BBOS10! Read More here
There is a growing community.. so if you choose to develop for HTML5, it is time to choose BBOS10.