Thursday, November 10, 2011

Mobile Javascript Links

Before I forget, I wanted to pass on some helpful bookmarks
for mobile javascript:



Here's how you do that mini-scroll on page load to hide the address bar:

   setTimeout(function(){
       // Hide the address bar!
       window.scrollTo(0, 1);
   }, 0);


Here's a very fancy network detector:

/**
 * Original idea:
 * http://stackoverflow.com/questions/4697470/detecting-wifi-connectivity-in-mobile-safari
 *
 * but more importantly here:
 * http://www.thefutureoftheweb.com/blog/image-onload-isnt-being-called
 *
 */
metai.checkNetwork = function( contentId ){

       var imageEl=document.
       createElement('img');
       var imageurl=hostURI+contextRoot+'/image/mobile/login/caution.png';
       imageEl.style.visibility='hidden';
       //imageEl.onload=metai.networkLoad;
       //var imagetook=0;
       var startDate=new Date();
       imageEl.onload=function(){
           var endDate=new Date();
           var latency=endDate.getTime()-startDate.getTime();
           //alert(latency);

           if( latency < 200 ){
               playFast( contentId );
           }else{
               playSlow( contentId );
           }
       }

       imageEl.src=imageurl+'?r='+Math.round(Math.random()*1000);
       document.body.appendChild(imageEl);

}

Tuesday, November 1, 2011

List of Helpful Mac Apps

I'm starting this post to collect the most useful OSX utilities as I run across them.
  1. WMA converter:  http://www.nch.com.au/switch/index.html

Friday, October 28, 2011

Smell My Awesomeness

This week I launched my first mobile product.  It's a simple html/javascript product optimized for mobile devices.  I'm pretty proud of it, but the content is NSFW so I'm not forwarding a direct link yet.  But here's some customer feedback that makes me proud:

"Only dissapointment is that it works infinitely better and more fluidly than the actual site itself – and my 3G connection is poor in comparison too!"

Yes, I am one proud papa this week.

Wednesday, October 26, 2011

Why Mobile Safari is the IE6 of Today

I just completed my first mobile app.  Yes, I'm at least two years behind the curve.  What else is new?  Here's what I learned:
  1. JQuery Mobile is a waste of time.
  2. Everything works as expected on Android Mobile and Tablets.
  3. Safari Mobile will not respond to javascript "focus" events.
Let me explain in more detail.

Regarding #1:

I really wanted to like JQuery Mobile because I'm a big believer in JQuery.  But like JQuery UI, the code is very heavy and their CSS is very restrictive.  But the mobile product takes it one step further by adding animations that are SLOW.  It desperately tries to mimic native application behaviors like sweeping screen transitions that users ultimately don't care about especially if they hurt performance.

Regarding #2:

That's just it.  On Android Mobile browsers, everything just works.

Regarding #3:

This quora post explains the problem well:

http://www.quora.com/Mobile-Safari-iPhone-or-iPad-with-JavaScript-how-can-I-launch-the-on-screen-keyboard

And the money answer by Allen Pike says it all:  "focus() doesn't bring up the on-screen keyboard in Mobile Safari by design. A lot of sites would do focus() unnecessarily and bringing up the keyboard is slow/intrusive."

Intellectually, I understand this point of view.  But it's an attitude that onlyt a company with 90% market share gets to have.  And it sucks for the rest of us.

    Slideshare needs to die a horrible death.

    Why is it every time after a google search, that I click on a slideshare link, their flash player hangs any browser I use?  And on top of that, the content is shit.  People put crap information in PP files.  My loathing for them is second only to roseindia, another tech site of shite.

    Monday, October 24, 2011

    Time Has Come Today

    I've been needing a place to store all my horrifically boring stories about my mundane solutions to the world's current internet plumbing problems.  Stackoverflow.com does a good job but sometimes a man has to put his own pee stain in the snow.