Archive for the ‘Dev’

Meet Fennec, a little brother of Firefox

October 18, 2008 By: admin Category: Firefox, WAP, Nokia, Dev No Comments →

Here comes Fennec!!! (Release note)

It’s been a whole year since Firefox first announced that they were developing for their mobile version, after the not-so-successful Minimo for WinMo, and they finally released this public alpha for Nokia N810, whose default built-in browser is already Mozilla-based MicroB.

Unfortunately neither I or my beloved DeviceAnywhere has N810 device, so I tried the one for Mac OS.
Because this is for N810 WVGA screen, so the browser window is set 800×480 pixel, and support touch screen (so you need flick the screen to navigate). I am wondering how comfortable with the UI on other smaller screen devices, or how non-touch screen UI would look like. (Or are they even planning to support one?)

Anyway, I was playing around and tested some pages quickly:

Fennec Alpha Fennec Alpha
(left) Startup screen, and (right) Yahoo! search.


Fennec Alpha Acid3 Test on Fennec
(L) My twitter home page. Editting was a bit pain because I don’t see a cursor on this emulator. (R) Run Acid3 test. 90/100 is good (better than iPhone Safari but doesn’t beat the latest Webkit which gets perfect score).


Fennec Alpha Fennec Alpha
(L) iCuteOverload. Looks like it supports iUI nicely. I need to take out the “-webkit” prefix to see if border-image works on Fennec. (R) Some tests on event - not seems to support (both results “true” on iPhone Safari)


Anyway, overall I think this is pretty sweet. I am excite to see the battle among Webkit - Apple vs. Google, and vs. Mozilla.Also, if you are lucky enough own N810, try install it on your device!

Another WebKit browser - Chrome by Google

September 04, 2008 By: admin Category: CSS, WebKit, Google, Dev No Comments →

So Google has just released Chrome browser, which Mac user still have to wait for its Mac release. I tried to install on VMWare to see how it is like.

It is a WebKit-based with a brand-new V8 JavaScript engine, which supposed to be much faster than existing JavaScript interpreters. Also, Chrome currently supports almost as much CSS3 that Safari 3 supports.

Actually I haven’t really tested yet (cuz my main machine is a Mac of course, and my Vaio is dead now), but as long as I quickly took a look at the test page I made, some are not working quite right - e.g. text-shadow and box-shadow. Animation and Transform CSS work as expected. (Just like Safari 3.2)

So how about mobile? Current Android browser already uses WebKit engine, so Chrome Mobile will be the future browser for Android?

Yes. According to Sergey Brin, Chrome is going to be available for the platform later.

Chrome on Android
(This is not a real Android UI. I just photoshopped.)

Hug a developer

August 29, 2008 By: admin Category: Dev No Comments →

I hear ya. I feel the pain. Really.

In my case, I was working crazy for CES (deadline = Jan. 7, 08) since around Thanksgiving.
I had no single day off from the time project started. No Thanksgiving, Christmas or New year.
On Dec. 27, I was told to start over the entire code because the architecture needed to be completely re-written. I lost my sanity.
(Even after CES, I was still working on weekends for more trade shows… I didn’t even had a chance to visit any of the fun shows. What kind of a sweat shop I am working at?)

Google announced API for LBS on Mobile

August 26, 2008 By: admin Category: Google, WAP, Dev 1 Comment →

Google launched the Gears Geolocation API for mobile on last week on their official Goolge code blog, and Mobile Blog, with a screenshot of a sample mobile site, Rummble and video demo of lastminute.com of UK.

On mobile devices with Gears installed, Javascript functions grab the cell-ID of nearby cell towers or GPS (if either is available) to improve the postion fix.

The two methods:
getCurrentPosition() makes a single, one-off attempt to get a position fix.
watchPosition() watches the user’s position over time, and updates the position changes.

Also,
lastPosition get an approximate position fix

The bad news is that API is available on Internet Explorer, Firefox and IE Mobile (selected devices only - incl. Samsung Blackjack II, HTC Touch Dual, TyTN, Palm Treo750 etc.) and will be available on Android. I was going to try it with S60, until I read the line on the announcement.

The good news is that they are currently implementing the editor’s draft of the W3C Geolocation specification with Microsoft and Mozilla guys.

More Update on CSS Animation

July 23, 2008 By: admin Category: CSS, WebKit, Dev, iPhone No Comments →

OK, so now I am trying to clarify how to make the css animation works using class name swap.

The conclusion is that it does work! - but you need to apply the -webkit-transition to “destination” class not the “origin” as I first attempted. Thanks for Dave and Dean from Apple, who pointed it out.

Go to The Actual Example Page

HTML Markup used for these examles (from Apple’s doc):

			
<div class="box"
	style="width:100px;
	height:100px;
	background-color:blue;"
	onclick="this.className = 'boxFade'">
Tap to fade
</div>
			
		

What *Not* To Do

This worked on some older WebKit nightly builds, but not on the latest build.

