CodeIgniter Forums
Identifying Android devices - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Identifying Android devices (/showthread.php?tid=42405)



Identifying Android devices - El Forum - 06-06-2011

[eluser]russ_kern[/eluser]
Is Identifying an android device as simple as adding

'android' => 'Android'

to my user-agent.php platforms array? or is something more specific required (like adding a version# as in 'android 2.2' => 'Android')?

Additionally, it would be preferable to distinguish between "Android" and "Android Mobile".

I am hoping to go through most of the current touch devices this way that are supported by Jquery Mobile.

IS there anyone that can point out if I'm on the right track or anyone that has done this already?

Help is much appreciated.

R


Identifying Android devices - El Forum - 06-06-2011

[eluser]KarlBallard[/eluser]
http://pastebin.com/yYm8Cxds

I've added a few things to my user agents file.

Added
- Windows 7
- Playstation 3
- Nintendo Wii
- Ubuntu
- RockMelt
- Amazon Kindle
- Android
- Windows Phone
- Fennec
- Minimo

Edited
- iPod needed to be above iPhone else it would have been recognized as iPhone


Identifying Android devices - El Forum - 06-07-2011

[eluser]russ_kern[/eluser]
Thats great info... thank you... anything you could provide would be appreciated...

Do you know how you would distinguish between Android Mobile and large format devices as well as Blackberry v.5 & 6 Touch devices?

The whole version thing is a bit fuzzy to me... would something as simple as

'blackberry 6.0' =>'Blackberry" ?

Thanks for your help.


Identifying Android devices - El Forum - 06-07-2011

[eluser]russ_kern[/eluser]
Alright... sorry for all the questions, but I'm really interested (read as 'obsessed') in understanding this....

it is easy to find all over the web information about devices such as :

"The format of the User Agent used by BlackBerry® 6 and BlackBerry® 7 is similar to the following:
Mozilla/5.0 (BlackBerry; U; BlackBerry AAAA; en-US) AppleWebKit/534.11+ (KHTML, like Gecko) Version/X.X.X.X Mobile Safari/534.11+"

What are the important bits to add to the user_agents file?

I assume that the Blackberry mention is already in the file, but would you add:

'blackberry aaaa' => "BlackBerry AAAA" as varients?

Also, it seems like a person could detect "AppleWebKit" and use it to direct Touch devices... but where would you add that in the user_agents.php file?

R


Identifying Android devices - El Forum - 06-07-2011

[eluser]KarlBallard[/eluser]
[quote author="russ_kern" date="1307464429"]Thats great info... thank you... anything you could provide would be appreciated...

Do you know how you would distinguish between Android Mobile and large format devices as well as Blackberry v.5 & 6 Touch devices?

The whole version thing is a bit fuzzy to me... would something as simple as

'blackberry 6.0' =>'Blackberry" ?

Thanks for your help.[/quote]

If you could give me user agent string examples of Android and the mobile version, I could be able to help.


Identifying Android devices - El Forum - 06-07-2011

[eluser]russ_kern[/eluser]
As I understand it (acccording to googledata.org) these 2 basic strings differentiate between large format (tablet) devices and handhelds.

Mozilla/5.0 (Linux; U; Android 2.2.1; en-us; Nexus One Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1


Mozilla/5.0 (Linux; U; Android 2.2.1; en-us; device Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Safari/533.1

The distinguishing point is "Mobile Safari" vs. just "Safari"

in the second example the word "device" would be replaced with the actual device it is running on.

R


Identifying Android devices - El Forum - 06-08-2012

[eluser]skunkbad[/eluser]
I had somebody call me today and say they were trying to access the site from their Android phone, and CI wasn't detecting them as mobile. I'm using CI2.1.0.