Experimenting in ...

Other stuff...This page has my experiments with stuff not concerning html5 and css3. enjoy!


Opera Unite

Opera Unite turns your web browser into a web server. You can write your own Unite applications using server side Javascript, and normal html, css and JS on the client side. I recently made my own Unite application called 'The Task Manager'. I wrote some thoughts on how to make Opera Unite applications which I posted on the ODIN Blog. I've also written a Dev Opera article on using the new Libraries with Yusef. Read it over here.

W3C Geolocation API

The W3C Geolocation API makes it possible to accurately determine the user's position on the globe. I wrote a bunch of very quick and dirty demos for it, which are below. I just used the navigator.geolocation.getCurrentPosition() function. For most purposes, thats enough....As I see it, the main use it not really the fact that you have this api, but the fact that once you get reliable coordinates of the user, you can mix it up with various other web service APIs and create some cool mashups. For a website, this makes sense as geolocation can provide the user with a much more personalized experience.

These demos so far only work in Firefox 3.5 and Opera 10's Experimental labs build which supports the W3C Geolocation API.

Example 1: Google map demo - Gets your coordinates and displays a google map of your city.

Example 2: Twitter, Google map and Meetup mashup - Gets your coordinates and displays a google map of your location, along with the most recent tweets related to your location and also a list of events happening near your location in the next few days.

Web Storage

Web Storage was introduced as a much more robust way of storing user data than cookies. Right now Web Storage is just a draft, but has already been implemented by a few browsers. Namely, Safari, Chrome and Opera have it. It has two main categories. 'Session Storage' is for temporary data which is going to erased once the user closes the page. 'Local Storage' is for data which should reside for more amount of time, and hence, will not go away once the page closes. It will stay there unless the application explicitly clears it.

I've made a demo of Web Storage with Session and Local storage

Web (SQL) Database Storage (A.K.A WebDB)

The Web SQL Database Storage Specification defines an API to query and store data in an actual database using an SQLite like database. Right now browsers which have implemented this, have indeed used an SQLite backend to do it. Which means that the SQL specific to SQLite will be used to do all transactions. However, scope is there to later define a specific SQL for this purpose so that it is not dependent on SQLite itself.

What I have noticed by coding in it is that its better and easier to write specific functions for specific transactions, rather than defining them inside other functions. That will also make the code easier to understand and maintain. For example, have one function for adding data, another function for removing, another for querying, etc. Its better to do it this way rather than defining it within the main function.

I've made a demo of Web SQL Database storage.

getUserMedia and Device Orientation

getUserMedia is all about accessing the device's media features, like the camera, microphone etc. Device Orientation is about accessing the orientation of the device (think gyroscope). Together you can do some very cool stuff. Check out my post on getUserMedia and Device Orientation on the ODIN blog. It has links to my initial demos too. Make sure to use the Labs build of Opera Mobile which actually supoorts these things. So far, these will only work on that build.