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

Comments

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!

 

 

Comments (2)

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

 

Comments

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

Comments (1)

Updated: Windows Phone 7, BlackBerry Bold Touch, Kindle Fire

Hi, folks –

I made a few updates to the code today. Here is a summary of the changes, which are also listed at the top of each file.

PHP Only:

    • Created a constructor method per new features in PHP 5.0: __construct(). (Thanks, Lee C.!!)

All Code Libraries: PHP, JavaScript, Java, ASP.NET

    • Added a new variable for 2 versions of the new BlackBerry Bold Touch (9900 and 9930): deviceBBBoldTouch.
    • DetectTierIphone(): Moved Windows Phone 7 to the iPhone Tier. WP7.5′s IE 9-based browser is good enough now.
    • DetectBlackBerryTouch(): Updated to support the 2 versions of the new BlackBerry Bold Touch (9900 and 9930). (Thanks, Robert P.!!)
    • DetectKindle(): Updated to focus on eInk devices only. The Kindle Fire should be detected as a regular Android device.

As a side note, I also learned how to “checkout” and “commit” the code updates in SVN to Google Code. Now, file updates are truly updated versions of the same file in the Google Code system rather than an entirely new file with no history. I know, it’s a silly thing that I should have learned ages ago, and my apologies for not having done so sooner. So all of today’s updates are posted as Update r205. (Let’s just say that a switch to Mac and the Versions client were the main reasons…) :-)

 

Cheers,

Anthony

 

Comments

Known Issue: Firefox on Android Phones

James M. sent us a note just before Christmas about a support issue affecting the Firefox browser on Android phones. Here is a quick overview of the issue.

Issue Summary: When using the Firefox browser on an Android mobile phone, the MobileESP code library erroneously reports the device as an Android tablet. An Android tablet is correctly identified as an Android tablet. This issue only affects mobile phones and similar small-screen Android devices like MP3 players (such as the Samsung Galaxy Player).

Root Cause: Mozilla uses the exact same useragent string for both phones and tablets. The string has the word “Android” in both. According to Google guidelines, Mozilla should include the word “mobile” in the useragent string for mobile phones. Unfortunately, Mozilla is not compliant with Google’s guidelines. The omission of the word “mobile” is the reason why phones are erroneously identified as tablets.

Work Around: MobileESP works by finding clues to the device type in the useragent string. Because Mozilla uses the same exact string when installed on both phones and tablets, MobileESP cannot recognize which type of device the browser is installed on. Here are some options:

    1. Don’t worry about it too much right now. Let’s hope Mozilla does the right thing and implements Google’s guidelines on the words to include in browser useragent strings on Android.
    2. Err on the side of mobile phones. Modify the code library to always return “true” for Android Phones and always return “false” for Android Tablets. You would do this by looking for the words “gecko” and “firefox” in the useragent string in each respective detection method. On the plus side, phone-optimized sites aren’t too awful on tablets. On the minus side, we aren’t fond of hacks like this, so we won’t officially add this hack to the MobileESP baseline.
    3. Write to Mozilla. Ask them to follow Google’s guidelines for useragent string construction. (We’re not sure if the best feedback forum is through the MDN or the mobile project forum. In the Android Market, Mozilla provides this email address for feedback: FirefoxforAndroid@mozilla.com)
We’re sorry that there is no fix to this issue at the present time within the MobileESP code base. It’s really up to Mozilla to fix this one themselves.

Comments

Happy New Year!

Happy New Year, everyone!

It’s 2012 and MobileESP is a little over three years old! Let’s pause a moment and reflect upon where we’ve come…

Project founder Anthony Hand started MobileESP in late 2008 to help solve a very real need — a lightweight, easy to use/customize/install code library for web publishers that offered a unique rollup of mobile detection by OS, device category, and “tier.” Initially, the code was shared on Anthony’s freelance mobile UI design web site, Hand Interactive. Two years ago, following up on the growing usage & code ports (to Java and ASP.NET) by the community, Anthony formally launched the MobileESP web site.

Since then, the code library has grown significantly, with many updates, refinements, additional code ports (e.g., Ruby), the addition of tablet support, API lists, new documentation and samples, and more. Many thanks to everyone who has contributed in any way. MobileESP wouldn’t be where it is today without your support!

Who knows what the future may hold? Assuming the Mayans got it wrong and the world won’t end this year, we expect to see MobileESP integrated into a greater range of projects and web sites across the interwebs. If you have created a cool project of your own that incorporates MobileESP, please let Anthony know so we can put a post about it on the blog!

Warm regards for a healthy, prosperous, and fun New Year!

Comments (1)

Happy Thanksgiving!

To all of our American friends: Happy Thanksgiving!

This is just a quick note to let you know that we’re still alive. It’s just been a couple of months of very slow news, so to speak. Here are a few quick thoughts.

Windows Phone 7.5 (“Mango”): Our Samsung Focus device was recently updated to the newest version of Windows Phone. And well, well, well… The browser is actually pretty nice! It *seems* that the latest version of IE9+ on the phone runs iPhone-tier web pages (with the JavaScript and CSS) pretty well! Come the New Year (January 2012), we’ll update the libraries and add Windows Phone 7 back into the iPhone Tier of devices. We’ll just wait another few weeks for the legacy first generation of devices to finish updating… Most of them ought to have been updated by Christmas or so.

Amazon Kindle Fire: This intriguing 7″ Android tablet has a very interesting browser story. Its browser is called Silk and it includes a lot of processing on a server before it’s served to the device. Sometime after we receive ours, we’ll take a look at its useragent and try to put it through some tough iPhone Tier web sites to see how it measures up.

Barnes & Noble Nook Tablet: We’ll also try to take a look at the new Nook Tablet, also 7″ and running a customized version of Android. It is being released around the same time as the Kindle Fire.

Do you have any news or views on the new WP7.5 Mango, Kindle Fire, or Nook Tablet devices? If so, let us know in the comments!

Comments

DetectAndroidTablet() Updated

Those > and < marks get me every freakin’ time…

I just uploaded a new version of the MobileESP code to fix a bug I introduced in the last update in DetectAndroidTablet(). Please accept my apologies for that! Thank you to René B. for catching the bug.

Comments

Minify Your MobileESP!

Hi, folks –

As you may recall, the MobileESP code is written first and foremost so that it’s easy for you to read and customize. Although feedback from people in the field report that the code executes quickly and efficiently on production servers, there’s something you can do to help speed up processing a little more: minify it!

The process of minifying code removes white spaces at the very least, such as spaces, tabs, and line breaks. Depending on other options you choose, it may also remove comments and shorten the method and variable names (also called “obfuscation” because it also makes the code harder to read). So depending on the level of minification selected, you can enjoy significant size reductions!

Brooke D. kindly wrote in to share her favorite PHP minification tool online created by the web hosting company, CustomHost. Brooke reports that she’s been enjoying about a 50% reduction in file size to just 16 kb with no problems in performance. Check it out:

http://customhost.com.ua/php-minify/

 Do you have a favorite online JavaScript minifier tool? Please let us know!

 

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

Comments (1)

« Previous Page« Previous entries « Previous Page · Next Page » Next entries »Next Page »