SkyTech Geeks: MobileESP Included in HTML5 Frameworks for Mobile List

This is pretty cool!

We recently ran into this listing of great HTML5 frameworks useful for mobile app development — and noticed that MobileESP made the cut!

http://skytechgeek.com/2011/11/html5-frameworks-and-useful-apps-for-mobile-web-development/

The projects all look great — a few of which were new to me. I’m slowly working my way through them in my spare time. Definitely peruse the list when you have a few moments and check them out. Let us know what you think of them!

 

FYI: This page has been translated into Serbo-Croation: http://science.webhostinggeeks.com/mobilni-dizajn

 

Posted in General, Mobile Web Site Design

MobileESP as a WordPress Plugin

James Mehorter has kindly supported MobileESP in the past and helped identify a couple of holes in the MobileESP detection code (usually around random BlackBerry devices). (And yes, we’ve added some of them to our official new useragent test list.)

Well, James has published a mobile device detection plugin for WordPress using MobileESP. From the official description:

“Device Theme Switcher” by James Mehorter uses MobileESP to let theme developers and website administrators select which WordPress theme is delivered to Handheld devices, and which theme is delivered to tablet devices, while still showing the primary theme to computer users.  http://wordpress.org/extend/plugins/device-theme-switcher/ 

Thanks for your hard work on that project, James! Those are good download numbers, too. The last time I looked, the plugin had around 5,000 downloads.

Posted in Projects Using MobileESP

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)

Posted in Code Updates, General, MobileESP APIs

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

Posted in General, UserAgent Test Strings

HP/Palm Has Released the Enyo Web UI Framework

Hi, folks —

In case you haven’t heard already, HP/Palm has released the UI framework they used to build the WebOS UI as a free open source JavaScript/CSS framework. That’s right: the WebOS was built using Web technologies — not Java, C++, or something else!

Check out the Enyo JS framework & have fun exploring their samples pages:

www.enyojs.com

Be sure to review the “StyleMatters” sample, which encapsulates what looks like all of the UI components Palm used on WebOS’s distinctive (and gorgeous) UI layer.

http://enyojs.com/samples/stylematters/

Caution

There is one word of warning, though. Enyo renders best on WebKit-based browsers. Some of the UI components render OK on my Windows Phone 7 test device, but not all of them. And unfortunately, the StyleMatters sample doesn’t render at all on my Windows Phone 7 device. I haven’t tested the StyleMatters sample with Firefox or Opera Mobile on an Android device, but I expect there to be significant rendering issues with these browsers, as well.  🙁

Advice for Using Enyo with MobileESP

If you decide to develop a web site or application with the Enyo JS UI framework, remember that it works best with WebKit-based browsers. As of today, it’s probably not reliable with Internet Explorer, Firefox, or Opera, whether mobile or desktop browsers.

You would also want to limit your Enyo-based web app to the iPhone Tier devices and perhaps also Tablet Tier. This means that you might consider making a different mobile version of your site available to devices using non-WebKit browsers (e.g., on Android, Windows Phone, or BlackBerry), even if they’re in the iPhone or Tablet tiers.

Your Enyo web development strategy might look something like this:

  • Tablet Tier, WebKit Only: Enyo OK
    • Non-WebKit Browsers: Mobile-friendly desktop or generic mobile site
  • iPhone Tier, WebKit Only: Enyo OK
    • Non-WebKit Browsers: Generic mobile site
  • All Other Mobile Devices: Provide the generic mobile site.

Therefore, you would want to determine whether to serve an Enyo-built site using the iPhone or Tablet Tier API calls with the WebKit calls. Here is a pseudo-code example:

if (DetectMobileQuick() == true)

{

if ((DetectTierIphone() == true) && (DetectWebkit() == true))

//Serve the Enyo-built phone screensize-optimized site

else

//Serve the generic mobile phone site with no JavaScript and extremely simple CSS

}

(What do we mean by “iPhone Tier,” “Rich CSS” or “Generic Mobile” devices? You may wish to refresh your memory by reviewing this blog article we wrote.)