The reason is the -webkit-transition properties into the newClassName definition.

			
/* *** This is a bad example *** */

div.box { /* this applies only to the 'before' transition state */
-webkit-transition-property: opacity;
-webkit-transition-duration: 2s;
}
div.boxFade {
opacity:0;
}
			
		

Click the box. On clicking event, the box’s opacity turns 0 immediately because the transition properties are not set for the “after” state.

What To Do - 1

This is the actual example snippet from Apple’s documentation, Safari CSS Animation Guide for iPhone OS page 13-14.
The reason this example works is that the -webkit-transition properties are defined in a generic <div> tag, not in a specified class that applied only for “before” state.

			
div { /* this applies for both 'before' and 'after' states */
	-webkit-transition-property: opacity;
	-webkit-transition-duration: 2s;
}
div.fadeAway {
	opacity:0;
}
			
		

What To Do - 2

Move all the -webkit-transition properties into the newClassName definition.

			
div.fadeAway { /* give the transition rules to "after" state */
	opacity:0;
	-webkit-transition-property: opacity;
	-webkit-transition-duration: 2s;
}
			
		

Now really a JavaScript-free. Yay.

Update: WebKit CSS Animation

July 22, 2008 By: admin Category: CSS, WebKit, Dev, iPhone 2 Comments →

Regarding to the bug on CSS animation I mentioned on last blog entry, I got a reply from an Apple developer (Quick!)

The issue:
CSS animation doesn’t work with onclick=”this.className=’newClassName’” anymore on the latest WebKit nightly build

I filed the bug on WebKit Bugzilla, and got the answer already. See the ticket.

Basically, this bug was closed (invalid) because they have decided to change the animation implementaion, from “source transition” model to “destination
transition” model.
(Read the whole explanation)

Stay tuned for the new documentation from WebKit or Apple!


UPDATE / CORRECTION (July 23, 08) - please see “More Update on CSS Animation”

WebKit CSS Animation Examples

July 19, 2008 By: admin Category: CSS, WebKit, Dev, iPhone 6 Comments →

According to WebKit.org, the WebKit supports the simplest kind of animation called a transition.

Transitions are specified using the following properties:

  • transition-property - What property should animate, e.g., opacity.
  • transition-duration - How long the transition should last.
  • transition-timing-function - The timing function for the transition (e.g., linear vs. ease-in vs. a custom cubic bezier function).
  • transition - A shorthand for all three properties.

Last week, I’ve noticed that Apple had published some new documentations at Developer Connection, including
Safari CSS Animation Guide for iPhone OS and Safari CSS Transforms Guide for iPhone OS (Go to download page).
Since I read the WebKit.org blog entry last year, I was interested in the CSS animation so I finally decided to give it try.

I spent some time writing several CSS tests, ran on several different WebKit browsers. and my conclusion is that:

  1. the animation and transforms are pretty buggy on current iPhone Safari.
  2. the current WebKit nightly (as of July 19) has some bugs so animation doesn’t work when swapping class names
  3. with oncick event handler attributes like, using this.className='newClassName'.

The className swap was working perfectly, until I installed the newer build, r35231.
I will file the bug to Webit.org soon.

On latest build, build r35075 - r35231 (the newest one I tested),
changing the values of style object properties, instead, as
onclick="this.style.opacity='0'"

I wanted to create the animation entirely absent of JavaScript, but now I need to use a function to handle multiple style properties…


UPDATE / CORRECTION (July 23, 08) - please see “More Update on CSS Animation”

I still haven’t gotten a chance to try iPhone 3G yet, and I tested only on my old iPhone with the latest upgrade.
Are there any differences in between two Safaris? I doubt it.

Anyway, Open the test page I wrote in a new window!

Animate Opacity

Opacity Transition Test

Expected result: When a user mouse-overs the box, an object appears smoothly (opacity=.5) in 2 sec.
On mouse-click, the image fades in completely (opacity=1).

	
.box1 img{
	opacity: 0;
	-webkit-transition: opacity 2s ease-out;   /* shorthand for all three properties */
}
.box1 img:hover {
	opacity: .8;
}
	
	
<div class="box1">
	<img src="images/apple.png"/>
</div>
	

Animate Position - Move to right

Position Transition Test

Expected result: the image moves to the right as fading out.

	
.box2{
	opacity: 1;
  	-webkit-transition-property: opacity, left;
	-webkit-transition-duration: 1s, 1.5s;
	transition-timing-function: ease-in;
}
	
	
<div class="box2" onclick="this.style.opacity='0'; this.style.position='relative'; this.style.left='500px'">
	<img src="images/apple.png"/>
</div>
	

Animate Letters - Letter-Spacing

Letter-Spacing Test

Expected result: When the text is clicked, each letter spaces out as fading away.

It is pretty cumbersome to handle multiple style properties with onclick, so I added a JavaScript function to take care:

	
function switchStyles(style,obj) {
	for(var prop in obj)
		style[prop] = obj[prop];
}
	


