1

我刚刚在我的 OSX (10.7.4) 上安装了 Android SDK(修订版 20.0.3),因为我想运行 Android Emulator 只是为了使用 Android 浏览器测试我的基于 Web 的移动应用程序。

我下载了 SDK,运行了包更新管理器等,然后通过 GUI 为 2.2 设置了一个 Android 虚拟设备,我可以成功启动模拟器,但它似乎根本没有响应任何输入。我点击 UI 触摸屏或键盘/主页/菜单按钮等,Android 模拟器没有响应。我什至无法打开浏览器或做任何事情。谁能提出问题可能是什么?

任何帮助,将不胜感激。

4

1 回答 1

-3

您是否尝试过包含 Zepto.js 而不是标准的 Javascript 库而不是普通的 Jquery.js 文件?

它的响应速度要快得多,因为它是一个更轻的包,可以在慢速的 Android 模拟器上发光。

为了测试您的点击事件并加快点击响应,请包含来自 fwebdev 的 fastclick.js

如果两者都不起作用,请尝试 Dolphin Browser:https ://play.google.com/store/apps/details?id=mobi.mgeek.TunnyBrowser&hl=en

https://gist.github.com/2168307

//======================================================== FASTCLICK
function FastButton(element, handler) {
    this.element = element;
    this.handler = handler;
    element.addEventListener('touchstart', this, false);
};
FastButton.prototype.handleEvent = function(event) {
    switch (event.type) {
       case 'touchstart': this.onTouchStart(event); break;
       case 'touchmove': this.onTouchMove(event); break;
       case 'touchend': this.onClick(event); break;
       case 'click': this.onClick(event); break;
    }
 };
FastButton.prototype.onTouchStart = function(event) {
    event.stopPropagation();
    this.element.addEventListener('touchend', this, false);
    document.body.addEventListener('touchmove', this, false);
    this.startX = event.touches[0].clientX;
    this.startY = event.touches[0].clientY;
    isMoving = false;
 };
FastButton.prototype.onTouchMove = function(event) {
    if(Math.abs(event.touches[0].clientX - this.startX) > 10 || Math.abs(event.touches[0].clientY - this.startY) > 10) {
       this.reset();
    }
 };
FastButton.prototype.onClick = function(event) {
    this.reset();
    this.handler(event);
    if(event.type == 'touchend') {
       preventGhostClick(this.startX, this.startY);
    }
 };
FastButton.prototype.reset = function() {
    this.element.removeEventListener('touchend', this, false);
    document.body.removeEventListener('touchmove', this, false);
};
function preventGhostClick(x, y) {
    coordinates.push(x, y);
    window.setTimeout(gpop, 2500);
};
function gpop() {
    coordinates.splice(0, 2);
};
function gonClick(event) {
    for(var i = 0; i < coordinates.length; i += 2) {
       var x = coordinates[i];
       var y = coordinates[i + 1];
       if(Math.abs(event.clientX - x) < 25 && Math.abs(event.clientY - y) < 25) {
          event.stopPropagation();
          event.preventDefault();
       }
    }
};
document.addEventListener('click', gonClick, true);
var coordinates = [];
function initFastButtons() {
    new FastButton(document.getElementById("fastclick"), goSomewhere);
};
function goSomewhere() {
    var theTarget = document.elementFromPoint(this.startX, this.startY);
    if(theTarget.nodeType == 3) theTarget = theTarget.parentNode;
    var theEvent = document.createEvent('MouseEvents');
    theEvent.initEvent('click', true, true);
    theTarget.dispatchEvent(theEvent);
};
//========================================================

//When using jQuery call init on domReady-Event
$(document).ready(function() {
initFastButtons();
})
于 2012-11-10T04:43:40.170 回答