Thursday, August 1, 2013

Some of the tip to create responsive website

1. Detect whether mobile or laptop & redirect using PHP & Apache you can do this i will post an article regarding this

2. Use percentages in CSS so that it allows to grow & shrink your webpage.

3.Creating flexible images & grids for mobile & laptop device.

4.Module for creating some flexible image.
  • Adaptive Image
  • Responsive images and styles
  • Client-side adaptive image
  • CSS Embedded Images

5.Use of CSS media queries

6.Use of Drupal theme which adapt responsive design
  • Omega
  • Zen
  • AdaptiveTheme
  • Terrain
7.Useful module for mobile development
  • Domain Access
  • MobileKey
  • ThemeKey
  • Mobiletools

8.Add view port meta tags for apple adjust feature

How to detect a mobile device using php ?

$useragents = array ( 
'Blazer' ,
'Palm' ,
'Handspring' ,
'Nokia' ,
'Kyocera',
'Samsung' ,
'Motorola' ,
'Smartphone', 
'Windows CE' ,
'Blackberry' ,
'WAP' ,
'SonyEricsson',
'PlayStation Portable', 
'LG', 
'MMP',
'OPWV',
'Symbian',
'EPOC',
); 

if(in_array($_SERVER['HTTP_USER_AGENT'], $useragents)){
  echo "It is mobile device";
}else{
  echo "It is not mobile device";
}