UPDATE / CORRECTION (July 23, 08) - You don’t need this hassle with JS. Please see “More Update on CSS Animation”

	
.box3{
	color: green;
	opacity: 1;
  	-webkit-transition-property: opacity, letter-spacing;
	-webkit-transition-duration: 1.5s, 2s;
	transition-timing-function: ease-out, linear;
}
	
	
<div class="box3"
     onclick="switchStyles(this.style,{
	    color : 'lime',
	    opacity : '0',
	    letterSpacing : '3em'
});">
	some text to be clicked here.
</div>
	

Transform - Click to spin the image and fade away

Position Transition Test

Expected result: the image rotates twice (360 deg x 2) around the Z axis, as fading.

	
.box4{
  	-webkit-transition-property: -webkit-transform, opacity;
	-webkit-transition-duration: 2s;
	transition-timing-function: cubic-bezier(0.42, 0, 0.58, 1.0); /* equivalent to ease-in-out */
}
	
	
<div class="box4"
	 onclick="switchStyles(this.style,{
	    webkitTransform: 'rotate(720deg) translate(1000px,0px)',
		opacity: '0'
});">
	<img src="images/apple.png"/>
</div>
	

Also, I tried CSS gradients. These still don’t seem to work on iPhone but worked on all recent WebKit nightly.

CSS Gradients - Linear and Radial

Gradients Test

Expected results:
Linear - Green to white top-to-bottom linear gradient
Radial - White to pink center-to-outer radial gradient
Actual results:
Nicely working on WbKit nightly builds. Failed miserably on both Mac desktop and iPhone Safari 3.1.

Screenshot of the results on WebKit nightly


The syntax is as follows:
-webkit-gradient(<type>, <point> [, <radius>]?, <point> [, <radius>]? [, <stop>]*)

	
#gradientLinear{
	float: left;
	width: 180px;
	height: 180px;
	border: 1px solid #11276c;
	background:
		-webkit-gradient(linear, left top, left bottom, from(rgba(158,192,0,.85)), color-stop(1, #fff));
}

#gradientRadial{
	float: left;
	margin-left: .5em;
	width: 180px;
	height: 180px;
	border: 1px solid #11276c;
	background:
		-webkit-gradient(radial, center center, 3, 80 80, 100, from(rgb(255,255,255)), to(rgba(228,56,132,.85)), color-stop(0%,#fff));
}
	


Resources:

  1. Surfin’ Safari - CSS Animation
  2. Surfin’ Safari - Introducing CSS Gradients
  3. Safari CSS Animation Guide for iPhone OS
  4. Safari CSS Transform Guide for iPhone OS

Y!Go Can Has Cheezburger?

June 04, 2008 By: admin Category: Yahoo!, Dev, iPhone No Comments →

Lolcat on Y!Go

Last time I made CuteOverload into Apple iPhone WebApp, “iCuteOverload“, so this time I made I Can Has Cheesburger? into Yahoo!Go mobile widget.

Try it on Yahoo! Go client, or open up an web browser in your mobile device and go to http://beta.m.yahoo.com, login, go to “widget” by clicking the icon looks like a tool on top and add “I Can Has Cheezburger?”. Works on iPhone at the URL too!

Dev.mobi Event at Palo Alto

May 31, 2008 By: admin Category: dotMobi, Event, WAP, Dev No Comments →

dev.mobi 

Today, I had a chance to attend dev.mobi developers’ session at Palo Alto.

I am actually a user of their web tools and documentations, and really like the way they are trying to set standard for developers.

In today’s session, I was able to find out more about their ongoing projects. Paul Nerger of dotMobi, explained the interesting new product from them is called Device Atlas. This is a comprehensive database of mobile device information, such as hardware info, OS, browser. supported graphic format etc., with easy-to-follow GUI. The first version was just released a few months ago and they are now working on new features such as integrations with Ready.mobi test suite, W3C checker Firefox plugin, providing analytics and competitive benchmarking.

One of the biggest pain for me to work on mobile web is a cross-browser issue. Surely there’re thousands of mobile devices means thousands of different browsers. I already appreciate for the OMA and WURFL for the data, so with more partners like Nokia, Vodafone, Volantis etc. Device Atlas seems to be so promising fore more accurate info.The data is available as json files. So for example, to get the screen resolution of a certain device, get the UA and simply call its json data.

By the way, just like me, Paul doesn’t like the term “WAP”. I do use the term to distinguish it from desktop web, but I always felt some sort of awkwardness to say it. Yeah, WAP rhymes with crap, right Paul!

Opera Lanches Widget SDK

May 21, 2008 By: admin Category: Opera, SDK, Google, Nokia, Dev, iPhone 2 Comments →

Today, Opera launched Widget SDK, enabling web developers to deploy web apps on desktop, TV and mobile devices. Unlike Apple’s iPhone $99 SDK, it is free of charge.

Watch the step-by-step instruction video:

More Mobile App/Widget SDKs: