dotMobimobiThinkingmobiForgemobiReadyDeviceAtlasgoMobi

Posted by martenmobi 1 year 15 weeks ago

pic
 martenmobi
Mobile Addict
Posts: 2
Joined: 1 year ago
[offline]

Dear Sirs,

On running

$displayWidth = Mobi_Mtld_DA_Api::getProperty($tree, $ua, 'displayWidth');

I get:

Quote:
The property "displayWith" is invalid for the User Agent:"Mozilla/5.0(Linux; U; Android 2.1-update1 nl-nl GT-I5800 Build/ECLAIR)AppleWebKit/530.17 (KHTML, Like Gecko) Version/4.0 Mobile Safari/530.17"

The code Mobi_Mtld_DA_Api::getProperty($tree, $ua, '...') does correctly return some properties, but I really need the displayWidth/Height properties to work.

Any clues, please?
thanks/regards
Marten

Posted by garbetjie 1 year ago

pic
 garbetjie
Mobile Guru
Posts: 70
Joined: 3 years ago
[offline]

If I'm reading the source code correctly, this is the exception that is thrown when the requested property is not found for the supplied User-Agent.

Basically, it's saying that Device Atlas doesn't have the property for the specified device that you're looking for.

A good thing to do would be to visit http://ta-da.mobi/, and finish the device tests provided. This will help to identify and fill in more properties concerning the phone in question.

As a fallback, you can try finding the usableDisplayWidth property. However, the chances of this property being available when displayWidth isn't are very slim.

Posted by martenmobi 1 year ago

pic
 martenmobi
Mobile Addict
Posts: 2
Joined: 1 year ago
[offline]

garbetjie wrote:
If I'm reading the source code correctly, this is the exception that is thrown when the requested property is not found for the supplied User-Agent.

Hi GARBETJIE,

Thank you so much for your input.
As referred to in the thread at http://mobiforge.com/forum/developing/device-detection/user-agent-headers, Ta-Da incorrectly detects my phone, which might be related to the issue with Android UA strings, which Daniel Hunt mentioned.
I know DeviceAtlas works fine for most phones, but if I can't test my scripts on my own phone, then I do have a problem.
Another thing is that the Samsung website says that my phone's screen width is 240 px, while in fact it's 800 px!!
Please excuse me if I'm nitpicking, but at http://www.apple.com/iphone/specs.html it says that the iPhone has 640 x 960 (w x h) px, while the DA device list, see http://deviceatlas.com/node/205202, says it has 320 x 480. Am I missing something?
Don't get me wrong, I think you DeviveAtlas people are pioneers, but other than you nobody else in the "industry" seems very interested in getting the quirks out of the mobile net.

----- MOBIs: einstein.mobi cheguevara.mobi socrates.mobi hendrix.mobi isaacnewton.mobi gershwin.mobi erbium.mobi hafnium.mobi gadolinium.mobi etc..----- SITEs: nativeamericanart.mobi rocking.mobi martenjansen.mobi

Posted by martenmobi 1 year ago

pic
 martenmobi
Mobile Addict
Posts: 2
Joined: 1 year ago
[offline]

So how are we defining screen resolution in the mobile sphere?
In PC screens it's simply the number of pixels you have. If you create a 1024 x 768 px image then it fills your screen at the 1024 x 768 screen resolution.
If I create a 240 x 400 px image it fills only a small portion of my mobile screen, while Samsung says my screen has 240 x 400 Sub display resolution, whatever sub means.
240/400 = 0.6 is certainly the aspect ratio of my screen, as I checked, so is that how mobile phone manufacturers define screen resolution?

Quote:
screen resolution <=> aspect ratio ?

If that were so, then the DeviceAtlas database would have mostly incorrect data on screen width/height, which seems implausible.

----- MOBIs: einstein.mobi cheguevara.mobi socrates.mobi hendrix.mobi isaacnewton.mobi gershwin.mobi erbium.mobi hafnium.mobi gadolinium.mobi etc..----- SITEs: nativeamericanart.mobi rocking.mobi martenjansen.mobi

Posted by garbetjie 1 year ago

pic
 garbetjie
Mobile Guru
Posts: 70
Joined: 3 years ago
[offline]

The question is, when you create that 240x400 image, how are you testing whether it is filling your entire screen?

Are you placing it in an HTML page? If so, what HTML doctype are you using? I've found that if anything than a mobile doctype is defined, then the phone seems to "zoom out", and show everything as super tiny.

