|
-
Jul 9th, 2012, 10:23 AM
#1
Thread Starter
Addicted Member
Detecting mobile content
This isn't specifically about mobile programming but more about detecting mobile content so I would guess mobile gurus can advise on this....
Basically my VB.Net app is pulling down pages from servers using a webrequest. I parse these files to determine their content type etc.
I want to detect mobile content which is easy for the likes of :
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN"
"http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN"
"http://www.wapforum.org/DTD/wml12.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD Compact HTML 1.0 Draft//EN">
However looking at a few of the mobile frameworks (jquery to name one) they don't require any kind of signature. Having checked the content-type of a number of sites this also doesn't give anything away.
I could parse the script tags and assume that if there is a framework attached it is in use, but this seems like a pretty ropey assumption and requires me to know about all frameworks.
How would you propose that I detect if a page is a mobile one?
Should developers really be adding a DOCTYPE as good practice?
-
Jul 28th, 2012, 11:48 PM
#2
Addicted Member
Re: Detecting mobile content
You could try changing the user agent string to something with the word "mobile" in it. Some sites detect a mobile browser by searching for the word. It works, too, unless the mobile user changed his user agent string to that of a desktop browser.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|