Summary

If you’re looking for a beautiful UI framework as an alternative to jQuery Mobile, Sencha Touch, and a few others out there, then Enyo is worth your consideration. You’ll also be happy to hear that Enyo is object-oriented and now totally free and open source. Thanks, Palm!

– Anthony

Posted in General, MobileESP APIs

MobileESP: ASP.NET Updates

Hi, folks —

The 2 flavors of the ASP.NET code library were updated with two issues specific to that code base. The updates are now live on Google Code.

  • The starting quote was missing for the vndRIM variable’s value.
  • Removed the class statement, “using System.Linq.” The Linq API wasn’t actually used. Removing the Linq statement gives us an added bonus: compatibility for the ASP.NET code now drops from .NET 4.0 to .NET 2.0.

Many thanks to Brian W. for pointing out these issues and their solutions!

– Anthony

Posted in Code Updates, General, MobileESP APIs

MobileESP: Updated for Kindle

Hi, folks —

Thanks to some questions from Dave M., we realized that MobileESP had inconsistent support for detecting the Amazon Kindle e-Ink devices as mobile devices, plus, they were also reporting “true” as Rich CSS Tier devices (which they are not). In addition, MobileESP had no support for detecting the Amazon Kindle Fire devices in Silk browser acceleration mode, which uses a different useragent string.

We updated the MobileESP code bases twice today. The first was to standardize support for detection of the Kindle e-Ink device. Then we remembered that we had wanted to also add support for detecting the Silk browser acceleration, so we updated all of the libraries a second time to add the Silk browser support.

Here is the specific list of updates which affects the following libraries: PHP, JavaScript, Java, ASP.NET (both variants), and Python.

  • Updated DetectRichCSS(): Excluded e-Ink Kindle devices, which all run black and white displays.
  • Created DetectAmazonSilk(): Created to detect Kindle Fire devices in Silk mode.
  • Updated DetectMobileQuick(): Updated to include e-Ink Kindle devices and the Kindle Fire in Silk mode.

Open Issue: Currently, the Android-based Kindle Fire browser is detected as a Rich CSS Tier device when in Silk mode. When Silk mode is off (i.e., normal Android browsing mode), then the device is currently reporting itself as an Android phone. (This is common behavior for 7″ Android tablets.) We’re not sure that this is the best strategy for Silk mode — should Silk mode be in the Rich CSS or basic mobile device category alongside feature phones? Please let us know your feedback.

As always, if you’d like updates on MobileESP, subscribe to the changes log on Google Code.

– Anthony

Posted in Code Updates, General, MobileESP APIs

MobileESP: Updated for BlackBerry Curve Touch 9380

Hi, folks —

A quick update to the code libraries today.

ALL LIBRARIES: PHP, JavaScript, Java, ASP.NET (both), Python

Added support for the BlackBerry Curve Touch 9380. It’s a new monoblock all-touchscreen device from BlackBerry and is a little smaller than a Storm. Because the screen is (reasonably) large and it lacks a keyboard, we decided to add support to it to the DetectBlackBerryTouch() method. (Special thanks to Robert P. for bringing the recent launch of this device to our attention.)

PHP Bug Fix

Fixed a bug in the DetectKindle() method. The call to DetectAndroid() needed the class identifier (“this”). (Special thanks to the several people who wrote in about this one.)

Python Bug Fix

In adding support for the Curve Touch to the DetectBlackBerryTouch() method, we noticed a copy & paste error in the code. All of the existing lines of code were looking for the Storm device only. Oops! So we added in support for all necessary devices: Storm, Torch, Bold Touch and Curve Touch.

All libraries have been updated in the Google Code project and are available for download now.

– Anthony

Posted in Code Updates, MobileESP APIs

MobileESP: Ported to Python!

Hi, folks —

The community has delivered another great port of MobileESP! Jury Gerasimov sent me an email last week with the good news.

Jury’s company in Irkutsk, Russia, (that’s one of the largest cities in Siberia!) has been developing a bus monitoring service. The web site was built in Python for the Django web app framework. In Jury’s own words:

We’ve made 3 versions of the web interface – desktop, modern mobile and old mobile – available on the same URL. To detect which version the server should display, we needed some server-side script, and MobileESP has the most usable set of functions among other solutions. Our main developers were quite busy, so Python translation was made by freelance guy. He knew the code will be opened so kept the structure and comments close to original.

Check out the mobile version of their bus tracking web app: www.irk.fm/bus/ (Note that the web site is in Russian naturally.)

For you Python lovers, here is the sample code they used to integrate MobileESP in Django. It looks pretty simple…

  from mobileesp import mdetect

  user_agent = request.META.get("HTTP_USER_AGENT")
  http_accept = request.META.get("HTTP_ACCEPT")
  if user_agent and http_accept:
       agent = mdetect.UAgentInfo(userAgent=user_agent, httpAccept=http_accept)
       #Do first! For iPhone, Android, Windows Phone 7, etc.
       if agent.detectTierIphone():
           HttpResponseRedirect('/myapp/i/')
       #Then catch all other mobile devices
       if agent.detectMobileQuick():
           HttpResponseRedirect('/myapp/m/')
  #For traditional computers and tablets (iPad, Android, etc.)
  return HttpResponseRedirect('/myapp/d/')  

Moving forward, we will be hosting the Python codebase in the MobileESP project on Google Code. (See the Download Page for details.) Jury and his team will assist in reviewing and testing updates.

For more information about the Python port or to contact Jury for more information about his company’s services, please email Jury directly: jury@softshape.com.

Cheers,

Anthony

Posted in Code Updates, General, How To - Python, MobileESP APIs, Projects Using MobileESP

MobileESP: Ported to Classic ASP (VBscript)!

Hi, folks —

I’ve been remiss in sharing this good news…

A few weeks ago, I received an email from Miguel Barrero that he has ported MobileESP to Classic ASP — which means classic VBscript. So for you folks who work at places still using Classic ASP to pump out the pages, you can now also detect and optimize your web sites for mobile devices! Who says the iPhone and Android can’t get all snuggly with VBscript??  🙂

To download your copy of MobileESP for Classic ASP (VBscript), point your browser to:

https://bitbucket.org/mbarrero/mobileesp-classic-asp

Please note that Miguel is maintaining the Classic ASP code in his spare time, so the VBscript library may be a little bit behind changes made to the main MobileESP code libraries.

Thanks again, Miguel!

 

 

Posted in Projects Using MobileESP

Updated: Performance Enhancements for ASP.NET

Hi, folks —

Doug D. contributed some performance enhancements updates for the two ASP.NET variations of MobileESP. Here is a summary of changes:

  • Variables: Converted the private member strings to constants for faster object creation.
  • Removed unused property: deviceXoom.
  • Wrote member strings in UPPERCASE rather than calling the ToUpper() on each one.
  • Added a note to OnInit() that one may optionally override InitializeCulture() instead so that the mobile detection can happen earlier in page’s lifecycle, if necessary.

Thank you for the contributions, Doug!

Anthony

 

Posted in Code Updates, MobileESP APIs

MobileESP in Action: The OpenCart Mobile Framework

Hi, folks —

We recently received an email from Rumen Dmitrov who told us how he’s using MobileESP in his commercial project…

“I use MobileESP as an essential part of my new project called OpenCart Mobile Framework http://bit.ly/rxJ8Ot. MobileESP cares for the automatic mobile device detection which I use to redirect visitors to a dedicated mobile theme. This helps me have separate mobile and desktop page templates which increases the speed of any OpenCart store by 2700% when accessed on mobile.

“I knew I had to find a way to detect devices on the server, and not through media queries, because the mobile-first approach starts on the server. If I had thought otherwise the mobile visitors would have been burdened by having to download 500k of useless (on mobiles) data and having to reformat it.”

We would like to showcase more projects using MobileESP. Please send me (Anthony) an email about how your project is using MobileESP, and we’ll post a note here on the blog!

Cheers,

Anthony

Posted in Projects Using MobileESP