Manufacturers do refer to pixels when determining screen size. All screens have certain resolution that they can display. My laptop displays at a resolution of 1280x800. My phone is 240x320. That is how the manufacturer provides the screen resolution, and that is how Device Atlas provides it too.

Quote:
Another thing is that the Samsung website says that my phone's screen width is 240 px, while in fact it's 800 px!!

Would you be able to supply us with the user-agent string for your phone? This would help in trying to determining what the issue could be?

Quote:
Please excuse me if I'm nitpicking, but at http://www.apple.com/iphone/specs.html it says that the iPhone has 640 x 960 (w x h) px, while the DA device list, see http://deviceatlas.com/node/205202, says it has 320 x 480

I don't think you're missing anything at all. The only difference is that Device Atlas entry is showing the resolution for the iPhone 3, whereas the Apple site is showing the resolution for the iPhone 4.

Which raises an interesting question. Would Device Atlas be able to differentiate the iPhone 3 from the iPhone 4? And I mean the actual physical device, not the OS version (although, that would be helpful too).

Posted by martenmobi 1 year ago

pic
 martenmobi
Mobile Addict
Posts: 2
Joined: 1 year ago
[offline]

Hi,

garbetjie wrote:
The question is, when you create that 240x400 image, how are you testing whether it is filling your entire screen?

Are you placing it in an HTML page? If so, what HTML doctype are you using? I've found that if anything than a mobile doctype is defined, then the phone seems to "zoom out", and show everything as super tiny.

I tested images both with a direct URL to the image and in a page with a
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
doctype, which made no difference. I just kept increasing the image size until it was 800px and filled the whole screen.

garbetjie wrote:

Quote:
Another thing is that the Samsung website says that my phone's screen width is 240 px, while in fact it's 800 px!!

Would you be able to supply us with the user-agent string for your phone? This would help in trying to determining what the issue could be?

It's
Mozilla/5.0 (Linux; U; Android 2.1-update1; en-gb; GT-I5800 Build/ECLAIR) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17

garbetjie wrote:

Quote:
Please excuse me if I'm nitpicking, but at http://www.apple.com/iphone/specs.html it says that the iPhone has 640 x 960 (w x h) px, while the DA device list, see http://deviceatlas.com/node/205202, says it has 320 x 480

I don't think you're missing anything at all. The only difference is that Device Atlas entry is showing the resolution for the iPhone 3, whereas the Apple site is showing the resolution for the iPhone 4.

Which raises an interesting question. Would Device Atlas be able to differentiate the iPhone 3 from the iPhone 4? And I mean the actual physical device, not the OS version (although, that would be helpful too).

You're quite right and Apple does the right thing. They say:

Quote:
resolution 960 x 640 px at 326 ppi

Then at least we know what we're talking about. Samsung makes great devices, but the're leaving us in limbo with regard to their defintion of screen resolution. I still think the're listing the aspect ratios as screen resolutions, not screen sizes.
Apple's latest UA strings even seem to contain screen sizes:

Mozilla/5.0 (U; Mobile; iPhone; PPC; en; 240x320) AppleWebKit/525.18.1 (KHTML, like Gecko) WM5 Iris/1.1.1 Version/3.1.1 Mobile/5A345 Safari/525.20
Mozilla/5.0 (U; Mobile; iPhone; PPC; en; 240x320) AppleWebKit/525.18.1 (KHTML, like Gecko) WM5 Iris/1.1.8 Version/3.1.1 Mobile/5A345 Safari/525.20
Mozilla/5.0 (U; Mobile; iPhone; PPC; en; 240x320) AppleWebKit/525.18.1 (KHTML, like Gecko) WM5 Iris/1.1.9 Version/3.1.1 Mobile/5A345 Safari/525.20
Mozilla/5.0 (U; Mobile; iPhone; PPC; en; 400x240) AppleWebKit/525.18.1 (KHTML, like Gecko) WM5 Iris/1.1.9 Version/3.1.1 Mobile/5A345 Safari/525.20
Mozilla/5.0 (U; Mobile; iPhone; PPC; en; 400x240) AppleWebKit/525.18.1 (KHTML, like Gecko) WM5 Iris/1.1.9 Version/3.1.1 Mobile/5A345 Safari/525.20 UP.Link/6.3.1.21.0
Mozilla/5.0 (U; Mobile; iPhone; PPC; en; 480x640) AppleWebKit/525.18.1 (KHTML, like Gecko) WM5 Iris/1.1.9 Version/3.1.1 Mobile/5A345 Safari/525.20
Mozilla/5.0 (U; Mobile; iPhone; Smartphone; en; 176x220) AppleWebKit/525.18.1 (KHTML, like Gecko) WM5 Iris/1.1.8 Version/3.1.1 Mobile/5A345 Safari/525.20

