Archive for July, 2012

MobileESP JavaScript: OOP Beta 1 Released!

Hi, folks –

As MobileESP has added new methods and variables, I’ve been more & more concerned with the potential for API collisions with other JavaScripts that may be present on the page. So I decided to work on converting the standard JavaScript code into an Object Oriented model using the literal notation technique. Since I had to touch each function anyways, I decided it was time for a deep review of the JavaScript code, as well. Simultaneously, I drafted a list of test useragent strings and tested each one against our new UA test list.

Download: OOP JavaScript Beta 1 (July 22, 2012)

REGULAR JAVASCRIPT METHOD

In the normal JavaScript method, this is how you would include and use the code to test for iPhone Tier devices (including Android and Windows Phone 7). Notice how the JS function call is available as if it had been defined on the same page.

//In the Header, load the file:

<script type=”text/javascript” src=”code/mdetect.js”></script>

<script type=”text/javascript” language=”JavaScript”>

if (DetectTierIphone())

//Do something interesting, like redirect to a mobile page

//or promote the link to the iOS app store.

</script>

OOP JAVASCRIPT METHOD

Using this OOP method, all function calls and interesting variables are accessed within a new object called “MobileEsp.” So, only one line needs to change as we add “MobileEsp.” to the function call:

//Do the stuff listed above…

if (MobileEsp.DetectTierIphone())

//Do something interesting

CHANGE LOG

In addition, I made numerous tweaks and updates to the JavaScript code. If the JavaScript switch to the OOP model is well accepted by the community, and any bugs get fixed, then I’ll start porting these tweaks and updates to the other libraries. A few people have sent in a few other requests for coding changes (especially to PHP), which I’ll also try to get in. Here are some highlights of the JavaScript updates:

  • Added global variables for quick access to these very useful Boolean values: IsWebkit, IsMobilePhone, IsIphone, IsAndroid, IsAndroidPhone, IsTierTablet, IsTierIphone, IsTierRichCss, IsTierGenericMobile
  • Simplified OperaMobile().
  • Moved the following from DetectMobileQuick() to DetectMobileLong(): DetectDangerHiptop(), DetectMaemoTablet(), DetectGarminNuvifone(), devicePda.
  • Added DetectBada(). Added it to DetectSmartphone & iPhone Tier, too.

BETA TEST FEEDBACK

Please review & test the proposed code for the new OOP JavaScript object and its many tweaks and updates. Please send feedback to me (Anthony) no later than Friday, August 10, 2012. I’d like to be able to incorporate all of the feedback and publish an official switch to OOP by the end of August.

Thank you for your continued support of MobileESP, your energies, and your ideas on how to make it better for the entire community!!!

Anthony

(anthony.hand [at] gmail [dot] com)

Comments

MobileESP: First Draft of Test UserAgent Strings Released!

Hi, folks –

One of the people in the MobileESP community is a software QA tester (I think). Dave M. very kindly took it upon himself to start putting together a long list of useragent strings that we could use for testing. Previously, I had been informally testing MobileESP against UA strings I might find online or by testing a device in a store. Useful, true, but as time goes on, it’s good to keep track of the UA strings that were new or different enough to impact the MobileESP codebase.

I’ve been very, very slowly going through Dave’s list and putting together of spreadsheet of UA strings that I think are the most useful to put into a test suite. I don’t think that we need thousands, just a few dozen or so of the most important ones. For example, we should definitely track UA strings for very popular devices, if have an unusual combination of elements, and at least one UA string for each supported function call in the API.

So let’s officially launch the very first draft of the MobileESP UserAgent Test Strings! This rough first draft is dated July 22, 2012, and is released in 2 formats: an Excel spreadsheet and a CSV file.

HOW TO PROVIDE FEEDBACK

Your feedback on this spreadsheet is much appreciated! However, I can’t study each cell to spot the subtle differences. So, if you would like to provide feedback, please do the following:

  • The THIRD worksheet tab is entitled, “UA Strings to Add to Test Suite.” Please put any new UA strings in this worksheet.
  • If you have any corrections, please copy them into the “UA Strings to Add to Test Suite” worksheet, also. Highlight each changed cell in YELLOW so I’ll see it quickly. Please add a special comment so that I’ll understand your rationale.

Please note that this little project to track the most important UA strings for testing will be an ongoing project. Any thoughts on how to best manage the process would also be appreciated.

Thanks again Dave M. for kicking this important side project into gear!

- Anthony

Comments