Browsing articles in "Palm"
Oct
26

Creating Usable Enyo UI – Buttons and Interactive Dialogs

By admin  //  App, Design, Palm, UI/UX  //  1 Comment

I wrote this article, Creating Usable UI—Buttons and Interactive Dialogs, for Palm webOS Developer Portal. I walk through the Enyo button setup, the proper use of color and text, and how best to use buttons in intuitive, consistent user dialogs.

This is written for the webOS’s very own enyo.js framework, however, the major contents should apply to any web and app development so please take a look!

Thanks!

p.s. In case you don’t know – I am a developer relations engineer at Palm (acquired by Hewlett-Packard). As you may know, the best-yet-most-unfortunated mobile-platform, webOS’s future is unknown in this moment…

Jul
29

Five CSS tricks used in Enyo JS Framework, and you can try them too!

By admin  //  CSS, Dev, Palm, WebKit  //  6 Comments

Since I have joined Palm (now HP), I don’t blog frequently because working for the webOS have kept me super busy. Especially when working on the webOS 3.0 for the Touchpad tablet, I have been in multiple teams until I switched my position to commit for the Developer Relations team.

Anyway, in case you are not familiar with webOS and Enyo – webOS is a mobile platform running on Linux kernel/ webkit UI with V8 engine, so most of core apps are either written in JS and CSS, or native C/C++. And the JS framework for 3.0 is called Enyo. Basically working on the webOS framework and apps is just like developing web (in fact, I use Chrome for development). So here, I want to share some cool CSS tracks used in the framework!

1. Flexible Box Model

Enyo’s basic UI is created with using the CSS3 flexible box model.
You no longer have to worry about all the float craziness. I actually have written an article, CSS 3 Flexible Box Model and Enyo Flex Layout for webOS Developer Blog too, so please read it too!

Example:

When you want to achieve a layout that has an avatar at the left, and two lines of a person’s info at the right side like this,

flex box demo

You can create this UI without float if the browser support flex-box:

<div class="tweet">
  <div class="tweet-avatar"><img src="avatar.png"></div>
  <div class="tweet-contents">
    <div class="tweet-username">@n00b_css3_user</div>
    <div class="tweet-text">Hello, world. CSS3 Flexbox is cool.</div>
  </div>
</div>
.tweet {
  display: -webkit-box;
  -webkit-box-orient: horizontal;
}

.tweet-contents {
  margin-left: .5em;
  display: -webkit-box;
  -webkit-box-flex: 1;
  -webkit-box-orient: vertical;
  -webkit-box-pack: center;
}

Note: this is an original spec from 2009 and this is what browsers currently support (if they do), and likely to keep supporting. I have no idea why the spec has been completely re-written recently, but so far no browsers support the new specs.

2. Root Em

There is a new unit in CSS, rem unit, which stands for “root em”. The sizing only with em could be troublesome because how it relates to the parent’s font-size. However, the rem is relative to the root, which is html.
In Enyo framework, the root font size is set to 20px. So by using rem, you can set its children font-size easily without being affected by their parents.

Here’s a comparison of em and rem:

<div class="container">
  <p class="subdue">48 minutes ago</p>
</div>

With em

html {font-size: 20px;}
.container {font-size: .8em}
.subdue {font-size: .75em} /* the font size = 12px (20 x .8 x .75) */

With rem

html {font-size: 20px;}
.container {font-size: .8em}
.subdue {font-size: .75rem} /* the font size = 15px (20 x .75) */

3. Pointer-events

This is a little obscure and simple trick not everybody has known, and a secret(?) trick I have been using since the earlier webOS framework called Mojo.
The pointer-events property was originally defined for SVG content, and later adopted as a CSS property.
For CSS, there are only two values: auto or none.
You can control the target of the mouth event, and by setting this value none, the element is no longer a target of mouse events, so when a user click the element, it pass through to its descendant during the event bubbling.

<div style="position:relative">
  <div class="overlay"></div>
  <ul>
    <li><a href="">link 1 on fading list</a></li>
    <li><a href="">link 2 on fading list</a></li>
    <li><a href="">link 3 on fading list</a></li>
  </ul>
<div>
.overlay {
  pointer-events: none;
}

The screenshots at left indicates that when the pointer-events property value is not set (default), the first link underneath of the visual overlay is not clickable, and when it is set none, the element becomes clickable (right).

pointer-events demo

The demo: http://jsfiddle.net/girlie_mac/7TvVY/

4. border-image with sprites

