Page 1 of 1

how to include mobile functionality to my website

Posted: Fri Feb 04, 2011 4:30 am
by mehran
hello every body!
i have my term project on busines system,
i want to include the mobile functionalty to my side,
from where i start work,i completely dont know any thing about it,please help me and guide me how to work on it
thnak you

Re: how to include mobile functionality to my website

Posted: Fri Feb 04, 2011 10:14 am
by social_experiment
A point to take note of is if a user will be able to view your site on their mobile device. If you get that right functionality shouldn't be a problem because the mobile's browser can handle many things that your pc browser can (html forms for example).

Re: how to include mobile functionality to my website

Posted: Fri Feb 04, 2011 11:20 am
by Domsore
Detect if its a mobile device either using CSS (@media handheld) - http://webdesign.about.com/od/css/qt/tipcssmedia.htm OR php something like:

Code: Select all

 <? if (
 stristr($ua, "Windows CE") or
 stristr($ua, "AvantGo") or
 stristr($ua,"Mazingo") or
 stristr($ua, "Mobile") or
 stristr($ua, "T68") or
 stristr($ua,"Syncalot") or
 stristr($ua, "Blazer") ) {
 $DEVICE_TYPE="MOBILE";
 }
 if (isset($DEVICE_TYPE) and $DEVICE_TYPE=="MOBILE") {
 $location='mobile/index.php';
 header ('Location: '.$location);
 exit;
 }
 ?> 
The issue with the php way is that there are/could be many many more user agents. I would suggest the CSS method.

Bare in mind you will more it to be much more lightweight.

There's my input.. hope it helps :)

Re: how to include mobile functionality to my website

Posted: Fri Feb 04, 2011 11:22 am
by John Cartwright
Take a look at php-mobile-detect which is designed to detect mobile browser user agents.

See http://code.google.com/p/php-mobile-detect/

Re: how to include mobile functionality to my website

Posted: Fri Feb 04, 2011 11:24 am
by Domsore
Darn John... you always have a better solution.

Re: how to include mobile functionality to my website

Posted: Fri Feb 04, 2011 11:48 am
by josh
http://tinysrc.net/

Zend Framework just added built in support, pretty cool. The only thing I can think of that you'd need to do is scale down images for "dumb phones" (non-smart phones, lol). Tiny SRC can do that. Droids/iphones can browse the full size page just fine, since they have zoom support.

The only other thing to be aware of besides that is iphone doesn't run flash, only droid. Both iphone & droid run javascript (jquery, etc.) but most other phones will not.

I prefer to use the CSS method, or just have the page use such lightweight graphics in the first place that it just runs on the phone natively in the first place. Most people with older type phones (non droid/iphone) won't browse the web very often anyways IMO.