Welcome Guest, Not a member yet? Register   Sign In
How to develop an application to Mobile Devices Browsers and Laptop Browsers?
#1

[eluser]Sinclair[/eluser]
Hi,

I need to develop an website that is compatible with mobile browsers like Internet Explorer Mobile and regular browsers.

What sould be the strategy? Auto-recognize the browser and redirect to the "Mobile view" or the "Regular view". What should be the approach to this problem?

Best Regards
#2

[eluser]pistolPete[/eluser]
You could use a hook and redirect the users based on the user agent library:
Code:
if($this->agent->is_mobile())
{
    ...
}
Alternatively, redirect the users using a .htaccess file: http://ohryan.ca/blog/2007/10/29/htacces...-redirect/

You should also search the forum for "mobile", there are already some threads.
#3

[eluser]Sinclair[/eluser]
Hi! Thks for your reply.

I have one question. I don't unserstand why I need to use an "hook". Can you give me a clue?

Best Regards.
#4

[eluser]pistolPete[/eluser]
You don't need to use a hook specifically, but you should make sure the is_mobile() check takes place before anything else; this can be achieved using a pre_system hook.
#5

[eluser]BrianDHall[/eluser]
I've noticed that most big companies say 'screw it' with auto-detection and instead just use custom tailored websites. So you get things like mobile.yahoo.com, or google.com/m, etc. They seem to have found that trying to do it magically is tragically hit or miss, so it is just easier to have a dedicated website to special devices - and then sometimes they can try to do auto-redirection based on user agent and such, but for whatever most companies seem to have found it is just preferable to let the user tell you what they want instead of trying to guess.
#6

[eluser]Sinclair[/eluser]
Hi,

And it is possible to have in the same environment the two versions of the website?

The main website: www.example.com
and
The mobile website: mobile.example.com

Witch is the best way to do this in CodeIgniter?


Best Regards.




Theme © iAndrew 2016 - Forum software by © MyBB