function androidKeyboardFix() {
  var rememberedDeviceWidth = window.innerWidth;
  var rememberedDeviceHeight = window.innerHeight;
  var keyboardHeight;

  window.addEventListener('resize', resize);

  function resize() {

    //If the width of the window changes, we have an orientation change
    if (rememberedDeviceWidth !== window.innerWidth) {
      rememberedDeviceWidth = window.innerWidth;
      rememberedDeviceHeight = window.innerHeight;
      console.info('orientation change. deviceWidth =', rememberedDeviceWidth, ', deviceHeight =', rememberedDeviceHeight);

    //If the height changes, and it's less than before, we have a keyboard open
    } else if (rememberedDeviceHeight !== window.innerHeight &&
               window.innerHeight < rememberedDeviceHeight) {
      document.body.classList.add('footer-hide');
      //Wait for next frame so document.activeElement is set
      ionic.requestAnimationFrame(handleKeyboardChange);
    } else {
      //Otherwise we have a keyboard close or a *really* weird resize
      document.body.classList.remove('footer-hide');
    }

    function handleKeyboardChange() {
      //keyboard opens
      keyboardHeight = rememberedDeviceHeight - window.innerHeight;
      var activeEl = document.activeElement;
      if (activeEl) {
        //This event is caught by the nearest parent scrollView
        //of the activeElement
        ionic.trigger('scrollChildIntoView', {
          target: activeEl
        }, true);
      }

    }
  }
}
A consistent way of creating unique IDs in angular. The ID is a sequence of alpha numeric
characters such as '012ABC'. The reason why we are not using simply a number counter is that
the number string gets longer over time, and it can also overflow, where as the nextId
will grow much slower, it is a string, and it will never overflow.

@returns an unique alpha-numeric string