Archive for General

Introduction to Mobile Development



 

 

Comments Bookmark to delicious Digg this Technorati reddit 

Mobile browser sniffing and Screen Orientation detection

Viewport Meta Tag:

You can use the following meta tag which will give a fluid width to the web application. So even if you change the screen orientation it will resize automatically. Works on iPhone and Android, not sure about other devices.

<meta name="viewport" content="width=device-width">

 

Javascript Browser Sniffing:

You can detect a device by sniffing the User Agent string. However it does not work 100% for an iPad because it has ‘iPhone’ string in the User Agent. List of all User Agents by device

You should instead check the navigator.platform Javascript property which will always give the accurate device information.

function isIPad(){
return (navigator.platform.indexOf("iPad") != -1);
}

function isAndroid(){
return (navigator.platform.indexOf("Android") != -1);
}

 

Screen Orientation:

You can use CSS media queries to determine if the device is being held in vertical or horizontal orientation such as:

<link rel="stylesheet" media="all and (orientation:portrait)" href="portrait.css">
<link rel="stylesheet" media="all and (orientation:landscape)" href="landscape.css">;

OR

if you want to target styles for specific devices:

## iPad
<link href="ipad.css" rel="stylesheet" media="only screen and (min-device-width: 768px) and (max-device-width: 1024px)" type="text/css" />

## iPhone 3GS
<link href="iphone.css" rel="stylesheet" media="only screen and  (max-device-width: 480px)" type="text/css" />

## iPhone 4
<link href="retnia.css" rel="stylesheet" media="only screen and (-webkit-min-device-pixel-ratio: 2) and (max-device-width: 480px)" type="text/css" />

 

Mobile Device Feature Detection:

Rather than detecting the current user agent and alter the page presentation based on which browser is running, it is a good practice to perform feature detection. This means that prior to executing code which relies on a browser feature, we test to ensure that the feature works properly.

Following are a few resources that explain how feature detection works:

  1. Feature Detection: State of the Art Browser Scripting
  2. Browser Detection (and What to Do Instead)
  3. Common feature tests

 

 

Comments Bookmark to delicious Digg this Technorati reddit 

Inspirational Presentations

Jack Dorsey on Making Ideas Happen:

Seth Godin: Quieting the Lizard Brain:

Threadless: The Do-First Work Ethic:

Comments Bookmark to delicious Digg this Technorati reddit 

What are your tips on moving to Houston, TX?

My company is relocating me to Houston, TX. I have never been to Houston before so any advice you can give me would be greatly appreciated!

Any suggestions on where to live and how I can go about finding a 3 bedroom house or which schools (high/middle) are good around Houston would be greatly appreciated.

Comments Bookmark to delicious Digg this Technorati reddit 

Got me an iPhone

A bit late to the party but I finally got me an iPhone a couple of days ago and am really enjoying it. Here are a couple of Apps I have installed so far:

I have installed the WPtouch WordPress plugin  which transforms this blog into an iPhone application-like experience when viewed from an iPhone or iPod touch.

Comments (2) Bookmark to delicious Digg this Technorati reddit 

Does your site need a survey?

Have you ever wondered why your site does not have a high conversion rate even though you have a good amount of traffic? The quickest way to fix the problem is by surveying your users. Here is a great post by Avinash Kaushik on how you can easily implement a short website survey to ask your users and gain a wealth of insight. Easy to implement and highly effective.

Comments Bookmark to delicious Digg this Technorati reddit 

Next Page »