That should be standard, although perhaps not in the Deviceatlas business interest :-).
However, 320×480 and 640x960 are the resolutions for iphone3 resp. ihpone4, so what are the other resolutions about? Can you adjust the resolution on an iphone, like on a PC?

Quote:
Which raises an interesting question. Would Device Atlas be able to differentiate the iPhone 3 from the iPhone 4? And I mean the actual physical device, not the OS version (although, that would be helpful too).

I did a search and it appears that the two are emitting the same UA strings, but, as the page at http://www.mobilexweb.com/blog/iphone4-ios4-detection-safari-viewport says:

Quote:
Apple decided to give iPhone 4 automatic support for every iPhone-optimized website available in the web

so the the Deviceatlas values for the iphone would work for the iphone4 too.

Geez, http://www.mobilexweb.com/blog/iphone4-ios4-detection-safari-viewport shows that I have a lot to learn about mobile design. Doing a search for the media attribute, I end up at http://www.w3schools.com/html5/att_a_media.asp. Given the dominance of the iphone it would be interesting to get a reference on what CSS OIS 4 supports.

----- MOBIs: einstein.mobi cheguevara.mobi socrates.mobi hendrix.mobi isaacnewton.mobi gershwin.mobi erbium.mobi hafnium.mobi gadolinium.mobi etc..----- SITEs: nativeamericanart.mobi rocking.mobi martenjansen.mobi

Posted by daniel.hunt 1 year ago

pic
 daniel.hunt
dotMobi logo
Mobile Grandmaster
Posts: 230
Joined: 4 years ago
[offline]

I should point out that those Apple UAs that you've listed are actually for the Iris browser, not the default Safari one!

Daniel Hunt
dotMobi

Posted by martenmobi 1 year ago

pic
 martenmobi
Mobile Addict
Posts: 2
Joined: 1 year ago
[offline]

daniel.hunt wrote:
I should point out that those Apple UAs that you've listed are actually for the Iris browser, not the default Safari one!

By Jove, you're right!

Well, I've got DeviceAtlas up and running and on the whole doing marvelous, kudos.
I will even get the monthly update for $99, don't spend it all at once....

cheers
Marten

----- MOBIs: einstein.mobi cheguevara.mobi socrates.mobi hendrix.mobi isaacnewton.mobi gershwin.mobi erbium.mobi hafnium.mobi gadolinium.mobi etc..----- SITEs: nativeamericanart.mobi rocking.mobi martenjansen.mobi

Posted by daniel.hunt 1 year ago

pic
 daniel.hunt
dotMobi logo
Mobile Grandmaster
Posts: 230
Joined: 4 years ago
[offline]

Hah :)
Well, if you ever feel that you need more updated device data you'll need to look at the Standard/Premium licences, but at least you have your foot on the detection ladder!

Let us know if you have any issues with it at all.
Daniel

Daniel Hunt
dotMobi

Posted by martenmobi 1 year ago

pic
 martenmobi
Mobile Addict
Posts: 2
Joined: 1 year ago
[offline]

Hi Daniel,

Well, I hope I'm not asking too much, but I'm running into some issues. No problems with the Sample.json file, but while using 20110301.json (downloaded today), I get:

Quote:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 16 bytes) in /home/painting/public_html/addon/Mobi/Mtld/DA/Api.php on line 82

This is running on a simple shared account (PHP v. 5.2.9).... Do I need more memory?

Also, the page at http://deviceatlas.com/properties lists the isTablet property, but using Mobi_Mtld_DA_Api::listProperties I don't see the isTablet property. Is this an API version thing? I use v. 1.4.1.

thanks/regards
Marten

----- MOBIs: einstein.mobi cheguevara.mobi socrates.mobi hendrix.mobi isaacnewton.mobi gershwin.mobi erbium.mobi hafnium.mobi gadolinium.mobi etc..----- SITEs: nativeamericanart.mobi rocking.mobi martenjansen.mobi