You have seen some demos how to use the CSS3 border-image.
But making multiple assets used for border-image is trivial because how an image needs to be “sliced” into 9 tiles with css.
However, if an each asset in the sprites only requires into 3 tiles. (For example, [static-left] [stretchable center] [static-right], and top and bottom borders are zero, you can create a single sprite image of multiple states of a button, and still be able to achieve the border-image.

.alert-button {
  /* notice the fat border-bottom */
  -webkit-border-image: url(images/alert-button.png) 0 14 111 14 repeat repeat;

  /* notice that border-top and bottom are set zero */
  border-width: 0 14px;

  /* some visual styling here */
  -webkit-box-sizing: border-box;
  height: 37px;
  line-height: 37px;
}

.alert-button:active {
  /* the fat border-top and bottom adjusted */
  -webkit-border-image: url(images/alert-button.png) 37 14 74 14 repeat repeat;
}

border-image demo

The demo: http://jsfiddle.net/girlie_mac/89C2T/

5. Hardware acceleration

WebKit enables hardware-acceleration to render CSS 3D transforms. Although some WebKit (like webOS) may not render 3D visuals correctly, it still uses the GPU to speed up. So all you need to take advantage of this is to use the -webkit-transform CSS property!
The easiest possible way to achieve it is using translate3d instead of translate (also scale3d instead of scale), although you are not intend to make your web in 3D visual effect.

.toaster {
  -webkit-transform: translate3d(0,0,0);
}

or just set only the z-axis:

.toaster {
  -webkit-transform: translateZ(0);
}


I hope some of the stuff I just wrote are new to you!
There are more fun stuff I can write about Enyo JS framework, but I keep them for the official HP webOS Dev Blog!

Bye now!

Jul
19

Open Web Camp III

owc-logo

I had this wonderful opportunity to speak at OpenWebCamp III at Stanford University on this weekend, and I feel very honor to be there with so many great speakers and attendees.

Apparently, I have been doing mobile development longer than most of people, I picked the subject on developing mobile web, and how it has been changed and what we can do next.

I covered the topics including:

  • How the mobile development has changed from WML, XHTML-MP, HTML4 and finally HTML5 with CSS3
  • Legacy to HTML5: using input attributes to make easier for a user to type on phone
  • Dealing with smarter phones: Viewport and Media-queries
  • High DPI display: CSS pixel != Device pixel
  • Device API

My slides, “WAP to HTML5: Mobile web – past, present, and future” is available in html5, not Powepoint or Keynotes so I couldn’t post it on SlideShare!

Feb
15

So it’s not a secret anymore -HP TouchPad

By admin  //  Event, Palm, Uncategorized  //  2 Comments

Jon Rubinstein

So, this is what has been keeping me busy (not blogging) these days. Announcing HP TouchPad!

I have been working as a part of the development team for the secret weapon, which was just announced at the HP’s press event at Fort Mason, San Francisco on Feb. 9th, for a while (especially hardware development take a lot longer than software!). Literally, my heart was beating during the live demo but when the crowd applauded, I felt great and so relieved.

At the evening’s developer event after the press event, we have announced the new and better JavaScript framework, Enyo. I probably write up something on HP/Palm’s developer blog later (yes, the site still has the Palm brand!), so stay tuned if you’re interested developing for webOS!

The photo is by HP Startup Central, on Flickr

Jul
7

Google Docs Palm Pre Stencil

By admin  //  Design, Google, Palm, UI/UX  //  1 Comment

Google Docs Pre Stencil screen

A few month ago, after I was saw the impressive web wireframes templates and iPhone stencil created with Google Docs by Morten Just, on Docs blog, I started playing with this Google’s new addition to the Docs family, Drawing, to copycat this idea and made a Palm Pre stencil.

So here you go! You can check out my Palm Pre stencil on Google Docs.
If you’d like to have your own copy, sign in your google account, then:
Choose file > make a copy

You can drag or copy the UI widgets to the white canvas (printable area). To edit text, you need to ungroup the object first, by selecting the UI widget to be editted and go to Format > Ungroup (you may need to repeat ungrouping grouped objects) then double-click the text to edit.

Also, I labeled each UI objects to match the Mojo UI Widget names so developers can reference the stencil and code easily!

Dec
9

Hello, Palm! I am back to Sunnyvale!

By admin  //  GirlieMac! News, Palm  //  8 Comments

Palm logo
Since the last CES announcement, I have been pretty excited to learn about Palm’s WebOS, been to the meetup and DevCamp, and have created 2 homebrews and co-wrote Net2Streams app.

Now I have joined the human interface team at Palm, inc. It’s awesome I can work with a shiny new toys (Pre and Pixi), also I am happy to keep working on WebKit!
(Plus, it’s cool I constantly bump into my ex-colleagues and friends from Yahoo! in the area!)

Sep
22

Classification of Mobile Browsers

Today, I am not going to post some CSS3 tricks on Webkit, or stuff like that. Instead, I post a list mobile browsers, since I am often asked about mobile / WAP browsers by engineers, product managers, and mobile-curious or mobile-newbie people.

I gathered 30+ major browsers I have worked with (plus a few I have never even seen), and categorize by the markup that browsers can render – WML, CHTML, XHTML-MP, and HTML4.

So, here you go. If you find some mistakes, let me know!

WML Browsers (WAP 1.x)
Openwave earliy browsers 4.x  
Early Nokia browser  
Early Obigo browser  
CHTML Browsers (Common in Japan)
CHTML browsers Compact-HTML browsers
Compact NetFront
i-mode browsers (CHTML / XHTML) NTT Docomo
XHTML Browsers (WAP 2.x – XHTML-MP / WML)
WebKit Nokia S40
Nokia S60 – earlier versions, or “Services” browser
NetFront by Access Palm Blazer 3.x -
Sony Ericsson WAP browser
Blazer by Handspring original browsers before accured by Palm
Openwave 6.x Siemens
Sharp
Sanyo
Motorola
Toshiba
Blackberry by RIM Blackberry browser- earlier version ~4.3? (*)
Obigo by Teleca
Polaris by InfraWare
Helio
Motorola MIB
HTML Browsers
WebKit Nokia S60 3rd gen., “Web” Mini-map browser
Apple Mobile Safari
Google Android
Palm WebOS
Iris, by Torch Mobile (now RIM)
Bitstream Bolt (Proxy)
MOTOMAGX (Motorola Linux devices)
Gecko Mozilla Minimo (dead?)
Mozilla Fennec
Maemo (aka MicroB)
Skyfire
Opera (proxy) Opera Mobile
Opera Mini
Nintendo DSi
Nintendo Wii
Blackberry by RIM Blackberry browser ver.4.6+ (I am not sure about 4.4 and 4.5)
Microsoft Internet Explorer (was Microsoft Pocket IE) (earlier versions do not support CSS?)
NetFront 3.x ? Sony Ericsson browsers
Sony PlayStation / PSP browsers
Palm Blazer 4.x
Amazon Kindle
Teleca Teleca Browser V3.x ? (LG Voyager)
Danger (now by Microsoft) Sidekick

I have categorized only with the markup type, and did not sub-categorize these browsers. However, if I would, I may want to grade XHTML-MP devices with page memory size (=”deck size”, yes I said deck size), and screen resolution for UI design purpose.

To grade full-HTML browsers, you need to spend massive time and effort on testing rendering capability with CSS, and Javascript DOM compatibility, events, etc. Actually, PPK has done excellent work on mobile browser testing, so you can simply visit Quirksmode.org!

Aug
29

PREtty Cute Suite -Another Cute app for Pre from me!

Can’t have enough cute!
Instead of upgrading my previous app, iCuteOverload for Palm, I have created this power-up version of cute app called, PREtty Cute Suite.

This app is more offensively and obnoxiously cute with more cute-related rss feed and flickr pics.
Included feeds are:

  1. Cute Overload
  2. I Can Has Cheezburger
  3. Cute Obssesion
  4. Epicute
  5. Super Cute Kawaii
  6. Cupcakes Take Tha Cake

Also, a bunch of cute picture streams from Flickr.


This app allows you to save the pix/feeds you like as your favorites, also share the links via email.

Currently available as a “Homebew” app on PreCentral.net for free.
I have no plan to submit this to the Palm official app store in this moment, at least for this version 0.9.

Aug
11

My First WebOS App – iCuteOverload for Palm v1.0

As a front-end web developer, also a mobile-web developer, the Palm’s new WebOS SDK for Pre sounds very attractive, and I could not wait to create some applications although I am still a iPhone user and haven’t been convinced to switch a service provider.

Then I felt like, I already got this web app, iCuteoverload for iPhone but yeah why not for Pre? So I decide to re-create the same app from scratch. Sure, the existing app is a web app that wrote with JavaScript framework iUI and PHP, does run fine on Pre’s web browser since Pre is based on Webkit browser. However, I wanted to make this app a standalone client with Mojo framework so I needed to code from scratch.

Anyway, here it is, iCO for Palm is now available at PreCentral. The official store is not yet open, so the installing the app may require a bit of geeky skills, but if you happen to be a Pre user and would like to try, follow this tutorial on how to install homebrew apps on Pre for Mac users (And this is for Windows users instruction).

By the way, I keep this app name begins with i, because I already have named so for iPhone and wanted to keep it for consistency. However, in Pre community, this seems to be a pretty bad thing to do. People see me as a clueless Apple fan :-(

Jul
16

Finally, the official Mojo SDK for all!

By admin  //  Dev, Palm, SDK, WebKit  //  1 Comment

After I was rejected for the early access then struggled with the “leaked” version of Palm Mojo SDK without a documentation, today Palm finally made the official SDK available for all!!!

I haven’t playing around with it long enough to blog much about it, so I just post my “cheat sheet” that I keep on Stickies.

Emulator Key for Mac

  • Esc – acts as “Back”
  • Left / Right arrows – Switch between applications

Emulator Navigation

“Host” = Right Ctrl in Virtual Box

  • Host + F – Toggle full screen view on/off
  • Host + N – Display session info
  • Host + S – Take a snapshot (will be placed the Snapshot tab of VirtualBox)
  • Host + Q – Close the emulator

Commands

Create a package (.ipk file)

$ cd palm-package myapp

Install the .ipk file on emulator

$ palm-install com.yourdomain.app.myapp_1.0.0_all.ipk

Launch the app on emulator

$ palm-launch com.yourdomain.app.myapp

Launch the inspector with the app

$ palm-launch -i com.yourdomain.app.myapp

Then, open Palm Inspector app (comes with SDK) from your Application by double-clicking the icon. This should open the Safari inspector.